:root {
    --primary: #1a73e8;
    --primary-hover: #1557b0;
    --bg-dark: #ffffff;
    --bg-card: #ffffff;
    --text-main: #202124;
    --text-muted: #5f6368;
    --danger: #d93025;
    --danger-hover: #b31412;
    --success: #1e8e3e;
    --glass-border: #dadce0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', 'Outfit', sans-serif;
}

body {
    background: #f8f9fa;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3 { font-weight: 400; color: #202124; }
h1 span { color: var(--primary); font-weight: 500; }

/* Flat Classes */
.glass-header, .glass-footer, .glass-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 0; /* Pas de coins arrondis */
    box-shadow: none;
}

/* Header */
.glass-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    margin-top: 0;
    border-bottom: 1px solid var(--glass-border);
    border-top: none; border-left: none; border-right: none;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.2s;
}

.nav-link:hover { color: var(--primary); }

.user-greeting {
    color: var(--text-muted);
    font-size: 14px;
    margin-right: 10px;
}

/* Content */
.content-wrapper {
    flex: 1;
    padding: 40px 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 0; /* Sans coins arrondis */
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.2s, box-shadow 0.2s;
    font-size: 14px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 1px 3px rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--glass-border);
}
.btn-secondary:hover {
    background: #f8f9fa;
}

.btn-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}
.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-block {
    width: 100%;
}
.btn-sm {
    padding: 6px 16px;
    font-size: 13px;
}

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

.login-card {
    width: 100%;
    max-width: 450px;
    padding: 40px;
    text-align: center;
    border: 1px solid var(--glass-border);
}

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

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-main);
    font-weight: 500;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 13px 15px;
    background: #fff;
    border: 1px solid var(--glass-border);
    border-radius: 0; /* Google style form inputs can be rounded, but requested sans coin arrondi */
    color: var(--text-main);
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border: 2px solid var(--primary);
    padding: 12px 14px; /* compensate for border */
}

/* Dashboard & Admin */
.dashboard-header {
    margin-bottom: 30px;
}
.dashboard-header p {
    color: var(--text-muted);
    margin-top: 5px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.gallery-item {
    border: 1px solid var(--glass-border);
    background: #fff;
    display: flex;
    flex-direction: column;
}

.image-wrapper {
    height: 200px;
    overflow: hidden;
    position: relative;
    background: #f1f3f4;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.image-info h3 {
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.image-info .date {
    font-size: 12px;
    color: var(--text-muted);
}

.empty-state {
    padding: 60px 20px;
    text-align: center;
    border: 1px solid var(--glass-border);
    background: #fff;
}
.icon-placeholder {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--glass-border);
}

/* Admin Specific */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .admin-grid { grid-template-columns: 1fr; }
    .glass-header { flex-direction: column; gap: 16px; }
}

.admin-card {
    padding: 24px;
    border: 1px solid var(--glass-border);
    background: #fff;
}
.admin-card h3 {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--glass-border);
    font-size: 18px;
}

.user-list {
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--glass-border);
    padding: 8px;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    cursor: pointer;
    font-size: 14px;
}
.checkbox-label:hover {
    background: #f1f3f4;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
}
.alert-error {
    background: #fce8e6;
    color: #c5221f;
    border: 1px solid #c5221f;
}
.alert-success {
    background: #e6f4ea;
    color: #137333;
    border: 1px solid #137333;
}

/* Footer */
.glass-footer {
    text-align: center;
    padding: 24px;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 12px;
    background: #fff;
}
.forgot-password-link {
    display: block;
    margin-top: 15px;
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
}
.forgot-password-link:hover {
    text-decoration: underline;
}

/* Hamburger Menu & Responsive Nav */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--primary);
    cursor: pointer;
    padding: 10px;
}
@media (max-width: 900px) {
    .hamburger-btn { display: block; }
    .main-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        padding: 20px;
        border-bottom: 1px solid var(--glass-border);
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        z-index: 1000;
        gap: 15px;
    }
    .main-nav.active { display: flex; }
    .user-greeting { display: block; margin-bottom: 10px; font-weight: bold; }
    .glass-header { position: relative; }
}

/* Lightbox Styles */
.lightbox-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    flex-direction: row;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.lightbox-overlay.active { display: flex; opacity: 1; }
.lightbox-close {
    position: absolute;
    top: 20px; right: 20px;
    background: none; border: none;
    color: white; font-size: 30px;
    cursor: pointer; z-index: 10000;
}
.lightbox-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.lightbox-image-container img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}
.lightbox-sidebar {
    width: 320px;
    background: white;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.lightbox-title { font-size: 1.5rem; margin: 0 0 15px 0; color: var(--text-color); }
.lightbox-meta { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 30px; line-height: 1.6; }
.lightbox-meta i { width: 20px; text-align: center; margin-right: 5px; color: var(--primary); }
.lightbox-actions { display: flex; flex-direction: column; gap: 10px; }
.lightbox-btn {
    padding: 12px; border: none; border-radius: 4px; font-size: 1rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
    text-decoration: none; font-weight: 500;
}
.lightbox-btn-primary { background: var(--primary); color: white; }
.lightbox-btn-primary:hover { background: #1557b0; }
.lightbox-btn-secondary { background: #f1f3f4; color: var(--text-color); }
.lightbox-btn-secondary:hover { background: #e8eaed; }

@media (max-width: 768px) {
    .lightbox-overlay { flex-direction: column; }
    .lightbox-sidebar { width: 100%; height: auto; max-height: 40vh; padding: 20px; }
    .lightbox-image-container { height: 60vh; padding: 10px; }
}

/* Make gallery items clickable pointers */
.gallery-item .image-wrapper { cursor: pointer; }
