/* Gabeesfotografie — Warm fotografisch thema */
:root {
    --primary: #8B7355;
    --primary-dark: #6B5740;
    --primary-light: #A89279;
    --accent: #C4956A;
    --bg: #FAF8F5;
    --bg-card: #FFFFFF;
    --bg-dark: #2C2420;
    --text: #3A3330;
    --text-light: #7A7068;
    --text-muted: #B0A89E;
    --border: #E8E2DA;
    --success: #5B8C5A;
    --warning: #D4A843;
    --danger: #C25550;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

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

/* ── Navbar ── */
.navbar {
    background: var(--bg-dark);
    color: #fff;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar .logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}
.navbar .logo span { color: var(--accent); }
.navbar nav { display: flex; gap: 1.5rem; }
.navbar nav a { color: #ddd; font-size: 0.95rem; }
.navbar nav a:hover { color: #fff; }

/* ── Admin Sidebar ── */
.admin-layout { display: flex; min-height: calc(100vh - 64px); }
.sidebar {
    width: 240px;
    background: var(--bg-dark);
    padding: 1.5rem 0;
    flex-shrink: 0;
}
.sidebar a {
    display: block;
    padding: 0.6rem 1.5rem;
    color: #ccc;
    font-size: 0.9rem;
}
.sidebar a:hover, .sidebar a.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.admin-content {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: 0.9; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.85rem; }

/* ── Forms ── */
input, select, textarea {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    width: 100%;
    background: #fff;
    color: var(--text);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(139,115,85,0.15);
}
label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
    font-size: 0.9rem;
}
.form-group { margin-bottom: 1rem; }

/* ── Flash messages ── */
.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.flash-success { background: #EDF7ED; color: var(--success); border: 1px solid #C3E6C3; }
.flash-error { background: #FDF0EF; color: var(--danger); border: 1px solid #F0C4C2; }
.flash-info { background: #F0EDE8; color: var(--primary-dark); border: 1px solid var(--border); }

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    text-align: center;
}
.stat-card .number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}
.stat-card .label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.2rem;
}

/* ── Photo Grid ── */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.photo-card {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}
.photo-card:hover { transform: translateY(-3px); }
.photo-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}
.photo-card .info {
    padding: 0.8rem 1rem;
}
.photo-card .info h3 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.photo-card .info .meta {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ── Upload Zone ── */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg);
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: #F5F0EB;
}
.upload-zone p { color: var(--text-light); margin-top: 0.5rem; }
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}
.preview-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
}
.preview-item img { width: 100%; height: 100px; object-fit: cover; }
.preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    line-height: 24px;
    text-align: center;
}

/* ── Loading Overlay ── */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.9);
    z-index: 999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.loading-overlay.active { display: flex; }
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Table ── */
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    text-align: left;
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
th {
    background: #F5F0EB;
    font-weight: 600;
    color: var(--text);
}
tr:hover { background: #FDFCFA; }

/* ── Hero (public) ── */
.hero {
    background: var(--bg-dark);
    color: #fff;
    text-align: center;
    padding: 4rem 2rem;
}
.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.hero p { color: #ccc; font-size: 1.1rem; }

/* ── Photo Detail ── */
.photo-detail {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}
.photo-detail img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.photo-detail .sidebar-info { padding-top: 0.5rem; }
.exif-list { list-style: none; }
.exif-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.exif-list li strong { display: inline-block; width: 120px; color: var(--text-light); }

/* ── Price List ── */
.price-list { list-style: none; }
.price-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}
.price-list .price {
    font-weight: 600;
    color: var(--primary);
}

/* ── School Portal ── */
.school-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}
.code-input-group {
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
    margin: 1rem auto;
}
.code-input-group input {
    font-size: 1.2rem;
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.school-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.school-photo-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
}
.school-photo-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.school-photo-card .actions {
    padding: 0.6rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ── Cart ── */
.cart-items { list-style: none; }
.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
}
.cart-item img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}
.cart-item .details { flex: 1; }
.cart-item .price { font-weight: 600; color: var(--primary); }
.cart-total {
    text-align: right;
    font-size: 1.3rem;
    font-weight: 700;
    padding: 1rem 0;
    color: var(--primary-dark);
}

/* ── Footer ── */
.footer {
    background: var(--bg-dark);
    color: #aaa;
    text-align: center;
    padding: 2rem;
    font-size: 0.85rem;
    margin-top: 3rem;
}

/* ── Pagination ── */
.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2rem;
}
.pagination a, .pagination span {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}
.pagination span.current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ── Badge ── */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-success { background: #EDF7ED; color: var(--success); }
.badge-warning { background: #FFF8E6; color: var(--warning); }
.badge-danger { background: #FDF0EF; color: var(--danger); }
.badge-info { background: #F0EDE8; color: var(--primary); }

/* ── Print Codes ── */
.print-codes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.code-card {
    border: 2px solid #333;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    page-break-inside: avoid;
}
.code-card img { width: 120px; height: 120px; }
.code-card .code {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-top: 0.5rem;
}
.code-card .child-name {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.3rem;
}

@media print {
    .navbar, .sidebar, .no-print { display: none !important; }
    .admin-content { padding: 0; max-width: 100%; }
    .print-codes { grid-template-columns: repeat(3, 1fr); }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .photo-detail { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.8rem; }
    .sidebar { display: none; }
    .admin-content { padding: 1rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .school-photo-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
