@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root[data-theme="light"] {
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --bg: #f8fafc;
    --text: #0f172a;
    --text-muted: #64748b;
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: rgba(226, 232, 240, 0.8);
    --border: #e2e8f0;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: rgba(37, 99, 235, 0.1);
    --shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.08);
    --overlay-bg: rgba(255, 255, 255, 0.85);
}

:root[data-theme="dark"] {
    --bg-gradient: linear-gradient(135deg, #090d16 0%, #020617 100%);
    --bg: #090d16;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(51, 65, 85, 0.5);
    --border: #1e293b;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-light: rgba(59, 130, 246, 0.15);
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --overlay-bg: rgba(15, 23, 42, 0.85);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    padding-bottom: 80px; /* space for fixed toolbar */
    transition: background 0.3s ease, color 0.3s ease;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* Common Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* --- SPECTATOR VIEW --- */
.header-section {
    text-align: center;
    margin-bottom: 3.5rem;
    padding-top: 1rem;
}

.header-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    margin-bottom: 0.5rem;
}

.header-section .genre {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 1.2rem;
}

.header-section .bio {
    max-width: 600px;
    margin: 0 auto 1.5rem auto;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.contact-button {
    display: inline-block;
    padding: 0.6rem 1.8rem;
    background-color: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.contact-button:hover {
    background-color: var(--accent);
    color: #ffffff;
}

/* Gallery Masonry Layout */
.gallery {
    column-gap: 15px;
    width: 100%;
    column-count: 2; /* Mobile default */
}

@media screen and (min-width: 768px) {
    .gallery {
        column-count: 3;
    }
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 12px;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow);
}

.gallery-item img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* --- FIXED ADMINISTRATIVE TOOLBAR --- */
.admin-toolbar-overlay {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 600px;
    padding: 12px 24px;
    background: var(--overlay-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 50px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { transform: translate(-50%, 100px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.admin-toolbar-overlay span {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.btn-admin-edit {
    padding: 0.5rem 1.2rem;
    background-color: var(--accent);
    color: #ffffff !important;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s ease;
}

.btn-admin-edit:hover {
    background-color: var(--accent-hover);
}

.btn-admin-logout {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.btn-admin-logout:hover {
    color: #ef4444;
}

/* --- GATEWAY / FORMS SCREEN (LANDING) --- */
.auth-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 85vh;
}

.brand-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.06em;
    margin-bottom: 2rem;
    text-align: center;
}

.brand-title span {
    background: linear-gradient(90deg, var(--accent) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    padding: 2.5rem;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.auth-card h2 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

:root[data-theme="dark"] .form-control {
    background: rgba(255, 255, 255, 0.05);
}

.form-control:focus {
    border-color: var(--accent);
    background: transparent;
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 0.8rem;
    background-color: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

.alert {
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.toggle-auth {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.toggle-auth a {
    font-weight: 600;
}

/* --- DASHBOARD VIEW (p-builder.php) --- */
.dashboard-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.nav-bar h2 {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media screen and (min-width: 768px) {
    .grid-2 {
        grid-template-columns: 1.2fr 1fr;
    }
}

.dashboard-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.dashboard-card h3 {
    font-size: 1.15rem;
    margin-bottom: 1.2rem;
    font-weight: 700;
}

/* Uploader Dropzone */
.dropzone {
    border: 2px dashed var(--border);
    padding: 2.5rem 1.5rem;
    border-radius: 12px;
    text-align: center;
    background: rgba(0, 0, 0, 0.02);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1.5rem;
}

:root[data-theme="dark"] .dropzone {
    background: rgba(255, 255, 255, 0.02);
}

.dropzone.dragover {
    border-color: var(--accent);
    background-color: var(--accent-light);
}

.dropzone-icon {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
    display: block;
}

.dropzone-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Image preview lists in dashboard */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 1.5rem;
}

.preview-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.theme-toggle-container {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.theme-radio {
    display: none;
}

.theme-label {
    flex: 1;
    text-align: center;
    padding: 0.6rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.theme-radio:checked + .theme-label {
    border-color: var(--accent);
    background-color: var(--accent-light);
    color: var(--accent);
}

/* 404 View */
.error-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
}

.error-code {
    font-size: 6rem;
    font-weight: 800;
    color: var(--text-muted);
    line-height: 1;
    margin-bottom: 1.5rem;
}

/* Lightbox Spectator View Styling */
.gallery-item img {
    cursor: pointer;
}

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    cursor: zoom-out;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-overlay.active img {
    transform: scale(1);
}

