/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-dark: #1f2937;
    --text-medium: #4b5563;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-dark);
}

.container {
    width: 100%;
    max-width: 900px;
    position: relative;
}

/* Screen Management */
.screen {
    display: none;
    background: var(--bg-white);
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    animation: fadeIn 0.5s ease-in-out;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Welcome Screen */
.welcome-content {
    padding: 60px 40px;
    text-align: center;
}

.logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    box-shadow: var(--shadow-lg);
}

.welcome-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 15px;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-medium);
    margin-bottom: 40px;
}

.info-cards {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.info-card {
    background: var(--bg-light);
    padding: 20px 30px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 2px solid var(--border-color);
}

.info-card i {
    font-size: 24px;
    color: var(--primary-color);
}

.info-card span {
    font-weight: 600;
    color: var(--text-dark);
}

.fluency-levels {
    margin-bottom: 40px;
}

.fluency-levels h3 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.level-badges {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.badge {
    padding: 15px 25px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1rem;
}

.badge i {
    font-size: 20px;
}

.badge.curious {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
}

.badge.capable {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.badge.fluent {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

/* Buttons */
.btn {
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--bg-light);
}

/* Quiz Screen */
.quiz-header {
    background: var(--gradient-primary);
    padding: 30px 40px;
    border-radius: 24px 24px 0 0;
}

.progress-container {
    color: white;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.3);
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    background: white;
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s ease;
    width: 8.33%;
}

.progress-text {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
}

.quiz-content {
    padding: 50px 40px;
}

.question-card h2 {
    font-size: 1.75rem;
    color: var(--text-dark);
    margin-bottom: 40px;
    line-height: 1.4;
    text-align: center;
}

.rating-scale {
    margin-bottom: 50px;
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 0 10px;
}

.scale-label-left,
.scale-label-right {
    font-size: 0.9rem;
    color: var(--text-medium);
    font-weight: 600;
}

.rating-options {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.rating-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.rating-option:hover {
    transform: translateY(-5px);
}

.rating-option input[type="radio"] {
    display: none;
}

.rating-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
    background: white;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.rating-option input[type="radio"]:checked + .rating-circle {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: scale(1.1);
}

.rating-label {
    font-size: 0.75rem;
    color: var(--text-medium);
    text-align: center;
    line-height: 1.2;
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 30px;
}

.quiz-navigation .btn {
    flex: 1;
}

/* Email Screen */
.email-content {
    padding: 60px 40px;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.email-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
}

.email-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.email-content > p {
    font-size: 1.1rem;
    color: var(--text-medium);
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 25px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.form-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.privacy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.privacy-note i {
    color: var(--success-color);
}

#emailForm .btn {
    width: 100%;
    justify-content: center;
}

/* Results Screen */
.results-content {
    padding: 50px 40px;
}

.results-header {
    text-align: center;
    margin-bottom: 50px;
}

.score-badge {
    display: inline-block;
    padding: 40px 60px;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
}

.score-badge.curious {
    background: var(--gradient-warning);
}

.score-badge.capable {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.score-badge.fluent {
    background: var(--gradient-success);
}

.score-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.score-badge h2 {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 10px;
}

.score-text {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
}

.results-description {
    background: var(--bg-light);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 40px;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-medium);
}

.insights-section,
.next-steps-section {
    margin-bottom: 40px;
}

.insights-section h3,
.next-steps-section h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.insights-section h3 i,
.next-steps-section h3 i {
    color: var(--primary-color);
}

.insight-item,
.step-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.insight-item h4,
.step-item h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.insight-item p,
.step-item p {
    color: var(--text-medium);
    line-height: 1.6;
}

.insight-item.strength {
    border-left-color: var(--success-color);
}

.insight-item.growth {
    border-left-color: var(--warning-color);
}

.cta-section {
    background: var(--gradient-primary);
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.cta-section h3 {
    font-size: 1.75rem;
    margin-bottom: 15px;
}

.cta-section p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.95;
}

.cta-section .btn {
    margin: 10px;
}

.cta-section .btn-secondary {
    background: white;
    color: var(--primary-color);
    border: none;
}

.export-section {
    text-align: center;
    padding: 30px;
    background: var(--bg-white);
    border-radius: 16px;
    margin-bottom: 20px;
    border: 2px solid var(--border-color);
}

.export-section h3 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.export-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.export-buttons .btn {
    flex: 1;
    min-width: 200px;
    max-width: 250px;
}

.share-section {
    text-align: center;
    padding: 30px;
    background: var(--bg-light);
    border-radius: 16px;
}

.share-section p {
    font-size: 1rem;
    color: var(--text-medium);
    margin-bottom: 20px;
    font-weight: 600;
}

.share-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.share-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease;
    color: white;
}

.share-btn:hover {
    transform: translateY(-2px);
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.linkedin {
    background: #0077b5;
}

.share-btn.facebook {
    background: #1877f2;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .welcome-content,
    .quiz-content,
    .email-content,
    .results-content {
        padding: 40px 25px;
    }

    .welcome-content h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .info-cards {
        flex-direction: column;
        align-items: stretch;
    }

    .rating-options {
        flex-wrap: wrap;
        gap: 10px;
    }

    .rating-option {
        flex-basis: calc(20% - 10px);
    }

    .rating-circle {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .rating-label {
        font-size: 0.65rem;
    }

    .scale-labels {
        font-size: 0.8rem;
    }

    .quiz-navigation {
        flex-direction: column;
    }

    .export-buttons {
        flex-direction: column;
    }

    .export-buttons .btn {
        width: 100%;
        max-width: 100%;
    }

    .share-buttons {
        flex-direction: column;
    }

    .share-btn {
        width: 100%;
        justify-content: center;
    }

    .cta-section .btn {
        width: 100%;
        margin: 5px 0;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .screen {
        border-radius: 16px;
    }

    .logo,
    .email-icon {
        width: 80px;
        height: 80px;
        font-size: 36px;
    }

    .question-card h2 {
        font-size: 1.3rem;
    }

    .rating-options {
        gap: 8px;
    }

    .rating-circle {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .score-badge {
        padding: 30px 40px;
    }

    .score-badge h2 {
        font-size: 2rem;
    }

    .score-icon {
        font-size: 60px;
    }
}
