:root {
    /* KTNV Brand Colors */
    --primary: #dc2626;      /* Deep Red */
    --primary-hover: #b91c1c;
    --secondary: #1d4ed8;    /* Bright Blue */
    --secondary-hover: #1e3a8a;
    --accent: #3b82f6;       /* Light Blue */
    --dark-bg: #0f172a;      /* Navy Background */
    
    /* Layout */
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    /* Text */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

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

body {
    font-family: var(--font-body);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    background-color: var(--dark-bg);
    position: relative;
    -webkit-font-smoothing: antialiased;
}

.hidden {
    display: none !important;
}

/* Background Setup */
.bg-image {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
}

.bg-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 58, 138, 0.7) 100%);
    z-index: -1;
}

/* Layout Wrapper */
.main-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 20px 40px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.tagline {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.1;
    color: #fff;
    margin-bottom: 24px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* Countdown */
#countdown-wrapper {
    margin-top: 24px;
}

.countdown-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

#countdown {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.cd-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    min-width: 80px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.cd-box span {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--primary);
    line-height: 1;
    margin-bottom: 4px;
}

.cd-box small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Main Content Card */
.content-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    margin-bottom: auto;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 12px;
    color: #fff;
}

.section-desc {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 32px;
}

/* Poll Choices Grid */
.choices-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.poll-choice {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: #fff;
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
}

.poll-choice:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.poll-choice.selected {
    background: rgba(59, 130, 246, 0.15); /* light blue tint */
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 8px 20px rgba(59, 130, 246, 0.2);
}

.poll-choice.selected::after {
    content: '';
    display: block;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-left: auto;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.poll-choice .choice-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    color: var(--accent);
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Write-in Specific */
.write-in-box {
    background: rgba(0, 0, 0, 0.15);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 32px;
    animation: fadeInDown 0.4s ease forwards;
}

.write-in-box .form-input {
    margin: 12px 0;
    border-style: dashed;
}

.write-in-box .form-input:focus {
    border-style: solid;
}

.help-text {
    font-size: 0.85rem;
    color: var(--accent);
    font-style: italic;
}

/* Buttons */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #ef4444 100%);
    color: #fff;
    box-shadow: 0 10px 20px rgba(220, 38, 38, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(220, 38, 38, 0.4);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: auto;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.privacy-note {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 16px;
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 0.95rem;
    border: 1px solid transparent;
}

.alert.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Results UI */
.success-header {
    text-align: center;
    margin-bottom: 32px;
}

.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    margin-bottom: 20px;
    border: 2px solid rgba(59, 130, 246, 0.3);
}

.success-header h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: #fff;
}

.write-in-thanks {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid var(--accent);
    padding: 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 32px;
}

.write-in-thanks p {
    color: #bfdbfe;
    font-size: 1.05rem;
}

.results-container h3 {
    font-size: 1.5rem;
    margin-bottom: 24px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}

.result-item {
    margin-bottom: 20px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 500;
}

.result-title {
    color: #e2e8f0;
}

.result-percent {
    color: var(--accent);
    font-weight: 600;
}

.result-bar-bg {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    overflow: hidden;
}

.result-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary) 0%, var(--accent) 100%);
    border-radius: 999px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.result-item.winner .result-bar-fill {
    background: linear-gradient(90deg, var(--primary) 0%, #ef4444 100%);
}

/* Share Panel */
.share-box {
    margin-top: 40px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    text-align: center;
}

.share-box h3 {
    color: #fff;
    margin-bottom: 12px;
}

.share-box p {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.share-input-group {
    display: flex;
    gap: 12px;
}

/* Spinner */
.spinner-circle {
    transform-origin: center;
    animation: spinner-dash 1.5s ease-in-out infinite;
}

.btn-spinner {
    position: absolute;
    width: 24px;
    height: 24px;
}

.btn-spinner svg {
    animation: spinner-rotate 2s linear infinite;
}

@keyframes spinner-rotate { 100% { transform: rotate(360deg); } }
@keyframes spinner-dash {
    0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 200; stroke-dashoffset: -35px; }
    100% { stroke-dasharray: 90, 200; stroke-dashoffset: -124px; }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Footer */
.footer {
    padding: 20px 0;
    margin-top: auto;
}

#wbx-powered-by-slot {
    margin: 0 auto;
}

/* Responsive */
@media (max-width: 768px) {
    .main-wrapper {
        padding: 40px 16px 20px;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .content-card {
        padding: 24px 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .share-input-group {
        flex-direction: column;
    }
    
    .btn-secondary {
        width: 100%;
    }
}

/* Social Share Buttons */
.social-share-global {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.social-share-global p {
    color: var(--text-muted);
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.btn-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.btn-social svg {
    flex-shrink: 0;
}

.btn-social.btn-fb {
    background-color: #1877F2;
}

.btn-social.btn-fb:hover {
    background-color: #166fe5;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(24, 119, 242, 0.3);
}

.btn-social.btn-tw {
    background-color: #000000;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-social.btn-tw:hover {
    background-color: #111111;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

@media (max-width: 480px) {
    .social-buttons {
        flex-direction: column;
    }
    .btn-social {
        width: 100%;
    }
}
