/* ==========================================================================
   CSS Variables & Reset
   ========================================================================== */
   :root {
    /* Shrek Green */
    --shrek-green: #89a838;
    --shrek-green-bright: #a2c642;
    --shrek-green-dark: #647d27;
    
    /* Swampy Purple & Red Carpet additions */
    --carpet-red: #bd1e24;
    --carpet-red-light: #e62028;
    --carpet-red-dark: #7a1116;
    
    --swamp-purple-dark: #1b0c26;
    --swamp-purple: #3d1c54;
    --swamp-purple-light: #6a328f;
    --swamp-purple-glow: #b666ed;
    
    --sign-yellow: #e6c551;
    
    --bg-color: var(--swamp-purple-dark);
    --text-main: #f4ecfa;
    --text-muted: #c9b3d9;
    
    --card-bg: rgba(61, 28, 84, 0.5);
    --card-text: #f4ecfa;
    --card-muted: #a68bb8;
    
    --font-heading: 'Fredoka One', cursive;
    --font-body: 'Montserrat', sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 999px;
    
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6);
    --shadow-hover: 0 16px 40px rgba(182, 102, 237, 0.3);
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--bg-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(182, 102, 237, 0.15), transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(189, 30, 36, 0.15), transparent 40%);
    background-attachment: fixed;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: normal; 
    line-height: 1.2;
    margin-bottom: 0.5em;
    color: var(--text-main);
}

.hidden {
    display: none !important;
}

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

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    position: relative;
    padding: 100px 20px 140px;
    text-align: center;
    background-image: url('https://offertabs.s3.amazonaws.com/offer/oev65g/site/media/6aaac1191306a1.19705716.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(27, 12, 38, 0.5) 0%, rgba(27, 12, 38, 0.95) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 850px;
    margin: 0 auto;
}

.badge {
    display: inline-block;
    background: var(--carpet-red);
    color: white;
    border: 3px solid var(--carpet-red-dark);
    padding: 8px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    color: white;
    text-shadow: 0 4px 12px rgba(0,0,0,0.9);
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.text-purple-glow {
    color: var(--swamp-purple-glow);
    text-shadow: 0 4px 12px rgba(0,0,0,0.9), 0 0 15px rgba(182, 102, 237, 0.6);
}

.text-sign-yellow {
    color: var(--sign-yellow);
    text-shadow: 0 4px 12px rgba(0,0,0,0.9), 0 0 10px rgba(230, 197, 81, 0.3);
}

.text-green {
    color: var(--shrek-green-bright);
    text-shadow: 0 4px 12px rgba(0,0,0,0.9), 0 0 10px rgba(137, 168, 56, 0.4);
}

.hero p {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    font-weight: 600;
    max-width: 720px;
    margin: 0 auto;
    text-shadow: 0 2px 6px rgba(0,0,0,0.9);
    color: #e8e4e1;
}

.hero-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    z-index: 2;
}

.hero-divider svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 60px;
}

.hero-divider .shape-fill {
    fill: var(--bg-color);
}

/* ==========================================================================
   Gallery Section
   ========================================================================== */
.gallery-section {
    padding: 60px 0 80px;
}

