:root {
    --primary: #f9a03f; /* Cheerful Orange */
    --primary-hover: #e08b30;
    --secondary: #118AB2; /* Trusty Blue */
    --secondary-hover: #0e7496;
    --accent: #06D6A0; /* Fresh Green */
    --background: #f4f7f6;
    --surface: #ffffff;
    --text-main: #2b2d42;
    --text-muted: #6c757d;
    --border: #e9ecef;
    --error: #ef476f;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.12);
    --font-heading: 'Baloo 2', cursive, sans-serif;
    --font-body: 'Nunito', sans-serif;
    --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);
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.hidden {
    display: none !important;
}

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

/* Layout */
.container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: var(--surface);
    padding: 15px 0;
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 10;
}

.brand {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 80px 0;
    text-align: center;
    overflow: hidden;
    min-height: 400px;
    display: flex;
    align-items: center;
}

.hero-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to right, rgba(17, 138, 178, 0.85), rgba(17, 138, 178, 0.6));
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 700px;
}

.badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 6px 16px;
    border-radius: 99px;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(249, 160, 63, 0.4);
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: #fff;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.text-highlight {
    color: var(--primary);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 30px;
}

/* Countdown */
.countdown-wrapper {
    margin-top: 30px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 20px;
    border-radius: var(--radius-md);
    display: inline-block;
}

.countdown-label {
    color: #fff;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.countdown {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.cd-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--surface);
    color: var(--secondary);
    min-width: 70px;
    padding: 10px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.cd-box span {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.cd-box small {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 4px;
    color: var(--text-muted);
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 40px 20px 80px;
    display: flex;
    flex-direction: column;
}

.app-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin: 0 auto;
    width: 100%;
    max-width: 900px;
}

/* Status Banner */
.status-banner {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 40px 20px;
    text-align: center;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
}
.status-banner.ended { border-top: 5px solid var(--error); }
.status-banner.coming-soon { border-top: 5px solid var(--secondary); }

/* Tabs */
.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 20px;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    outline: none;
}

.tab-btn:hover {
    color: var(--secondary);
    background: rgba(17, 138, 178, 0.05);
}

.tab-btn.active {
    color: var(--secondary);
    border-bottom-color: var(--secondary);
    background: var(--surface);
}

.tab-content {
    display: none;
    padding: 40px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

/* Forms */
.form-header {
    text-align: center;
    margin-bottom: 30px;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; gap: 0; }
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

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

input:focus, textarea:focus, select:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(17, 138, 178, 0.1);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23118AB2' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Checkbox & Terms */
.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-main);
    font-size: 0.95rem;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-label a {
    color: var(--secondary);
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    transition: var(--transition);
}

.checkbox-label a:hover {
    color: var(--secondary-hover);
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.modal.hidden {
    opacity: 0;
    pointer-events: none;
}
.modal-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}
.modal-content {
    position: relative;
    z-index: 2001;
    background: #fff;
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}
.modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
    padding: 4px;
    border-radius: 50%;
}
.modal-close:hover {
    color: var(--error);
    background: rgba(239, 71, 111, 0.1);
}
.modal-body {
    padding: 24px;
    overflow-y: auto;
    font-size: 0.95rem;
    color: var(--text-main);
}
.modal-body p {
    margin-bottom: 15px;
}
.modal-body h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: var(--secondary);
}


/* Upload Area */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 40px 20px;
    text-align: center;
    position: relative;
    background: #f8f9fa;
    transition: var(--transition);
    margin-bottom: 30px;
    cursor: pointer;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background: rgba(249, 160, 63, 0.05);
}

.upload-area input[type="file"] {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.upload-placeholder svg {
    color: var(--primary);
    margin-bottom: 15px;
}

.upload-placeholder h3 {
    font-size: 1.25rem;
    margin-bottom: 5px;
}

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

.upload-preview {
    position: relative;
    max-width: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    z-index: 11;
}

.upload-preview img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.btn-icon {
    position: absolute;
    top: 10px; right: 10px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover { background: var(--error); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
    gap: 8px;
}

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

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(249, 160, 63, 0.3);
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(249, 160, 63, 0.4);
}

.btn-secondary {
    background: var(--secondary);
    color: #fff;
}
.btn-secondary:hover:not(:disabled) {
    background: var(--secondary-hover);
}

.btn-outline {
    background: transparent;
    color: var(--secondary);
    border: 2px solid var(--secondary);
}
.btn-outline:hover {
    background: var(--secondary);
    color: #fff;
}

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

/* Post Entry & Share Panel */
.post-entry-container {
    text-align: center;
}

.success-header { margin-bottom: 30px; }
.success-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 80px; height: 80px;
    background: rgba(6, 214, 160, 0.1);
    color: var(--accent);
    border-radius: 50%;
    margin-bottom: 20px;
}

.submitted-photo-preview {
    max-width: 400px;
    margin: 0 auto 30px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: #fff;
}
.submitted-photo-preview img {
    width: 100%; aspect-ratio: 1/1; object-fit: cover;
}
.my-entry-details { padding: 15px; }

.share-panel {
    background: #f8f9fa;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 30px;
    margin-bottom: 20px;
}

