/* ===== VARIABLES ===== */
:root {
    --color-primary: #7c3aed;
    --color-primary-light: #a78bfa;
    --color-primary-dark: #5b21b6;
    --color-accent: #f472b6;
    --color-accent-dark: #ec4899;
    --color-bg: #faf5ff;
    --color-surface: #ffffff;
    --color-text: #1e1b4b;
    --color-text-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
    --shadow-lg: 0 4px 20px rgba(124,58,237,.12);
    --transition: .2s ease;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}
a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dark); }
img { max-width: 100%; height: auto; display: block; }

/* ===== CONTAINER ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

/* ===== NAVBAR ===== */
.navbar {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky; top: 0; z-index: 100;
    backdrop-filter: blur(8px);
}
.navbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px; gap: 1rem;
}
.logo { font-weight: 700; font-size: 1.15rem; color: var(--color-primary); white-space: nowrap; }
.nav-links { display: flex; gap: .5rem; }
.nav-link {
    padding: .45rem .9rem; border-radius: var(--radius-sm);
    font-size: .875rem; font-weight: 500; color: var(--color-text-muted);
    transition: var(--transition);
}
.nav-link:hover { background: var(--color-bg); color: var(--color-primary); }
.nav-admin { color: var(--color-accent); }
.nav-user { display: flex; align-items: center; gap: .75rem; }
.user-name { font-size: .875rem; font-weight: 500; color: var(--color-text-muted); }

/* ===== MAIN ===== */
.main-content { padding: 2rem 1rem 4rem; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .65rem 1.3rem; border-radius: var(--radius-sm);
    font-family: inherit; font-size: .875rem; font-weight: 600;
    border: none; cursor: pointer; transition: var(--transition);
    text-decoration: none; line-height: 1.4;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-accent { background: var(--color-accent); color: #fff; }
.btn-accent:hover { background: var(--color-accent-dark); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--color-border); color: var(--color-text-muted); }
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-danger { background: var(--color-error); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-success { background: var(--color-success); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }
.btn-sm { padding: .4rem .8rem; font-size: .8rem; }
.btn-block { width: 100%; }
.btn-like { background: none; border: none; cursor: pointer; font-size: 1.1rem; padding: .3rem; transition: var(--transition); }
.btn-like:hover { transform: scale(1.2); }
.btn-like.liked { color: var(--color-accent); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .4rem; color: var(--color-text); }
.form-input {
    width: 100%; padding: .7rem 1rem; border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm); font-family: inherit; font-size: .95rem;
    transition: var(--transition); background: var(--color-surface);
}
.form-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(124,58,237,.1); }
.form-input[type="file"] { padding: .5rem; }

/* ===== CARDS ===== */
.card {
    background: var(--color-surface); border-radius: var(--radius);
    border: 1px solid var(--color-border); overflow: hidden;
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-body { padding: 1.25rem; }
.card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: .3rem; }
.card-meta { font-size: .8rem; color: var(--color-text-muted); }
.card-footer { padding: .75rem 1.25rem; border-top: 1px solid var(--color-border); display: flex; justify-content: space-between; align-items: center; }

/* ===== AUTH PAGES ===== */
.auth-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 1rem;
    background: linear-gradient(135deg, #ede9fe 0%, #fce7f3 50%, #fff7ed 100%);
}
.auth-card {
    width: 100%; max-width: 420px;
    background: var(--color-surface); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 2.5rem 2rem;
}
.auth-title { text-align: center; font-size: 1.5rem; font-weight: 700; margin-bottom: .3rem; }
.auth-subtitle { text-align: center; color: var(--color-text-muted); font-size: .9rem; margin-bottom: 2rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: .875rem; color: var(--color-text-muted); }

/* ===== ALERTS ===== */
.alert {
    padding: .85rem 1.2rem; border-radius: var(--radius-sm);
    margin-bottom: 1.5rem; font-size: .9rem; font-weight: 500;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ===== PAGE HEADERS ===== */
.page-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem;
}
.page-title { font-size: 1.75rem; font-weight: 700; }
.page-subtitle { color: var(--color-text-muted); font-size: .95rem; margin-top: .25rem; }

