/* ========================================
   Styles globaux
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
}

/* ========================================
   Page Galerie (index.php)
   ======================================== */
body.gallery-page {
    background: #f0f0f0;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
    color: #333;
    margin-bottom: 20px;
}

/* Formulaire de connexion */
.login-form {
    max-width: 400px;
    margin: 50px auto;
}

.login-form input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.login-form button {
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.login-form button:hover {
    background: #0056b3;
}

.error {
    color: #d9534f;
    padding: 10px;
    margin: 10px 0;
    background: #fee;
    border-radius: 4px;
}

/* En-tête galerie */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.refresh-btn {
    padding: 8px 16px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

.refresh-btn:hover {
    background: #0056b3;
}

.logout-btn {
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

.logout-btn:hover {
    background: #c82333;
}

/* Galerie */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.image-name {
    padding: 10px;
    background: #f8f9fa;
    font-size: 14px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.no-images {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Info galerie */
.gallery-info {
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    color: #666;
    font-size: 14px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    padding: 20px 0;
    flex-wrap: wrap;
}

.pagination-btn,
.pagination-number {
    padding: 8px 12px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.3s;
}

.pagination-btn:hover {
    background: #0056b3;
}

.pagination-number:not(.active):hover {
    background: #0056b3;
}

.pagination-btn.disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-numbers {
    display: flex;
    gap: 5px;
}

.pagination-number {
    min-width: 35px;
    text-align: center;
}

.pagination-number.active {
    background: #28a745 !important;
    font-weight: bold;
    cursor: default;
    pointer-events: none;
}

/* ========================================
   Page Détail (detail.php)
   ======================================== */
body.detail-page {
    background: #1a1a1a;
    color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* En-tête détail */
body.detail-page .header {
    background: #2a2a2a;
    padding: 15px 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    margin-bottom: 0;
}

.nav-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn:hover {
    background: #0056b3;
}

.btn-download {
    background: #28a745;
}

.btn-download:hover {
    background: #1e7e34;
}

.btn-back {
    background: #6c757d;
}

.btn-back:hover {
    background: #545b62;
}

/* Contenu principal */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
}

.image-container {
    max-width: 90%;
    max-height: 70vh;
    margin: 20px 0;
    position: relative;
}

.image-container img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* Navigation images */
.navigation {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}

.nav-arrow {
    background: #444;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 16px;
    min-width: 100px;
    text-align: center;
}

.nav-arrow:hover {
    background: #555;
}

.nav-arrow.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* Informations */
.info-panel {
    background: #2a2a2a;
    padding: 20px;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    margin-top: 20px;
}

.info-panel h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #fff;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #444;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: #999;
}

.info-value {
    color: #fff;
    font-weight: 500;
}
