/* ============================================
   Studio Operations Assessment - Styles
   ============================================ */

/* CSS Variables */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-focus: #6366f1;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-secondary);
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-primary);
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p {
    color: var(--text-secondary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Utility Classes */
.hidden { display: none !important; }
.visible { display: block !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
    align-items: center;
}

@media (min-width: 1024px) {
    .login-container {
        grid-template-columns: 480px 1fr;
    }
}

.login-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo {
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.login-header .subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 0.875rem;
    color: var(--text-tertiary);
    pointer-events: none;
}

input[type="email"],
input[type="password"],
input[type="text"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: all var(--transition);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

input::placeholder {
    color: var(--text-tertiary);
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition);
}

.toggle-password:hover {
    color: var(--text-secondary);
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary);
    cursor: pointer;
}

.forgot-password {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-200);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #059669;
}

.btn-full {
    width: 100%;
    padding: 0.875rem;
    font-size: 0.9375rem;
}

.btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    animation: spin 1s linear infinite;
}

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

/* Error Message */
.error-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 1rem;
}

/* Login Footer */
.login-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.login-footer p {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

.login-footer code {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.375rem;
}

/* Login Info Panel */
.login-info {
    display: none;
    color: white;
}

@media (min-width: 1024px) {
    .login-info {
        display: block;
    }
}

.info-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.info-card h2 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
}

.feature-list svg {
    flex-shrink: 0;
    color: #a5b4fc;
    margin-top: 0.125rem;
}

/* ============================================
   ASSESSMENT PAGE
   ============================================ */

.assessment-page {
    background: var(--bg-secondary);
    min-height: 100vh;
}

/* Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-text {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-details {
    display: none;
    flex-direction: column;
}

@media (min-width: 640px) {
    .user-details {
        display: flex;
    }
}

.user-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Main Layout */
.app-main {
    display: flex;
    padding-top: 64px;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 64px;
    bottom: 0;
    width: 280px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    overflow-y: auto;
    z-index: 90;
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
}

.sidebar.open {
    transform: translateX(0);
}

@media (min-width: 1024px) {
    .sidebar {
        position: sticky;
        transform: translateX(0);
    }
}

.progress-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.progress-card h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.progress-ring {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
}

.progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: var(--gray-200);
    stroke-width: 8;
}

.progress-ring-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset var(--transition-slow);
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-percent {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.progress-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.progress-stats {
    display: flex;
    justify-content: space-around;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Section Navigation */
.section-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.section-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-size: 0.875rem;
}

.section-nav-item:hover {
    background: var(--bg-secondary);
}

.section-nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.section-nav-item.completed {
    color: var(--success);
}

.section-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.section-nav-item.active .section-number {
    background: var(--primary);
    color: white;
}

.section-nav-item.completed .section-number {
    background: var(--success);
    color: white;
}

.section-info {
    flex: 1;
}

.section-name {
    display: block;
    font-weight: 500;
}

.section-range {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 1.5rem;
    margin-left: 0;
    transition: margin-left var(--transition-slow);
}

@media (min-width: 1024px) {
    .content-area {
        margin-left: 280px;
    }
}

/* Welcome Screen */
.welcome-screen {
    max-width: 800px;
    margin: 0 auto;
}

.welcome-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow);
}

.welcome-card h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.assessment-info {
    margin-bottom: 2rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.info-icon {
    width: 48px;
    height: 48px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.info-content h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.info-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.topics-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.topic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-flex;
    padding: 0.375rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.welcome-actions {
    display: flex;
    justify-content: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Question Container */
.question-container {
    max-width: 900px;
    margin: 0 auto;
}

.question-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.question-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.question-number {
    font-weight: 600;
    color: var(--text-primary);
}

.difficulty-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.difficulty-badge[data-level="Basic"] {
    background: #dcfce7;
    color: #166534;
}

.difficulty-badge[data-level="Low-Intermediate"] {
    background: #dbeafe;
    color: #1e40af;
}

.difficulty-badge[data-level="Intermediate"] {
    background: #fef3c7;
    color: #92400e;
}

.difficulty-badge[data-level="Low-Upper-Intermediate"] {
    background: #ffedd5;
    color: #9a3412;
}

.difficulty-badge[data-level="Upper-Intermediate"] {
    background: #fce7f3;
    color: #9d174d;
}

.difficulty-badge[data-level="Low-Advanced"] {
    background: #f3e8ff;
    color: #6b21a8;
}

.difficulty-badge[data-level="Advanced"] {
    background: #ede9fe;
    color: #5b21b6;
}

.difficulty-badge[data-level="High-Advanced"] {
    background: #fef2f2;
    color: #991b1b;
}

.difficulty-badge[data-level="Expert"] {
    background: #fef3c7;
    color: #854d0e;
}

.difficulty-badge[data-level="Master Level"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.question-nav {
    display: flex;
    gap: 0.5rem;
}

/* Question Card */
.question-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.question-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* MCQ Options */
.mcq-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mcq-option {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-primary);
}

.mcq-option:hover {
    border-color: var(--primary-light);
    background: rgba(99, 102, 241, 0.02);
}

.mcq-option.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.mcq-option input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    accent-color: var(--primary);
    cursor: pointer;
}

.mcq-option-label {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--text-primary);
    cursor: pointer;
}

/* Written Answer */
.written-answer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.written-answer label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.written-answer textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color var(--transition);
}

.written-answer textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.word-count {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Question Actions */
.question-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Results Screen */
.results-screen {
    max-width: 600px;
    margin: 0 auto;
}

.results-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.results-header {
    margin-bottom: 2rem;
}

.results-header h2 {
    margin-bottom: 0.5rem;
}

.score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.score-circle .score-value {
    font-size: 2.5rem;
    font-weight: 700;
}

.score-circle .score-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.score-details {
    display: flex;
    gap: 2rem;
}

.score-item {
    text-align: center;
}

.score-item .score-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.score-item .score-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
    max-width: 400px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.toast.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.toast.info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
}

@media (min-width: 1024px) {
    .mobile-menu-toggle {
        display: none;
    }
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .login-card {
        padding: 1.5rem;
    }
    
    .welcome-card {
        padding: 1.5rem;
    }
    
    .welcome-card h1 {
        font-size: 1.375rem;
    }
    
    .question-card {
        padding: 1.25rem;
    }
    
    .question-text {
        font-size: 1rem;
    }
    
    .results-card {
        padding: 1.5rem;
    }
    
    .score-details {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Print Styles */
@media print {
    .app-header,
    .sidebar,
    .question-actions {
        display: none;
    }
    
    .content-area {
        margin-left: 0;
        padding: 0;
    }
    
    .question-card {
        box-shadow: none;
        border: 1px solid var(--border-color);
        break-inside: avoid;
    }
}