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

:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --gray-color: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

/* FIX: Added page fade-in animation */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    opacity: 0;
    animation: fadeIn 0.5s ease-in forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    font-size: 1.1rem;
    color: var(--gray-color);
}

/* Main Content */
.main-content {
    margin-bottom: 40px;
}

.learning-config {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
}

.learning-config h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.learning-config h2 i {
    color: var(--primary-color);
}

.subtitle {
    color: var(--gray-color);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* Form Sections */
.form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 30px;
}

.form-section h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section h3 i {
    color: var(--gray-color);
}

/* Domain Options */
.domain-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

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

.domain-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px;
    background: var(--light-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.domain-option label:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.domain-option input[type="radio"]:checked + label {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(16, 185, 129, 0.1));
    box-shadow: var(--shadow);
}

.domain-option label i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.domain-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.domain-desc {
    font-size: 0.9rem;
    color: var(--gray-color);
}

/* Form Groups */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: var(--gray-color);
}

.form-group select,
.form-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: white;
}

.form-group select:focus,
.form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Range Slider */
.range-container {
    position: relative;
    padding-top: 30px;
}

.range-container input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
}

.range-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: var(--shadow);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--gray-color);
}

.range-labels span {
    font-weight: 500;
}

#questionCount {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* Buttons */
.form-actions {
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary i {
    font-size: 1.2rem;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    background: var(--light-color);
    border-radius: var(--radius);
    margin-top: 30px;
}

.spinner {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.loading p {
    font-size: 1.1rem;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.loading-note {
    font-size: 0.9rem;
    color: var(--gray-color);
    font-style: italic;
}

/* Error Message */
.error-message {
    background: #fee;
    color: var(--danger-color);
    padding: 20px;
    border-radius: var(--radius);
    border-left: 4px solid var(--danger-color);
    margin-top: 20px;
    font-weight: 500;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--gray-color);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 20px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .learning-config {
        padding: 20px;
    }
    
    .domain-options {
        grid-template-columns: 1fr;
    }
    
    .form-section h3 {
        font-size: 1.1rem;
    }
    
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .logo {
        flex-direction: column;
        text-align: center;
    }
    
    .logo i {
        font-size: 2rem;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
}