* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #9333ea 0%, #ec4899 50%, #f97316 100%);
    min-height: 100vh;
    padding: 2rem;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

.container {
    max-width: 64rem;
    margin: 0 auto;
}

.container-wide {
    max-width: 90rem;
    margin: 0 auto;
}

.card {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 3rem;
    max-width: 28rem;
    margin: 0 auto;
}

.container .card,
.container-wide .card {
    max-width: 100%;
}

/* Typography */
.main-title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #9333ea, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #9333ea, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-center {
    text-align: center;
}

.text-gray {
    color: #6b7280;
}

.mb-large {
    margin-bottom: 2rem;
}

/* Icons */
.icon-large {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    color: #ec4899;
}

.icon-medium {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    color: #9333ea;
}

.icon-small {
    width: 20px;
    height: 20px;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 1rem 2rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #9333ea, #ec4899);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-logout {
    background: #fee2e2;
    color: #dc2626;
    width: auto;
    padding: 0.5rem 1rem;
}

.btn-logout:hover {
    background: #fecaca;
}

.btn-success {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
}

.btn-success:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.btn-warning {
    background: linear-gradient(135deg, #ea580c, #f97316);
    color: white;
}

.btn-warning:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.btn:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding: 0;
    width: auto;
}

.back-btn:hover {
    color: #9333ea;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.required {
    color: #dc2626;
}

.optional {
    color: #9ca3af;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #9333ea;
}

/* Header Section */
.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.5rem;
    border-radius: 1rem;
    text-align: center;
}

.stat-purple {
    background: linear-gradient(135deg, #ede9fe, #f3e8ff);
}

.stat-pink {
    background: linear-gradient(135deg, #fce7f3, #fbcfe8);
}

.stat-orange {
    background: linear-gradient(135deg, #fed7aa, #fdba74);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
}

.stat-purple .stat-value {
    color: #9333ea;
}

.stat-pink .stat-value {
    color: #ec4899;
}

.stat-orange .stat-value {
    color: #f97316;
}

.stat-label {
    color: #6b7280;
    margin-top: 0.5rem;
}

/* User Info Box */
.user-info-box {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #dbeafe;
    border-radius: 1rem;
    border: 1px solid #bfdbfe;
}

.user-info-box h3 {
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 0.5rem;
}

.user-info-box p {
    font-size: 0.875rem;
    color: #1e40af;
    margin: 0.25rem 0;
}

/* Button Group */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* QR Section */
.qr-section {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 1rem;
    text-align: center;
}

.qr-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.qr-section img {
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    margin: 1rem auto;
}

.qr-section p {
    font-size: 0.875rem;
    margin-top: 1rem;
}

/* Options Container */
#optionsContainer {
    margin-bottom: 1.5rem;
}

.option-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.option-input-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.option-inputs {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

.option-inputs input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    font-size: 1rem;
}

.option-inputs input:focus {
    outline: none;
    border-color: #9333ea;
}

.option-inputs input[type="number"] {
    width: 100px;
    flex: none;
}

.option-label-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.points-label {
    color: #10b981;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Questions List */
#questionsList {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.question-item {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 1rem;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.question-title {
    font-weight: 700;
    font-size: 1.125rem;
    flex: 1;
}

.question-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    padding: 0.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-edit {
    background: #dbeafe;
    color: #1e40af;
}

.btn-edit:hover {
    background: #bfdbfe;
}

.btn-delete {
    background: #fee2e2;
    color: #dc2626;
}

.btn-delete:hover {
    background: #fecaca;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.option-display {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.option-points {
    color: #10b981;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Quiz Screen */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 0.5rem;
    background: #e5e7eb;
    border-radius: 9999px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #9333ea, #ec4899);
    transition: width 0.3s;
    border-radius: 9999px;
}

.question-text {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 2rem;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.quiz-option {
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    background: #f3f4f6;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quiz-option:hover {
    background: #e5e7eb;
}

.quiz-option.selected {
    background: linear-gradient(135deg, #9333ea, #ec4899);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.option-points-display {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Result Screen */
.thank-you-box {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #dbeafe;
    border-radius: 0.75rem;
}

.thank-you-box p {
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 0.25rem;
}

.thank-you-box p:last-child {
    font-size: 0.75rem;
    color: #1e40af;
    margin-top: 0.25rem;
}

.result-score {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #9333ea, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-emoji {
    font-size: 2rem;
    margin-bottom: 2rem;
}

.result-percentage {
    font-size: 1.25rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

/* Results Table */
#resultsTableContainer {
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.results-table thead {
    background: #f9fafb;
}

.results-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    border-bottom: 1px solid #e5e7eb;
}

.results-table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
}

.results-table tr:hover {
    background: #f9fafb;
}

.results-table a {
    color: #2563eb;
    text-decoration: none;
}

.results-table a:hover {
    text-decoration: underline;
}

.percentage-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.percentage-high {
    background: #d1fae5;
    color: #065f46;
}

.percentage-medium {
    background: #fef3c7;
    color: #92400e;
}

.percentage-low {
    background: #fee2e2;
    color: #991b1b;
}

.no-data {
    text-align: center;
    padding: 3rem;
}

.no-data svg {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    color: #d1d5db;
}

.no-data p {
    color: #6b7280;
    font-size: 1.125rem;
}

/* Version Text */
.version-text {
    margin-top: 2rem;
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: center;
    user-select: none;
    cursor: default;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .card {
        padding: 1.5rem;
    }

    .main-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .header-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-logout {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .question-header {
        flex-direction: column;
    }

    .question-actions {
        width: 100%;
    }

    .btn-icon {
        flex: 1;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .option-inputs {
        flex-direction: column;
    }

    .option-inputs input[type="number"] {
        width: 100%;
    }
}
/* Fancy Score Card */
.result-card {
    padding-top: 2rem;
}

.score-emoji {
    font-size: 4rem;
    animation: pop 0.6s ease;
}

@keyframes pop {
    0% { transform: scale(0.3); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.result-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-top: 1rem;
    background: linear-gradient(135deg, #9333ea, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.result-message {
    color: #6b7280;
    margin-top: 0.5rem;
    font-size: 1rem;
}

.score-box {
    margin: 2rem auto;
    padding: 1.5rem;
    width: 80%;
    background: #fef3c7;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.score-value {
    font-size: 3rem;
    font-weight: 900;
    color: #ec4899;
}

.score-percentage {
    font-size: 2rem;
    font-weight: 700;
    color: #9333ea;
    margin-top: 0.5rem;
}

.score-tag {
    margin-top: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 9999px;
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    background: #10b981;
}
