/* CSS Reset and Variables */
:root {
    --primary: #3B82F6;
    --primary-hover: #2563EB;
    --secondary: #E0F2FE;
    --secondary-hover: #BAE6FD;
    --accent: #F59E0B;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --bg-page: #F0F9FF;
    --bg-card: #FFFFFF;
    --border: #E2E8F0;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 25px -5px rgba(59, 130, 246, 0.15);
    --shadow-lg: 0 20px 40px -10px rgba(59, 130, 246, 0.2);
    --font-head: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-page);
    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; }

/* Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }

/* Hero Section */
.hero {
    position: relative;
    padding: 80px 20px 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 0;
}
.hero-bg::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(2, 132, 199, 0.6), rgba(2, 132, 199, 0.9));
}

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

.hero .badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-family: var(--font-head);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero h1 .highlight {
    color: #BAE6FD;
}

.hero p {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
}

/* Countdown & Main Share */
.countdown-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.countdown-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: #fff;
    text-align: center;
    min-width: 70px;
}

.countdown-item span:first-child {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    font-family: var(--font-head);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.countdown-item span:last-child {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

.main-share-actions {
    margin-top: 2rem;
    color: #fff;
}

.main-share-actions p {
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

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

/* Layout */
.main-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px 60px;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 3;
    margin-top: -40px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 2rem;
}

.status-card {
    padding: 2rem;
    text-align: center;
}

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

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 1.25rem 1rem;
    font-family: var(--font-head);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--bg-card);
}

.tab-content {
    padding: 2.5rem;
}

/* Forms */
.form-header { text-align: center; margin-bottom: 2rem; }
.form-header h2 { font-family: var(--font-head); font-weight: 700; color: var(--primary); }

.form-group { margin-bottom: 1.5rem; }
.form-row { display: flex; gap: 1.5rem; }
.form-row .form-group { flex: 1; margin-bottom: 0; }

@media (max-width: 600px) {
    .form-row { flex-direction: column; gap: 1.5rem; }
}

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

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

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #FFFFFF;
}