/* ===== ALBUM GRID ===== */
.album-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}
.album-card a { color: inherit; text-decoration: none; }
.album-card .card-icon { font-size: 2rem; margin-bottom: .5rem; }
.album-empty {
    grid-column: 1 / -1; text-align: center; padding: 4rem 1rem;
    border: 2px dashed var(--color-border); border-radius: var(--radius);
    color: var(--color-text-muted);
}

.photo-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .5rem;
}
.photo-card {
    break-inside: avoid; border-radius: var(--radius); overflow: hidden;
    background: var(--color-surface); border: 1px solid var(--color-border);
    transition: var(--transition); position: relative;
}
.photo-card:hover { box-shadow: var(--shadow-lg); }
.photo-card img, .photo-card video { width: 100%; height: 110px; object-fit: cover; display: block; cursor: pointer; }
.photo-card-info {
    padding: .4rem .6rem; display: flex; justify-content: space-between; align-items: center; font-size: .75rem;
}
.photo-card-actions { display: flex; align-items: center; gap: .4rem; }

/* ===== PHOTO DETAIL ===== */
.photo-detail { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.photo-detail-img { border-radius: var(--radius); overflow: hidden; background: #000; }
.photo-detail-img img { width: 100%; max-height: 70vh; object-fit: contain; margin: 0 auto; }
.photo-sidebar { min-width: 0; }
.comment-list { list-style: none; margin: 1rem 0; }
.comment-item {
    padding: .75rem 0; border-bottom: 1px solid var(--color-border);
}
.comment-author { font-weight: 600; font-size: .875rem; }
.comment-date { font-size: .75rem; color: var(--color-text-muted); }
.comment-text { font-size: .9rem; margin-top: .25rem; }
.comment-form { display: flex; gap: .5rem; margin-top: 1rem; }
.comment-form .form-input { flex: 1; }

/* ===== ADMIN TABLE ===== */
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th, .admin-table td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--color-border); }
.admin-table th { background: var(--color-bg); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; color: var(--color-text-muted); }
.admin-table tr:hover { background: #faf5ff; }
.badge {
    display: inline-block; padding: .2rem .6rem; border-radius: 999px;
    font-size: .75rem; font-weight: 600;
}
.badge-approved { background: #ecfdf5; color: #065f46; }
.badge-pending { background: #fff7ed; color: #9a3412; }
.badge-admin { background: #f3e8ff; color: #6d28d9; }

/* ===== WAITING PAGE ===== */
.waiting-page {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 100vh; padding: 2rem; text-align: center;
    background: linear-gradient(135deg, #ede9fe 0%, #fce7f3 50%, #fff7ed 100%);
}
.waiting-page h1 { font-size: 2rem; margin-bottom: .5rem; }
.waiting-page p { max-width: 420px; color: var(--color-text-muted); font-size: 1rem; margin-bottom: 2rem; line-height: 1.7; }

/* ===== FOOTER ===== */
.footer {
    text-align: center; padding: 2rem 1rem;
    color: var(--color-text-muted); font-size: .85rem;
    border-top: 1px solid var(--color-border); margin-top: 2rem;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .photo-card img, .photo-card video { height: 160px; }
    .photo-detail { grid-template-columns: 2fr 1fr; }
}
@media (max-width: 640px) {
    .navbar-inner { flex-wrap: wrap; height: auto; padding: .75rem 1rem; }
    .nav-links { order: 3; width: 100%; justify-content: center; }
    .photo-grid { grid-template-columns: repeat(3, 1fr); gap: .3rem; }
    .photo-card img, .photo-card video { height: 75px; }
    .photo-card-info { padding: .2rem .4rem; font-size: .65rem; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .album-grid { grid-template-columns: 1fr; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}
