:root {
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --accent: #F59E0B;
    --bg: #F3F4F6;
    --surface: #FFFFFF;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --error: #EF4444;
}

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

body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
}

.hidden {
    display: none !important;
}

.site-container {
    max-width: 900px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hero {
    background-color: var(--primary);
    background-image: linear-gradient(135deg, var(--primary) 0%, #1E3A8A 100%);
    position: relative;
    padding: 3.5rem 1.5rem;
    text-align: center;
    color: white;
    border-bottom: 5px solid var(--accent);
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('https://offertabs.s3.amazonaws.com/offer/r7apiv/site/media/6aa9537cc21c51.51283087.jpg') center/cover no-repeat;
    opacity: 0.15;
    mix-blend-mode: overlay;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.4rem 1.25rem;
    border-radius: 999px;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.hero h1 {
    font-size: 2.25rem;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.95;
    max-width: 90%;
    margin: 0 auto;
}

.content-wrapper {
    padding: 2rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card {
    background: var(--surface);
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.01);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.text-center { text-align: center; }
.mt-4 { margin-top: 1.25rem; }
.font-bold { font-weight: 700; }

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    margin-top: 2rem;
}

.action-buttons .btn-primary, .action-buttons .btn-secondary {
    margin-top: 0;
    width: 100%;
    max-width: 300px;
    text-align: center;
}

/* File Upload styling */
.file-upload-group {
    margin-bottom: 1.75rem;
}

.hidden-file-input {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    border: 2px dashed rgba(37, 99, 235, 0.4);
    border-radius: 12px;
    background-color: rgba(37, 99, 235, 0.03);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.file-upload-label:hover, .file-upload-label.dragover {
    background-color: rgba(37, 99, 235, 0.08);
    border-color: var(--primary-hover);
}

.file-upload-label.has-file {
    border: 2px solid var(--accent);
    background-color: rgba(245, 158, 11, 0.05);
}

.upload-icon {
    color: var(--primary);
    margin-bottom: 1rem;
    transition: transform 0.2s ease;
}

.file-upload-label:hover .upload-icon {
    transform: translateY(-3px);
}

.has-file .upload-icon {
    color: var(--accent);
}

.upload-text {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.has-file .upload-text {
    color: var(--accent);
}

.file-name {
    font-size: 0.9rem;
    color: var(--text-muted);
    word-break: break-all;
    max-width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background-color: #F9FAFB;
    transition: all 0.2s;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background-color: #FFF;
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 1.1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(37, 99, 235, 0.3);
}

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

.btn-secondary {
    display: inline-block;
    padding: 0.85rem 1.5rem;
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-secondary:hover {
    background: rgba(37, 99, 235, 0.05);
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

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

.success-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.success-icon svg {
    background: rgba(34, 197, 94, 0.1);
    padding: 16px;
    border-radius: 50%;
}

#success-view h2 {
    color: #15803D;
    margin-bottom: 0.75rem;
    font-size: 1.8rem;
}

#success-view p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

#ended-view h2, #not-started-view h2 {
    color: var(--text-main);
    margin-bottom: 1rem;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.gallery-card {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}

.gallery-img-wrap {
    aspect-ratio: 1;
    overflow: hidden;
    background: #E5E7EB;
    cursor: pointer;
    position: relative;
}

.gallery-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.gallery-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.gallery-author {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: var(--text-main);
    word-break: break-word;
}

.gallery-vote-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.vote-btn-small {
    margin-top: auto;
    width: 100%;
    padding: 0.6rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.vote-btn-small:hover:not(:disabled) {
    background: #D97706;
}

.vote-btn-small:disabled {
    background: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(17, 24, 39, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.lightbox-content {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(0,0,0,0.8);
}

.lightbox-img-wrap {
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    flex: 1;
    overflow: hidden;
}

.lightbox-img-wrap img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
}

.lightbox-info {
    padding: 1.5rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.lightbox-author {
    font-weight: 800;
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.lightbox-caption {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.lightbox-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lightbox-actions .btn-primary {
    width: auto;
    padding: 0.75rem 2rem;
    margin: 0;
}

#wbx-powered-by-slot {
    margin-top: auto;
    padding-top: 1rem;
    display: flex;
    justify-content: center;
    width: 100%;
}

@media (min-width: 600px) {
    .content-wrapper { padding: 2.5rem; }
    .hero { padding: 4.5rem 2rem; border-radius: 0 0 24px 24px; }
    .card { padding: 3rem 2.5rem; }
}