/* File Upload Area */
.file-drop-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    border: 2px dashed var(--primary);
    border-radius: var(--radius-md);
    background: var(--secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.file-drop-area:hover, .file-drop-area.dragover {
    background: var(--secondary-hover);
    border-color: var(--primary-hover);
}

.file-icon { font-size: 3rem; margin-bottom: 1rem; }
.file-msg { font-weight: 500; color: var(--primary); font-size: 1.1rem; }
input[type="file"] { display: none; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-block { width: 100%; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(59, 130, 246, 0.4);
}

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

/* Spinner */
.spinner {
    width: 20px; height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Error Message */
.error-msg {
    background: #FEE2E2;
    color: #B91C1C;
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-weight: 500;
    text-align: center;
}

/* Post Entry & Share Panel */
.success-icon { font-size: 4rem; margin-bottom: 1rem; }
.my-upload-preview {
    max-width: 400px; margin: 2rem auto;
    border-radius: var(--radius-md); overflow: hidden;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.my-upload-details { padding: 1rem; background: #fff; text-align: left; }
.caption-text { font-style: italic; color: var(--text-muted); }

.share-panel {
    background: var(--secondary); padding: 2rem;
    border-radius: var(--radius-md); margin-top: 2rem;
}
.share-actions { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.share-actions input { flex: 1; margin: 0; }
.social-actions { display: flex; gap: 1rem; justify-content: center; }
.btn-social { flex: 1; max-width: 200px; color: #fff; }
.btn-fb { background: #1877F2; } .btn-fb:hover { background: #166FE5; }
.btn-tw { background: #000000; } .btn-tw:hover { background: #333333; }

@media (max-width: 600px) {
    .share-actions { flex-direction: column; }
    .social-actions { flex-direction: column; align-items: center;}
    .btn-social { max-width: 100%; width: 100%; }
}

/* Gallery Grid */
.gallery-header { text-align: center; margin-bottom: 2rem; }
.gallery-header h2 { font-family: var(--font-head); font-weight: 700; color: var(--primary); }

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

.gallery-card {
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-img-wrap {
    aspect-ratio: 1/1;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

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

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

.card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-caption {
    font-size: 0.95rem; margin-bottom: 0.5rem;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
    flex: 1;
}

.card-meta {
    font-size: 0.85rem; color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 500;
}

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

/* Voting Button */
.btn-vote {
    background: var(--bg-page);
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 999px;
}
.btn-vote:hover {
    background: var(--primary); color: #fff;
}
.btn-vote.voted {
    background: var(--primary); color: #fff; cursor: default;
    border-color: var(--primary); opacity: 0.8;
}
.vote-count {
    font-weight: 600; color: var(--text-main); font-size: 0.9rem;
}

/* Empty State */
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-icon { font-size: 4rem; margin-bottom: 1rem; }
.empty-state h3 { font-family: var(--font-head); font-size: 1.5rem; margin-bottom: 0.5rem; }

/* Lightbox Modal */
.lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 9999; display: flex; align-items: center; justify-content: center;
    padding: 2rem;
}
.lightbox-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.9); backdrop-filter: blur(5px);
}
.lightbox-content {
    position: relative; z-index: 1; width: 100%; max-width: 1200px;
    background: #fff; border-radius: var(--radius-lg); overflow: hidden;
    display: flex; max-height: 90vh; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.lightbox-close {
    position: absolute; top: 1rem; right: 1rem; z-index: 10;
    background: rgba(0,0,0,0.1); border: none; width: 40px; height: 40px;
    border-radius: 50%; font-size: 1.5rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.3s;
}
.lightbox-close:hover { background: rgba(0,0,0,0.2); }

.lightbox-layout { display: flex; width: 100%; }

.lightbox-image-container {
    flex: 2; background: #000; position: relative;
    display: flex; align-items: center; justify-content: center;
}
#lightbox-img { max-height: 90vh; width: auto; object-fit: contain; }

.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.2); border: none; color: #fff;
    width: 50px; height: 50px; border-radius: 50%; font-size: 2rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background 0.3s; backdrop-filter: blur(4px);
}
.lightbox-nav:hover { background: rgba(255,255,255,0.4); }
.lightbox-nav.prev { left: 1rem; }
.lightbox-nav.next { right: 1rem; }

.lightbox-sidebar {
    flex: 1; min-width: 350px; max-width: 450px; padding: 2.5rem;
    display: flex; flex-direction: column; overflow-y: auto;
}

.lightbox-author { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.author-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--secondary); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 1.2rem; text-transform: uppercase;
}
.author-info strong { display: block; font-size: 1.1rem; }
.author-info .date { font-size: 0.85rem; color: var(--text-muted); }

.lightbox-caption {
    font-size: 1.1rem; line-height: 1.6; margin-bottom: 2rem;
    color: var(--text-main); flex: 1;
}

.lightbox-action-area {
    margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border);
    display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.vote-count-large {
    font-size: 1.1rem; color: var(--text-muted); display: flex; flex-direction: column; align-items: center;
}
.vote-count-large strong { font-size: 2.5rem; font-family: var(--font-head); color: var(--primary); line-height: 1; }

.lightbox-share { text-align: center; }
.lightbox-share span { display: block; margin-bottom: 1rem; font-weight: 600; color: var(--text-muted); }
.mini-share { display: flex; justify-content: center; gap: 0.75rem; }
.btn-icon {
    width: 40px; height: 40px; border-radius: 50%; background: var(--secondary);
    color: var(--primary); display: flex; align-items: center; justify-content: center;
    text-decoration: none; font-weight: bold; border: none; cursor: pointer;
    transition: all 0.3s;
}
.btn-icon:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }

@media (max-width: 900px) {
    .lightbox-layout { flex-direction: column; }
    .lightbox-image-container { height: 50vh; flex: none; }
    .lightbox-sidebar { flex: none; max-width: 100%; min-width: auto; }
}

/* SDK Attribution */
#wbx-powered-by-slot {
    display: flex;
    justify-content: center;
    width: 100%;
}
