/* ==========================================================================
   CSS Variables & Reset
   ========================================================================== */
:root {
    --primary: #cba135;      /* Elegant Gold */
    --primary-hover: #b58d2a;
    --bg-main: #ffffff;      /* White background */
    --card-bg: #ffffff;      /* White cards */
    --text-main: #1a1a1a;    /* Black typography */
    --text-muted: #555555;
    
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--bg-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.main-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 20px;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Typography & Hero
   ========================================================================== */
.hero {
    display: flex;
    align-items: center;
    gap: 60px;
    margin-bottom: 60px;
    text-align: left;
}

.hero-content {
    flex: 1;
    max-width: 550px;
}

.hero-image {
    flex-shrink: 0;
    width: 100%;
    max-width: 440px;
    display: flex;
    justify-content: center;
}

.magazine-cover {
    width: 100%;
    max-width: 440px;
    height: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0,0,0,0.05);
    border-radius: 4px;
}

.tagline {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 99px;
    background: rgba(203, 161, 53, 0.1);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 20px;
    border: 1px solid rgba(203, 161, 53, 0.3);
}

h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    color: #111111;
}

h2 {
    font-family: var(--font-heading);
    color: #111111;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 0 0 30px 0;
    line-height: 1.7;
}

/* Status Banner */
.status-banner {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
    margin-bottom: 40px;
    color: #991b1b;
}
.status-banner h2 {
    color: #b91c1c;
    margin-bottom: 10px;
}

/* ==========================================================================
   Navigation Tabs
   ========================================================================== */
.nav-tabs {
    display: flex;
    gap: 10px;
    background: #f3f4f6;
    padding: 6px;
    border-radius: 99px;
    max-width: 400px;
    margin: 0;
    border: 1px solid #e5e7eb;
}

.tab-btn {
    background: transparent;
    border: none;
    color: #4b5563;
    padding: 10px 24px;
    border-radius: 99px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
}

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

.tab-btn.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(203, 161, 53, 0.25);
    border: 1px solid var(--primary);
}

.tab-panel {
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Forms & Inputs
   ========================================================================== */
.glass-card {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
}

.form-row {
    display: flex;
    gap: 20px;
}
.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333333;
}

input[type="text"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-sm);
    color: #111111;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(203, 161, 53, 0.15);
}

/* File Upload Zone */
.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    border: 2px dashed rgba(203, 161, 53, 0.4);
    border-radius: var(--radius-md);
    background: #fdfdfd;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.file-label:hover, .file-label.dragover {
    border-color: var(--primary);
    background: rgba(203, 161, 53, 0.03);
}

.file-label svg {
    color: var(--primary);
    margin-bottom: 12px;
}

.file-label span {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 4px;
    color: #111111;
}

.file-label small {
    color: var(--text-muted);
}

#image-preview-container {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #f3f4f6;
}

#image-preview {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    display: block;
}

#remove-image {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.9);
    color: #111;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
#remove-image:hover { background: #ef4444; color: #ffffff; }

/* Buttons */
button {
    font-family: var(--font-body);
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, #e6c55c 100%);
    color: #111111;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #e6c55c 0%, var(--primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(203, 161, 53, 0.2);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-outline {
    padding: 12px 24px;
    background: transparent;
    color: var(--text-main);
    border: 1px solid #d1d5db;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-outline:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-secondary {
    padding: 10px 20px;
    background: rgba(203, 161, 53, 0.1);
    color: #a17d23;
    border: 1px solid rgba(203, 161, 53, 0.3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}
.btn-secondary:hover { background: rgba(203, 161, 53, 0.2); }

.error-message {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

/* ==========================================================================
   Post-Entry / Success State
   ========================================================================== */
.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(203, 161, 53, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    border: 1px solid rgba(203, 161, 53, 0.3);
}

#success-state h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--primary);
}

.share-panel {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    padding: 30px;
    margin: 30px 0;
}
.share-panel h3 { margin-bottom: 10px; color: var(--primary); }
.share-input-group {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}
.share-input-group input { flex: 1; }
.social-share {
    display: flex;
    gap: 15px;
    justify-content: center;
}
.btn-social {
    padding: 10px 20px;
    border-radius: 99px;
    text-decoration: none;
    font-weight: 500;
    color: #fff;
    font-size: 0.9rem;
    transition: var(--transition);
}
#share-fb { background: #1877F2; }
#share-x { background: #000; border: 1px solid #333; }
.btn-social:hover { transform: translateY(-2px); opacity: 0.9; }

/* ==========================================================================
   Gallery Styling
   ========================================================================== */
.gallery-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.gallery-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: #111111;
}

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

.gallery-card {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: var(--transition);
}
.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    border-color: rgba(203, 161, 53, 0.5);
}

.card-img-container {
    width: 100%;
    height: 320px; /* Slightly taller for pageant portrait shots */
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: #f8f8f8;
}
.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.5s ease;
}
.gallery-card:hover .card-img-container img {
    transform: scale(1.05);
}
.zoom-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}
.gallery-card:hover .zoom-overlay { opacity: 1; }
.zoom-overlay svg { color: #ffffff; }

.card-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #ffffff;
}
.card-author {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #111111;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
}
.card-caption {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #eaeaea;
    padding-top: 12px;
    width: 100%;
}

.btn-vote {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 6px 16px;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-vote:hover:not(:disabled) {
    background: var(--primary);
    color: #ffffff;
}
.btn-vote:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    border-color: #e5e7eb;
    cursor: default;
}
.vote-count {
    font-size: 0.9rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.gallery-footer {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */
.lightbox {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
}

.lightbox-content {
    position: relative;
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.close-btn {
    position: absolute;
    top: 15px; right: 15px;
    background: rgba(255,255,255,0.9);
    color: #111;
    border: none;
    border-radius: 50%;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.close-btn:hover { background: #ffffff; transform: rotate(90deg); }

.lightbox-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: #0a0a0a;
    position: relative;
}
.lightbox-image-container img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.lightbox-info {
    padding: 24px;
    background: #ffffff;
    text-align: center;
}

.lightbox-info .author {
    display: block;
    color: #111111;
    font-weight: 800;
    font-size: 1.8rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.lightbox-info .caption {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.lightbox-meta {
    display: flex;
    justify-content: center;
    align-items: center;
}

.vote-action {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* ==========================================================================
   Utilities & Animations
   ========================================================================== */
.loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(203, 161, 53, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}
.btn-primary .loader {
    width: 20px; height: 20px; border-width: 2px;
    border-color: rgba(0,0,0,0.1);
    border-top-color: #111;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#wbx-powered-by-slot {
    margin-top: auto;
    padding-top: 40px;
}

/* Responsive */
@media (max-width: 900px) {
    .hero {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }
    .hero-content {
        max-width: 100%;
    }
    .hero p {
        margin: 0 auto 30px auto;
    }
    .hero-image {
        max-width: 100%;
    }
    .nav-tabs {
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    .hero p { font-size: 1rem; }
    .form-row { flex-direction: column; gap: 0; }
    .glass-card { padding: 24px; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .main-container { padding-top: 20px; }
    .card-img-container { height: 280px; }
}