.gallery-header {
    text-align: center;
    margin-bottom: 50px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-header h2 {
    font-size: 2.8rem;
    color: var(--swamp-purple-glow);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.gallery-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

/* Cards */
.card {
    background: var(--card-bg);
    color: var(--card-text);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 3px solid var(--carpet-red-dark);
    display: flex;
    flex-direction: column;
    height: 100%;
    backdrop-filter: blur(10px);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--swamp-purple-glow);
}

.card-image-wrapper {
    position: relative;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    overflow: hidden;
    background: #2a133a;
    cursor: pointer;
}

.card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-img {
    transform: scale(1.05);
}

.zoom-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(255, 255, 255, 0.95);
    border: 3px solid var(--swamp-purple-glow);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--swamp-purple-dark);
    opacity: 0;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.card-image-wrapper:hover .zoom-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 1.15rem;
    margin-bottom: 5px;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.card-author {
    color: var(--card-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

.card-author::before {
    content: 'By ';
    font-style: italic;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 15px;
    border-top: 2px dashed rgba(189, 30, 36, 0.5); /* carpet red */
}

.card-votes {
    font-weight: 800;
    color: var(--shrek-green-bright);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.1rem;
}

.card-votes::before {
    content: '★';
    font-size: 1.3rem;
    color: var(--sign-yellow);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    font-family: var(--font-heading);
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
    position: relative;
    top: 0;
}

.btn:active:not(:disabled) {
    top: 4px;
    box-shadow: 0 0 0 transparent !important;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--swamp-purple-light), var(--swamp-purple));
    color: white;
    border-color: rgba(0,0,0,0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--swamp-purple-glow), var(--swamp-purple-light));
    border-color: rgba(255,255,255,0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--carpet-red), var(--carpet-red-dark));
    color: white;
    border-color: rgba(0,0,0,0.4);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--carpet-red-light), var(--carpet-red));
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.2rem;
    width: 100%;
}

.vote-btn.voted {
    background: rgba(201, 179, 217, 0.2);
    color: var(--text-muted);
    box-shadow: none;
    border-color: transparent;
    text-shadow: none;
}

.vote-btn.voted::before {
    content: '✓ ';
}

.pagination-container {
    text-align: center;
    margin-top: 30px;
}

/* ==========================================================================
   UI States & Modals
   ========================================================================== */
.loader-container {
    text-align: center;
    padding: 60px 20px;
    color: var(--swamp-purple-glow);
    font-weight: 700;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(182, 102, 237, 0.2);
    border-top-color: var(--swamp-purple-glow);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

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

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: rgba(61, 28, 84, 0.4);
    backdrop-filter: blur(10px);
    border: 2px dashed var(--carpet-red);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.empty-state h3 {
    color: var(--swamp-purple-glow);
}

.status-banner {
    background: linear-gradient(135deg, var(--swamp-purple), var(--swamp-purple-dark));
    border: 2px solid var(--swamp-purple-glow);
    color: white;
    text-align: center;
    padding: 15px;
    border-radius: var(--radius-md);
    margin: 20px 0;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* Lightbox Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(27, 12, 38, 0.95);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--swamp-purple);
    border: 3px solid var(--carpet-red);
    border-radius: var(--radius-lg);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal:not(.hidden) .modal-content {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: 2px solid rgba(255,255,255,0.2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--carpet-red);
    border-color: var(--carpet-red-light);
    color: white;
    transform: scale(1.1);
}

.modal-image-container {
    background: #0d0612;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50vh;
    min-height: 300px;
}

#lightbox-img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.modal-info {
    padding: 30px;
    background: var(--swamp-purple);
    color: white;
}

.modal-info h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    word-break: break-word;
    color: var(--swamp-purple-glow);
}

.modal-info .author {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 25px;
}

.lightbox-action {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.vote-count {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--shrek-green-bright);
    display: flex;
    align-items: center;
    gap: 8px;
}

.vote-count::before {
    content: '★';
    color: var(--sign-yellow);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--swamp-purple-light);
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 2px solid var(--carpet-red);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast:not(.hidden) {
    transform: translateX(-50%) translateY(0);
}

.toast-close {
    background: none;
    border: none;
    color: white;
    opacity: 0.7;
    cursor: pointer;
    font-size: 1.2rem;
}

.toast-close:hover {
    opacity: 1;
    color: var(--swamp-purple-glow);
}

/* Powered By */
#wbx-powered-by-slot {
    margin-top: 60px;
    padding-bottom: 20px;
}

/* Responsive */
@media (min-width: 768px) {
    .modal-content {
        flex-direction: row;
        max-height: 80vh;
    }
    
    .modal-image-container {
        flex: 1;
        height: auto;
        min-height: 400px;
        border-right: 2px solid var(--swamp-purple-dark);
    }
    
    .modal-info {
        width: 380px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .lightbox-action {
        flex-direction: column;
        align-items: stretch;
    }
    
    .vote-count {
        text-align: center;
        justify-content: center;
    }
}