@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');
/* ===========================================
   Galerie Jamot Photography - Client Side
   Design minimaliste, focus sur les images
   =========================================== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0d1220;
    --bg-card: #141b2d;
    --bg-elevated: #1c2540;
    --text: #f5f0eb;
    --text-muted: #9b9590;
    --accent: #ffaa1f;
    --accent-hover: #ffc04d;
    --danger: #d44;
    --success: #4a9;
    --radius: 4px;
    --font: 'Montserrat', sans-serif;
    --font-display: 'Montserrat', sans-serif;
    --transition: 0.2s ease;
}

html { font-size: 16px; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

img { display: block; max-width: 100%; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    font-family: var(--font);
}

.btn-primary {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #000; }

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: #2a3356;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-small { padding: 6px 12px; font-size: 0.75rem; }

.btn-full { width: 100%; justify-content: center; }

/* --- Home Page --- */
.home-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.home-logo h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.tagline {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.75rem;
    margin-bottom: 40px;
}

.home-content p {
    text-align: center;
    margin: 0 auto;
    color: var(--text-muted);
    max-width: 500px;
    font-size: 0.9rem;
}

/* --- Login Page --- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: var(--bg-card);
    padding: 50px 40px;
    border-radius: 8px;
    max-width: 420px;
    width: 100%;
    text-align: center;
}

.login-card h1 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.login-card h2 {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.client-name {
    color: var(--accent);
    font-size: 0.85rem;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid #2a3356;
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
    font-family: var(--font);
    transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.alert-error { background: rgba(221,68,68,0.15); color: #f88; border: 1px solid rgba(221,68,68,0.3); }
.alert-success { background: rgba(68,170,153,0.15); color: #6dc; border: 1px solid rgba(68,170,153,0.3); }

/* --- Gallery Header --- */
.gallery-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13,18,32,0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid #1c2540;
    padding: 16px 24px;
}

.gallery-header-inner {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.gallery-info h1 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 400;
    letter-spacing: 0.08em;
}

.gallery-description {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 2px;
}

.photo-count {
    color: var(--accent);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 2px;
}

.gallery-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: var(--bg-elevated);
    border: 1px solid #2a3356;
    border-radius: var(--radius);
    min-width: 200px;
    z-index: 200;
    overflow: hidden;
}
.dropdown-menu.show { display: block; }
.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    font-size: 0.85rem;
    color: var(--text);
    transition: background var(--transition);
}
.dropdown-menu a:hover { background: rgba(255,255,255,0.05); color: var(--accent); }

/* --- Selection bar --- */
.selection-bar {
    position: sticky;
    top: 70px;
    z-index: 99;
    background: var(--accent);
    color: #000;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 500;
}

.selection-bar-actions { display: flex; gap: 8px; }
.selection-bar .btn { color: #000; border-color: rgba(0,0,0,0.2); }
.selection-bar .btn:hover { background: rgba(0,0,0,0.1); }

/* --- Gallery Grid --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 4px;
    padding: 4px;
    max-width: 1600px;
    margin: 0 auto;
}

@media (min-width: 1200px) {
    .gallery-grid { grid-template-columns: repeat(4, 1fr); }
}

.photo-item {
    position: relative;
    aspect-ratio: 3/2;
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-card);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.3s ease;
}

.photo-item:hover img {
    transform: scale(1.03);
}

/* Selection mode */
.selection-mode .photo-item { cursor: pointer; }
.selection-mode .photo-item::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    width: 24px;
    height: 24px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: rgba(0,0,0,0.3);
    transition: all var(--transition);
}
.selection-mode .photo-item.selected::after {
    background: var(--accent);
    border-color: var(--accent);
}

/* Fav button */
.fav-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-item:hover .fav-btn { opacity: 1; }
.photo-item.selected .fav-btn { opacity: 1; }
.photo-item.selected .fav-btn .heart { color: var(--accent); }

/* File placeholders (RAW, Video) */
.file-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    gap: 6px;
    padding: 16px;
    text-align: center;
}

.file-icon {
    font-size: 2.5rem;
    opacity: 0.6;
}

.file-ext {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--accent);
    background: rgba(255,170,31,0.15);
    padding: 3px 10px;
    border-radius: 3px;
}

.file-name {
    font-size: 0.7rem;
    color: var(--text-muted);
    word-break: break-all;
    max-width: 90%;
}

.file-size {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* --- Lightbox --- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.96);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox.active { display: flex; }

.lightbox-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 60px 80px;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lightbox-content video.lightbox-video {
    max-width: 100%;
    max-height: 100%;
}

.lightbox-file-info {
    text-align: center;
    color: var(--text-muted);
}
.file-icon-large { font-size: 5rem; display: block; margin-bottom: 16px; }
.file-ext-large { font-size: 1.5rem; color: var(--accent); font-weight: 700; margin-bottom: 8px; }
.lightbox-file-info .btn { margin-top: 20px; }

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
    opacity: 0.7;
    transition: opacity var(--transition);
}
.lightbox-close:hover { opacity: 1; }

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    z-index: 1001;
    padding: 20px;
    opacity: 0.5;
    transition: opacity var(--transition);
}
.lightbox-prev:hover,
.lightbox-next:hover { opacity: 1; }
.lightbox-prev { left: 0; }
.lightbox-next { right: 0; }

.lightbox-footer {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 24px;
    background: rgba(0,0,0,0.5);
    width: 100%;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.lightbox-fav { margin-left: auto; }
.lightbox-fav.active .heart { color: var(--accent); }

/* --- Modal --- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 8px;
    max-width: 480px;
    width: 90%;
}

.modal-content h3 {
    font-family: var(--font-display);
    font-weight: 400;
    margin-bottom: 12px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* --- Error Page --- */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.error-container h1 {
    font-family: var(--font-display);
    font-size: 6rem;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1;
    margin-bottom: 16px;
}

.error-container p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .gallery-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2px;
        padding: 2px;
    }
    .lightbox-content { padding: 50px 10px; }
    .lightbox-prev, .lightbox-next { font-size: 2rem; padding: 10px; }
    .gallery-actions { width: 100%; }
}

@media (max-width: 480px) {
    .gallery-grid { grid-template-columns: repeat(1, 1fr); }
    .login-card { padding: 30px 24px; }
}
