﻿/* Scoped Styling for Survey App */
.app-wrapper {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
    color: var(--text-main);
    font-family: inherit;
    transition: all 0.3s ease;
}

.screen {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

    .screen.active {
        display: block;
    }

/* Empty State */
#empty-state {
    text-align: center;
    margin-top: 4rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

#empty-state h2 {
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

#empty-state p {
    color: var(--text-muted);
}

/* Survey Header & Presenter Mode */
.survey-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.presenter-toggle {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
}

#display-question {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
    color: var(--accent);
}

/* Layout Grid */
.survey-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .survey-grid {
        grid-template-columns: 1fr;
    }
}

/* Presenter Mode Active States */
.app-wrapper.presenter-mode #card-vote {
    display: none;
}

.app-wrapper.presenter-mode .survey-grid {
    grid-template-columns: 1fr; /* Full width results */
}

.survey-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

    .survey-card h3 {
        margin-top: 0;
        margin-bottom: 1rem;
        color: var(--text-main);
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 0.5rem;
    }

/* Voting Buttons */
.vote-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.btn-vote {
    background: var(--bg-base);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-weight: 500;
}

    .btn-vote:hover {
        background: var(--bg-surface-hover);
        border-color: var(--accent);
    }

    .btn-vote.selected {
        background: var(--accent);
        color: white;
        border-color: var(--accent);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

/* Bar Graph Results & Animations */
.vote-results-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bar-container {
    background: var(--bg-base);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    height: 40px;
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
}

.bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--accent);
    opacity: 0.6;
    /* Smooth 1 second transition */
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s;
    width: 0%;
}

    .bar-fill.highlight {
        background-color: #ffffff;
        opacity: 0.9;
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
    }

.bar-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0 1rem;
    pointer-events: none;
    font-weight: 500;
}

.total-votes {
    margin-top: 1.5rem;
    text-align: right;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Modals & Inputs */
.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
}

    .btn-secondary:hover {
        background: var(--bg-surface-hover);
    }

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.btn-text {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.settings-input {
    width: 100%;
    background: var(--bg-base);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0.6rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

    .input-group label {
        display: block;
        margin-bottom: 0.4rem;
        color: var(--text-muted);
        font-size: 0.9rem;
    }

/* QR Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

    .modal-overlay.hidden {
        display: none;
    }

.modal-surface {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    width: 90%;
    max-width: 400px;
}

.qr-container {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    display: inline-block;
    margin: 1.5rem 0;
}

    .qr-container img {
        display: block;
    }

.qr-url {
    color: var(--accent);
    font-weight: bold;
    word-break: break-all;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
