/* styles/user.css - نظام التعليم المتكامل - النسخة النهائية */
/* تم الدمج والتحديث بواسطة AI Assistant */

/* === المتغيرات الأساسية === */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #4a6baf 0%, #3a5a9f 100%);
    --success-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --info-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --primary-color: #4a6baf;
    --secondary-color: #667eea;
    --accent-color: #764ba2;
    --success-color: #43e97b;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --dark-bg: #2d2d44;
    --text-dark: #2c3e50;
    --text-muted: #7f8c8d;
    --border-color: #e9ecef;
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-hard: 0 15px 35px rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --border-radius: 0.375rem;
    --border-radius-lg: 0.5rem;
    --border-radius-xl: 1rem;
    --transition: all 0.3s ease;
}

/* === الأساسيات === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    background: #f5f7fb;
    color: var(--text-dark);
    line-height: 1.6;
    direction: rtl;
    min-height: 100vh;
}

/* === صفحة تسجيل الدخول === */
.login-wrapper {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: white;
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 30px 25px;
    box-shadow: var(--shadow-hard);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUp 0.6s ease-out;
    width: 100%;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.logo-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: white;
    font-size: 36px;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.app-title {
    color: var(--text-dark);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
    line-height: 1.2;
}

.app-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.form-group {
    margin-bottom: 20px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
    z-index: 2;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-input {
    width: 100%;
    padding: 16px 50px 16px 16px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    color: var(--text-dark);
    transition: var(--transition);
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: #95a5a6;
}

.error-message {
    background: #ffeaea;
    color: #e74c3c;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    border: 1px solid #ffcdd2;
    animation: shake 0.5s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.error-message i {
    font-size: 18px;
}

.login-button {
    width: 100%;
    padding: 16px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-button .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

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

.login-button.loading .spinner {
    display: block;
}

.login-button.loading .button-text {
    opacity: 0.7;
}

.password-toggle {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #95a5a6;
    cursor: pointer;
    z-index: 3;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

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

.links-section {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.link {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border-radius: 8px;
}

.link:hover {
    color: var(--accent-color);
    background: rgba(102, 126, 234, 0.1);
}

/* === صفحة التسجيل === */
.register-wrapper {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.register-container {
    background: white;
    border-radius: 24px;
    padding: 30px 25px;
    box-shadow: var(--shadow-hard);
    animation: slideUp 0.6s ease-out;
    width: 100%;
}

.form-section {
    margin-bottom: 25px;
}

.section-title {
    color: var(--text-dark);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f2f6;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--secondary-color);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 14px;
}

.form-label.required::after {
    content: ' *';
    color: var(--danger-color);
}

.form-input.error {
    border-color: var(--danger-color);
    background: #ffeaea;
}

.form-input.success {
    border-color: var(--success-color);
    background: #e8f8ef;
}

.error-text {
    color: var(--danger-color);
    font-size: 13px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    animation: fadeIn 0.3s ease;
}

.success-message {
    background: #e8f8ef;
    color: #27ae60;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #a3e9c2;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.password-strength {
    margin-top: 8px;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.strength-meter {
    height: 100%;
    width: 0%;
    transition: var(--transition);
    border-radius: 2px;
}

.strength-weak {
    background: var(--danger-color);
    width: 33%;
}

.strength-medium {
    background: var(--warning-color);
    width: 66%;
}

.strength-strong {
    background: #27ae60;
    width: 100%;
}

.strength-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: left;
}

.form-note {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 5px;
    line-height: 1.5;
}

.register-button {
    width: 100%;
    padding: 16px;
    background: var(--success-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.register-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(67, 233, 123, 0.3);
}

.register-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.login-link {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 14px;
}

.login-link a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
}

.login-link a:hover {
    text-decoration: underline;
}

.form-select {
    width: 100%;
    padding: 14px 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    color: var(--text-dark);
    background: var(--light-bg);
    cursor: pointer;
    transition: var(--transition);
}

.form-select:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.input-with-icon {
    position: relative;
}

.input-with-icon .form-input {
    padding-left: 45px;
}

/* === صفحة تسجيل الخروج === */
.logout-wrapper {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-container {
    background: white;
    border-radius: 24px;
    padding: 40px 30px;
    box-shadow: var(--shadow-hard);
    text-align: center;
    animation: fadeIn 0.8s ease-out;
    width: 100%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 20px rgba(102, 126, 234, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

.logout-title {
    color: var(--text-dark);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
}

.logout-message {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.logout-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.logout-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
}

.btn-login {
    background: var(--primary-gradient);
    color: white;
    border: none;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
    color: white;
}

.btn-home {
    background: var(--light-bg);
    color: var(--secondary-color);
    border: 2px solid var(--border-color);
}

.btn-home:hover {
    background: #e9ecef;
    color: var(--secondary-color);
}

.countdown {
    font-size: 14px;
    color: #95a5a6;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.countdown-number {
    font-weight: 700;
    color: var(--secondary-color);
}

/* === لوحة التحكم الرئيسية === */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    padding: 10px 0;
}

.nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #95a5a6;
    padding: 8px 12px;
    border-radius: 12px;
    transition: var(--transition);
    flex: 1;
    max-width: 80px;
}

.nav-item.active {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.nav-label {
    font-size: 12px;
    font-weight: 500;
}

.main-container {
    padding: 80px 15px 70px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
}

.dashboard-header {
    margin-bottom: 30px;
}

.user-greeting {
    background: var(--primary-gradient);
    color: white;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.greeting-text h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.greeting-text p {
    font-size: 15px;
    opacity: 0.9;
    margin-bottom: 15px;
}

.greeting-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 15px;
    color: white;
}

.stat-icon.exams {
    background: var(--primary-gradient);
}

.stat-icon.score {
    background: var(--success-gradient);
}

.stat-icon.courses {
    background: var(--info-gradient);
}

.stat-icon.time {
    background: linear-gradient(135deg, #fa709a, #fee140);
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.course-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    position: relative;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.course-header {
    padding: 20px;
    color: white;
    min-height: 120px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.course-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.course-info h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 5px;
}

.course-info p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
}

.course-body {
    padding: 20px;
}

.course-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

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

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    display: block;
}

.stat-name {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
}

.course-actions {
    display: flex;
    gap: 10px;
}

.btn-course {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

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

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-details {
    background: var(--light-bg);
    color: var(--secondary-color);
    border: 2px solid var(--border-color);
}

.btn-details:hover {
    background: #e9ecef;
}

.activity-list {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.activity-item {
    padding: 18px 20px;
    border-bottom: 1px solid #f1f2f6;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: background 0.3s ease;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: #f8f9fa;
}

.activity-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.activity-time {
    font-size: 12px;
    color: var(--text-muted);
}

.activity-score {
    font-weight: 700;
    font-size: 16px;
}

.score-good {
    color: #43e97b;
}

.score-average {
    color: var(--warning-color);
}

.score-poor {
    color: #fa709a;
}

.course-network {
    background: var(--primary-gradient);
}

.course-vision {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.course-algorithms {
    background: var(--info-gradient);
}

.course-micro {
    background: var(--success-gradient);
}

.course-database {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.course-software {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.desktop-nav {
    display: none;
}

.mobile-footer {
    text-align: center;
    padding: 20px 15px;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border-color);
    background: white;
}

/* === صفحة الاختبارات === */
.header {
    background: var(--secondary-gradient);
    color: white;
    padding: 40px 30px;
    border-radius: var(--border-radius-xl);
    margin-bottom: 40px;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.95;
    margin-bottom: 0;
    max-width: 800px;
    margin: 0 auto;
}

.subject-info {
    background: linear-gradient(135deg, #e8f4fd 0%, #d1e7ff 100%);
    padding: 20px 30px;
    border-radius: var(--border-radius-xl);
    margin-bottom: 30px;
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--text-dark);
    border-right: 5px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.score-display {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    padding: 20px;
    border-radius: var(--border-radius-xl);
    margin-bottom: 30px;
    text-align: center;
    font-weight: bold;
    font-size: 1.3rem;
    color: #8a6d3b;
    border: 3px solid var(--warning-color);
    box-shadow: var(--shadow-sm);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 4px 12px rgba(255, 193, 7, 0.1);
    }

    50% {
        box-shadow: 0 4px 20px rgba(255, 193, 7, 0.3);
    }
}

.progress-container {
    margin-bottom: 40px;
    position: relative;
}

.progress-text {
    text-align: center;
    margin-bottom: 15px;
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress {
    height: 16px;
    background-color: #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.question-container {
    background-color: white;
    border-radius: var(--border-radius-xl);
    padding: 35px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
    border: 1px solid var(--border-color);
    position: relative;
    transition: var(--transition);
}

.question-container:hover {
    box-shadow: var(--shadow-lg);
}

.question-number {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.question-number::before {
    content: '📝';
    font-size: 1.3rem;
}

.question-text {
    font-size: 1.4rem;
    margin-bottom: 30px;
    font-weight: 600;
    line-height: 1.8;
    color: var(--text-dark);
    text-align: right;
    padding: 0 10px;
}

.result-indicator {
    padding: 20px;
    border-radius: var(--border-radius-xl);
    margin-bottom: 25px;
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
    animation: fadeIn 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.result-correct {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 3px solid #28a745;
    box-shadow: var(--shadow-sm);
}

.result-incorrect {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 3px solid var(--danger-color);
    box-shadow: var(--shadow-sm);
}

.result-correct::before {
    content: '✅';
    font-size: 1.5rem;
}

.result-incorrect::before {
    content: '❌';
    font-size: 1.5rem;
}

.options-container {
    margin-bottom: 40px;
}

.option {
    display: block;
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-xl);
    padding: 18px 25px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: var(--transition);
    text-align: right;
    position: relative;
    overflow: hidden;
    font-size: 1.1rem;
}

.option::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: transparent;
    transition: var(--transition);
}

.option:hover {
    background: #e7f3ff;
    border-color: var(--primary-color);
    transform: translateX(-8px);
    box-shadow: var(--shadow-sm);
}

.option:hover::before {
    background: var(--primary-color);
}

.option input[type="radio"] {
    margin-left: 20px;
    margin-right: 8px;
    transform: scale(1.3);
    cursor: pointer;
    accent-color: var(--primary-color);
}

.option.correct {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #28a745;
    color: #155724;
    animation: pulseCorrect 1.5s ease;
}

.option.incorrect {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: var(--danger-color);
    color: #721c24;
    animation: pulseIncorrect 1.5s ease;
}

.option.correct::before,
.option.incorrect::before {
    width: 6px;
}

.option.correct::before {
    background: #28a745;
}

.option.incorrect::before {
    background: var(--danger-color);
}

@keyframes pulseCorrect {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4);
    }

    50% {
        box-shadow: 0 0 0 15px rgba(40, 167, 69, 0);
    }
}

@keyframes pulseIncorrect {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4);
    }

    50% {
        box-shadow: 0 0 0 15px rgba(231, 76, 60, 0);
    }
}

.explanation {
    background: linear-gradient(135deg, var(--light-bg) 0%, #e9ecef 100%);
    border-radius: var(--border-radius-xl);
    padding: 25px;
    margin-top: 30px;
    border-right: 5px solid var(--primary-color);
    animation: slideIn 0.6s ease;
    position: relative;
}

.explanation::before {
    content: '💡';
    position: absolute;
    left: 20px;
    top: 25px;
    font-size: 1.5rem;
}

.correct-answer {
    color: #28a745;
    font-weight: bold;
    margin-bottom: 20px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 30px;
}

.correct-answer::before {
    content: "✓";
    font-size: 1.4rem;
    background: #28a745;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.explanation-text {
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 1.1rem;
    text-align: right;
    padding-right: 30px;
}

.buttons {
    display: flex;
    gap: 20px;
    margin-top: 40px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn,
.submit-btn,
.next-btn,
.reset-btn,
.home-btn,
.primary-btn,
.secondary-btn {
    padding: 16px 35px;
    border: none;
    border-radius: var(--border-radius-xl);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 200px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.btn:hover,
.submit-btn:hover,
.next-btn:hover,
.reset-btn:hover,
.home-btn:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow);
}

.submit-btn {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
}

.next-btn {
    background: linear-gradient(135deg, var(--warning-color) 0%, #e0a800 100%);
    color: #212529;
}

.next-btn::after {
    content: '➡️';
}

.reset-btn {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.reset-btn::after {
    content: '🔄';
}

.home-btn {
    background: linear-gradient(135deg, var(--info-color) 0%, #138496 100%);
    color: white;
}

.home-btn::after {
    content: '🏠';
}

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

.secondary-btn {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

#quiz-timer {
    position: fixed;
    top: 25px;
    left: 25px;
    background: linear-gradient(135deg, #2c3e50 0%, var(--primary-color) 100%);
    color: white;
    padding: 15px 25px;
    border-radius: var(--border-radius-xl);
    font-family: 'Courier New', monospace;
    font-size: 1.3rem;
    font-weight: bold;
    z-index: 1000;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

#quiz-timer.warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #e0a800 100%);
    color: #212529;
    animation: pulseWarning 1s infinite;
}

#quiz-timer.danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c82333 100%);
    animation: pulseDanger 0.5s infinite;
}

@keyframes pulseWarning {

    0%,
    100% {
        box-shadow: 0 6px 20px rgba(255, 193, 7, 0.25);
    }

    50% {
        box-shadow: 0 6px 25px rgba(255, 193, 7, 0.4);
    }
}

@keyframes pulseDanger {

    0%,
    100% {
        box-shadow: 0 6px 20px rgba(220, 53, 69, 0.25);
    }

    50% {
        box-shadow: 0 6px 25px rgba(220, 53, 69, 0.4);
    }
}

#quiz-timer::before {
    content: "⏱️";
    font-size: 1.5rem;
}

.alert {
    padding: 20px 25px;
    border-radius: var(--border-radius-xl);
    margin-bottom: 25px;
    animation: slideDown 0.4s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 3px;
    animation: progressBar 3s linear forwards;
}

.alert-success::before {
    background: #28a745;
}

.alert-warning::before {
    background: var(--warning-color);
}

.alert-danger::before {
    background: var(--danger-color);
}

@keyframes progressBar {
    from {
        width: 100%;
    }

    to {
        width: 0;
    }
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 2px solid #28a745;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 2px solid var(--warning-color);
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 2px solid var(--danger-color);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0 12px;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.3s;
    margin-right: -10px;
}

.close-btn:hover {
    opacity: 1;
}

.result-container {
    background: white;
    border-radius: var(--border-radius-xl);
    padding: 50px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 700px;
    margin: 60px auto;
    animation: fadeIn 0.6s ease;
    position: relative;
    overflow: hidden;
}

.result-container::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), transparent);
    border-radius: 50%;
}

.result-icon {
    font-size: 5rem;
    margin-bottom: 25px;
    display: block;
    animation: bounceIn 1s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.result-title {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 25px;
    font-weight: 800;
}

.result-subject {
    color: #666;
    font-size: 1.3rem;
    margin-bottom: 40px;
    padding: 10px 20px;
    background: var(--light-bg);
    border-radius: 50px;
    display: inline-block;
}

.score-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    margin: 0 auto 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--info-gradient);
    color: white;
    font-weight: bold;
    box-shadow: 0 12px 30px rgba(79, 172, 254, 0.3);
    position: relative;
    animation: rotateIn 1s ease;
}

@keyframes rotateIn {
    from {
        transform: rotate(-180deg) scale(0);
        opacity: 0;
    }

    to {
        transform: rotate(0) scale(1);
        opacity: 1;
    }
}

.score-circle::before {
    content: '';
    position: absolute;
    top: -10px;
    right: -10px;
    bottom: -10px;
    left: -10px;
    border-radius: 50%;
    border: 5px solid transparent;
    border-top-color: #4facfe;
    border-right-color: #00f2fe;
    animation: spin 2s linear infinite;
}

.score-number {
    font-size: 3rem;
    font-weight: 900;
    z-index: 1;
}

.score-percentage {
    font-size: 1.4rem;
    opacity: 0.95;
    z-index: 1;
}

.score-details {
    background: var(--light-bg);
    border-radius: var(--border-radius-xl);
    padding: 30px;
    margin: 30px 0;
    text-align: right;
}

.score-row {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 2px dashed var(--border-color);
    font-size: 1.1rem;
}

.score-row:last-child {
    border-bottom: none;
}

.score-row strong {
    color: var(--primary-color);
}

.network .header,
.course-network .course-header {
    background: var(--primary-gradient);
}

.vision .header,
.course-vision .course-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.algorithms .header,
.course-algorithms .course-header {
    background: var(--info-gradient);
}

.micro .header,
.course-micro .course-header {
    background: var(--success-gradient);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a2e;
        color: #e9ecef;
    }

    .login-container,
    .register-container,
    .logout-container {
        background: #2d2d44;
        border-color: rgba(255, 255, 255, 0.1);
    }

    .app-title,
    .logout-title {
        color: #e9ecef;
    }

    .app-subtitle,
    .logout-message {
        color: #bdc3c7;
    }

    .form-input,
    .form-select {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        color: #e9ecef;
    }

    .form-input:focus,
    .form-select:focus {
        background: rgba(255, 255, 255, 0.15);
        border-color: var(--secondary-color);
    }

    .form-input::placeholder {
        color: rgba(255, 255, 255, 0.5);
    }

    .input-icon {
        color: rgba(255, 255, 255, 0.5);
    }

    .error-message {
        background: rgba(231, 76, 60, 0.2);
        border-color: rgba(231, 76, 60, 0.3);
    }

    .stat-card,
    .course-card,
    .activity-list,
    .question-container,
    .result-container {
        background: #2d2d44;
        color: #e9ecef;
    }

    .course-body,
    .activity-content,
    .stat-number,
    .question-text,
    .form-label,
    .section-title {
        color: #e9ecef;
    }

    .section-title {
        border-color: #4a4a6e;
    }

    .stat-label,
    .activity-time {
        color: #a0a0c0;
    }

    .btn-details,
    .btn-home {
        background: #3d3d5c;
        border-color: #4a4a6e;
        color: #b3b3ff;
    }

    .btn-details:hover,
    .btn-home:hover {
        background: #4a4a6e;
    }

    .activity-item:hover {
        background: #3d3d5c;
    }

    .activity-item {
        border-color: #3d3d5c;
    }

    .mobile-footer {
        background: #2d2d44;
        border-color: #3d3d5c;
        color: #a0a0c0;
    }

    .subject-info {
        background: #3d3d5c;
        color: #e9ecef;
    }

    .score-display {
        background: #4a4a3c;
        color: #ffeaa7;
    }

    .explanation {
        background: #3d3d5c;
    }

    .option {
        background: #3d3d5c;
        border-color: #4a4a6e;
    }

    .option:hover {
        background: #4a4a6e;
    }

    .countdown {
        color: #a0a0c0;
        border-color: #4a4a6e;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-nav {
        display: block;
    }

    .desktop-nav {
        display: none;
    }

    .main-container {
        padding: 20px 15px 80px;
    }

    .courses-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 15px;
    }

    .user-greeting {
        padding: 20px;
    }

    .greeting-text h1 {
        font-size: 22px;
    }

    .course-actions {
        flex-direction: column;
    }

    .header {
        padding: 30px 20px;
        margin-bottom: 30px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .question-container {
        padding: 25px;
    }

    .question-text {
        font-size: 1.2rem;
    }

    .buttons {
        flex-direction: column;
        gap: 15px;
    }

    .btn,
    .submit-btn,
    .next-btn,
    .reset-btn,
    .home-btn {
        width: 100%;
        min-width: auto;
    }

    #quiz-timer {
        position: relative;
        top: auto;
        left: auto;
        margin: 0 auto 20px;
        width: fit-content;
    }

    .form-group {
        min-width: 100%;
    }

    .form-row {
        flex-direction: column;
        gap: 10px;
    }

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

    .logout-icon {
        width: 80px;
        height: 80px;
        font-size: 40px;
    }

    .logout-title {
        font-size: 24px;
    }
}

@media (min-width: 769px) {
    .mobile-nav {
        display: none;
    }

    .desktop-nav {
        display: block;
    }

    .main-container {
        padding: 30px 25px 30px;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .main-container {
        padding: 40px;
    }

    .courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .courses-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 576px) {

    .login-container,
    .register-container {
        padding: 25px 20px;
    }

    .logo-icon {
        width: 70px;
        height: 70px;
        font-size: 32px;
    }

    .app-title {
        font-size: 24px;
    }

    .form-input {
        padding: 14px 45px 14px 14px;
        font-size: 15px;
    }

    .login-button,
    .register-button {
        padding: 14px;
        font-size: 15px;
    }

    .header h1 {
        font-size: 1.7rem;
    }

    .subject-info,
    .score-display {
        font-size: 1rem;
        padding: 15px;
    }

    .option {
        padding: 15px 20px;
        font-size: 1rem;
    }

    .result-container {
        padding: 30px 20px;
        margin: 40px auto;
    }

    .score-circle {
        width: 150px;
        height: 150px;
    }

    .score-number {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .logout-container {
        padding: 30px 20px;
    }
}

@media (max-width: 360px) {

    .login-container,
    .register-container {
        padding: 20px 15px;
    }

    .app-title {
        font-size: 22px;
    }

    .form-input {
        padding: 12px 40px 12px 12px;
    }
}

/* حالة الإعاقة */
.option input:disabled {
    cursor: not-allowed;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
}

/* Print Styles */
@media print {

    .navbar,
    .sidebar,
    .footer,
    .btn,
    .mobile-nav {
        display: none !important;
    }

    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }

    .main-container {
        padding: 20px !important;
    }
}

/* أنيميشن للتحميل */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-header,
.stats-grid,
.courses-grid,
.activity-list {
    animation: fadeIn 0.5s ease-out;
}

.dashboard-header {
    animation-delay: 0.1s;
}

.stats-grid {
    animation-delay: 0.2s;
}

.courses-grid {
    animation-delay: 0.3s;
}

.activity-list {
    animation-delay: 0.4s;
}