@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-light: #f8fafc;
    --bg-gradient: radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.05) 0px, transparent 50%),
                    radial-gradient(at 100% 100%, rgba(225, 29, 72, 0.05) 0px, transparent 50%),
                    #f1f5f9;
    
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --border-primary: #2563eb;
    
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --primary-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);

    --accent-red: #e11d48;
    --accent-amber: #d97706;
    --accent-emerald: #059669;
    --accent-purple: #7c3aed;

    --text-main: #0f172a;
    --text-muted: #475569;
    --text-dim: #94a3b8;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --shadow-card: 0 10px 30px -5px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
    --shadow-glow: 0 4px 20px rgba(37, 99, 235, 0.15);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-light);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Container */
.app-wrapper {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* HEADER STYLING */
.header-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
}

.header-logos {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo-img {
    height: 54px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.header-logo-img:hover {
    transform: scale(1.03);
}

.header-divider {
    height: 38px;
    width: 1px;
    background: #cbd5e1;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 8px 16px;
    border-radius: 30px;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.6); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.status-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* MAIN CARD CONTAINER */
.card-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.card-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.question-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-main);
    margin-bottom: 24px;
}

/* OPTIONS LIST */
.options-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.option-btn {
    position: relative;
    width: 100%;
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    outline: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.option-btn:hover:not(:disabled) {
    background: #f8fafc;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.option-btn.selected {
    background: #eff6ff;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.2);
}

.option-content {
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 2;
    width: 100%;
}

.option-badge {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary);
}

.option-btn.selected .option-badge {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.option-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    flex: 1;
}

/* RESULTS BARS */
.bar-background {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.15) 0%, rgba(59, 130, 246, 0.28) 100%);
    width: 0%;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
}

.option-btn:nth-child(2) .bar-background { background: linear-gradient(90deg, rgba(225, 29, 72, 0.15) 0%, rgba(244, 63, 94, 0.28) 100%); }
.option-btn:nth-child(3) .bar-background { background: linear-gradient(90deg, rgba(217, 119, 6, 0.15) 0%, rgba(245, 158, 11, 0.28) 100%); }
.option-btn:nth-child(4) .bar-background { background: linear-gradient(90deg, rgba(5, 150, 105, 0.15) 0%, rgba(16, 185, 129, 0.28) 100%); }
.option-btn:nth-child(5) .bar-background { background: linear-gradient(90deg, rgba(124, 58, 237, 0.15) 0%, rgba(139, 92, 246, 0.28) 100%); }

.result-percentage {
    z-index: 2;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--primary);
    padding-left: 12px;
}

/* TIMER & SUBMISSION MESSAGE */
.timer-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fffbebf5;
    border: 1px solid #fde68a;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-weight: 700;
    color: #b45309;
}

.vote-submitted-badge {
    text-align: center;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    color: #047857;
    font-weight: 700;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* FOOTER STYLING */
.footer-container {
    margin-top: auto;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    box-shadow: var(--shadow-card);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.footer-text {
    font-size: 0.92rem;
    color: var(--text-muted);
    font-weight: 500;
}

.footer-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* DISPLAY SCREEN / PROJECTOR VIEW SPECIAL STYLES */
.display-wrapper {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.display-header {
    padding: 24px 36px;
}

.display-header .header-logo-img {
    height: 75px;
}

.display-main-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 30px;
    flex: 1;
}

.display-question {
    font-size: 2.2rem;
    line-height: 1.3;
    margin-bottom: 32px;
}

.display-option-btn {
    padding: 24px 30px;
    border-radius: 18px;
}

.display-option-text {
    font-size: 1.4rem;
    font-weight: 600;
}

.display-percentage {
    font-size: 1.8rem;
}

.qr-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 16px;
    box-shadow: var(--shadow-card);
}

.qr-img {
    width: 220px;
    height: 220px;
    border-radius: 14px;
    background: #ffffff;
    padding: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.qr-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary);
}

.qr-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    word-break: break-all;
    font-weight: 600;
}

/* ADMIN PANEL STYLES */
.admin-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
}

.admin-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-card);
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-main);
    border: 1px solid #cbd5e1;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-danger {
    background: #fff1f2;
    color: #e11d48;
    border: 1px solid #fecdd3;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
}

.btn-danger:hover {
    background: #ffe4e6;
}

/* RESPONSIVE MEDIA QUERIES */
@media (max-width: 900px) {
    .display-main-grid {
        grid-template-columns: 1fr;
    }
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .header-container {
        padding: 14px 16px;
    }
    .header-logos {
        gap: 10px;
    }
    .header-logo-img {
        height: 38px;
    }
    .card-panel {
        padding: 22px 18px;
    }
    .question-title {
        font-size: 1.2rem;
    }
    .option-btn {
        padding: 14px 16px;
    }
    .display-question {
        font-size: 1.5rem;
    }
}