.copy-link-group {
    display: flex;
    margin: 20px 0;
    gap: 10px;
}
.copy-link-group input { margin-bottom: 0; }

.social-buttons {
    display: flex; gap: 15px; justify-content: center;
}
.btn-social { flex: 1; max-width: 200px; }
.btn-fb { background: #1877F2; color: white; }
.btn-tw { background: #000000; color: white; }

.bonus-panel {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(249, 160, 63, 0.1);
    border: 2px dashed var(--primary);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 30px;
    text-align: left;
}
.bonus-icon { font-size: 2.5rem; }
.bonus-content h4 { color: var(--primary); margin-bottom: 5px; }

/* Error Message */
.error-message {
    background: rgba(239, 71, 111, 0.1);
    color: var(--error);
    padding: 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    border-left: 4px solid var(--error);
    text-align: left;
}

/* Gallery Section */
.gallery-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap; gap: 15px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.gallery-card {
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}
.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.card-img-wrapper {
    position: relative;
    padding-top: 100%; /* 1:1 aspect ratio */
    overflow: hidden;
}
.card-img-wrapper img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.gallery-card:hover .card-img-wrapper img {
    transform: scale(1.05);
}

.card-content {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-author {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--secondary);
    margin-bottom: 5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-caption {
    font-size: 0.85rem; color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.card-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-vote {
    background: #f8f9fa;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 6px 12px;
    font-size: 0.9rem;
    border-radius: 99px;
}
.btn-vote:hover {
    background: rgba(239, 71, 111, 0.05);
    border-color: var(--error);
    color: var(--error);
}
.btn-vote.voted {
    background: var(--error);
    color: #fff;
    border-color: var(--error);
    pointer-events: none;
}
.btn-vote.voted svg { fill: currentColor; }

.vote-count {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.gallery-empty {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: var(--radius-md);
    border: 2px dashed var(--border);
}
.empty-icon { color: var(--border); margin-bottom: 20px; }

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

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    display: flex;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.lightbox.hidden {
    opacity: 0;
    pointer-events: none;
}

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

.lightbox-close {
    position: absolute; top: 20px; right: 20px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: none; border-radius: 50%;
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 1002;
    transition: var(--transition);
}
.lightbox-close:hover { background: var(--error); }

.lightbox-content {
    position: relative;
    z-index: 1001;
    display: flex;
    width: 100%; height: 100%;
    padding: 40px;
    gap: 40px;
}
@media (max-width: 900px) {
    .lightbox-content { flex-direction: column; padding: 20px; padding-top: 80px; overflow-y: auto; }
}

.lightbox-main {
    flex: 1;
    display: flex; align-items: center; justify-content: center;
    position: relative;
    min-height: 300px;
}

.lightbox-image-container {
    position: relative;
    max-width: 100%; max-height: 100%;
    display: flex; align-items: center; justify-content: center;
}
.lightbox-image-container img {
    max-height: calc(100vh - 80px);
    max-width: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: none; border-radius: 50%;
    width: 56px; height: 56px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.lightbox-nav:hover { background: rgba(255,255,255,0.3); }
.lightbox-nav.prev { left: -20px; }
.lightbox-nav.next { right: -20px; }
@media (max-width: 900px) {
    .lightbox-nav.prev { left: 10px; }
    .lightbox-nav.next { right: 10px; }
}

.lightbox-sidebar {
    width: 350px;
    background: #fff;
    border-radius: var(--radius-md);
    padding: 30px;
    display: flex; flex-direction: column; gap: 30px;
    overflow-y: auto;
}
@media (max-width: 900px) {
    .lightbox-sidebar { width: 100%; flex: none; }
}

.lightbox-meta {
    display: flex; align-items: center; gap: 15px; margin-bottom: 20px;
}
.lightbox-avatar {
    width: 48px; height: 48px;
    background: var(--secondary); color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-heading); font-size: 1.25rem; font-weight: 700;
}
.lightbox-author { font-weight: 700; font-size: 1.2rem; color: var(--text-main); }
.lightbox-caption { font-size: 1.05rem; color: var(--text-muted); line-height: 1.7; }

.lightbox-actions {
    margin-top: auto;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.lightbox-vote-container {
    text-align: center; margin-bottom: 20px;
}
.lightbox-vote-container .btn-vote {
    padding: 14px; font-size: 1.1rem;
    margin-bottom: 10px;
}
.lightbox-vote-container .vote-count { font-size: 1rem; }

.lightbox-share h4 { font-size: 1rem; margin-bottom: 15px; text-align: center; }
.share-buttons-small { display: flex; justify-content: center; gap: 15px; }
.btn-share-icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: none;
    display: flex; align-items: center; justify-content: center;
    color: #fff; cursor: pointer; transition: var(--transition);
}
.btn-share-icon:hover { transform: translateY(-3px); }
#lb-share-fb { background: #1877F2; }
#lb-share-tw { background: #000000; }
#lb-copy-link { background: var(--secondary); }

/* Loader */
.loader {
    width: 30px; height: 30px;
    border: 3px solid rgba(17, 138, 178, 0.2);
    border-top-color: var(--secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

#wbx-powered-by-slot {
    margin-top: 40px;
    padding-top: 20px;
    text-align: center;
}