/* =========================================
   RESET & BASE STYLES
   ========================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Tajawal', sans-serif;
    background: #0f172a;
    color: #cbd5e1;
    min-height: 100vh;
}

/* =========================================
   CUSTOM PROPERTIES (CSS VARIABLES)
   ========================================= */

:root {
    /* Colors */
    --primary-color: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #1d4ed8;
    
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    
    /* Backgrounds */
    --dark-bg: rgba(30, 41, 59, 0.85);
    --darker-bg: rgba(15, 23, 42, 0.95);
    --card-bg: rgba(30, 41, 59, 0.8);
    
    /* Borders */
    --border-color: rgba(59, 130, 246, 0.2);
    --border-light: rgba(59, 130, 246, 0.15);
    
    /* Text */
    --text-primary: #93c5fd;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-light: #e2e8f0;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #3b82f6, #8b5cf6);
    --gradient-success: linear-gradient(135deg, #10b981, #3b82f6);
    --gradient-danger: linear-gradient(135deg, #ef4444, #dc2626);
    --gradient-warning: linear-gradient(135deg, #f59e0b, #3b82f6);
    
    /* Shadows */
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.3);
    --shadow-primary: 0 10px 25px rgba(59, 130, 246, 0.3);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Borders */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 15px;
    --radius-xl: 20px;
    --radius-full: 9999px;
}

/* =========================================
   FONT FACE DECLARATIONS
   ========================================= */

@font-face {
    font-family: 'Font Awesome 6 Free';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../vendor/fontawesome/webfonts/fa-regular-400.woff2') format('woff2');
}

@font-face {
    font-family: 'Font Awesome 6 Free';
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url('../vendor/fontawesome/webfonts/fa-solid-900.woff2') format('woff2');
}

@font-face {
    font-family: 'Font Awesome 6 Brands';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../vendor/fontawesome/webfonts/fa-brands-400.woff2') format('woff2');
}

@font-face {
    font-family: 'Tajawal';
    src: url('../fonts/tajawal/Tajawal-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Tajawal';
    src: url('../fonts/tajawal/Tajawal-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* =========================================
   UTILITY CLASSES
   ========================================= */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-30 {
    margin-bottom: 30px;
}

.mb-40 {
    margin-bottom: 40px;
}

/* =========================================
   COMMON COMPONENTS
   ========================================= */

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: var(--shadow-xl);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 25px;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-normal);
    border: none;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
}

.btn:hover:not(:disabled) {
    transform: translateY(-3px);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-lg {
    padding: 16px 35px;
    font-size: 1.1rem;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 14px 15px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: white;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.95rem;
    transition: all var(--transition-normal);
}

.form-control:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: rgba(15, 23, 42, 0.8);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-light);
    font-size: 1rem;
}

.password-toggle {
    position: absolute;
    left: 45px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    z-index: 2;
    padding: 0;
    margin: 0;
    line-height: 1;
}

.password-toggle:hover {
    color: var(--primary-light);
}

/* =========================================
   AUTHENTICATION PAGES
   ========================================= */

/* Common Auth Wrapper */
.auth-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, 
                rgba(15, 23, 42, 0.95) 0%, 
                rgba(30, 41, 59, 0.9) 100%);
}

/* Auth Card */
.auth-card {
    width: 100%;
    max-width: 450px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-xl);
    animation: fadeIn 0.6s ease;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-icon {
    width: 70px;
    height: 70px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.auth-icon i {
    font-size: 1.8rem;
    color: white;
}

.auth-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #60a5fa, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 10px;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Login Page Specific */
.login-card .logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.login-card .logo-text {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #60a5fa, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.login-card .logo-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: -5px;
}

.login-card .login-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 15px;
}

.login-card .login-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 60px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* Remember me & Forgot password */
.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.remember-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.forgot-password {
    color: var(--primary-light);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Register link */
.register-link {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 20px;
}

.register-link a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    margin-right: 5px;
    transition: color 0.2s ease;
}

.register-link a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* =========================================
   NOTIFICATIONS
   ========================================= */

.notification {
    padding: 15px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: none;
    animation: slideIn 0.3s ease;
    align-items: flex-start;
    gap: 10px;
    background: var(--darker-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.notification.show {
    display: flex;
}

.notification.success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.notification.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.notification i {
    font-size: 1.2rem;
    margin-top: 2px;
}

.notification-content h4 {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.notification-content p {
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.5;
}

.notification-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    margin-right: auto;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.notification-close:hover {
    opacity: 1;
}

/* =========================================
   ANIMATIONS
   ========================================= */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .auth-card {
        padding: 30px;
        max-width: 400px;
    }
    
    .login-card .login-title {
        font-size: 1.4rem;
    }
    
    .auth-title {
        font-size: 1.8rem;
    }
    
    .auth-icon {
        width: 60px;
        height: 60px;
    }
    
    .auth-icon i {
        font-size: 1.5rem;
    }
    
    .remember-forgot {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 25px 20px;
    }
    
    .auth-title {
        font-size: 1.6rem;
    }
    
    .login-card .logo-text {
        font-size: 1.8rem;
    }
    
    .login-card .login-title {
        font-size: 1.3rem;
    }
    
    .btn-lg {
        padding: 14px 25px;
        font-size: 1rem;
    }
}

/* =========================================
   IMPORTANT FIXES FOR AUTH PAGES
   ========================================= */

/* Hide header and footer on auth pages */
.auth-page header,
.auth-page footer {
    display: none !important;
}

/* Ensure icons display properly */
.fas, .fa-solid, i.fas, i.fa-solid {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

.far, .fa-regular, i.far, i.fa-regular {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 400 !important;
}

.fab, .fa-brands, i.fab, i.fa-brands {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400 !important;
}

/* Fix for RTL */
[dir="rtl"] .input-icon,
[dir="rtl"] .password-toggle {
    right: 15px;
    left: auto;
}

[dir="rtl"] .password-toggle {
    right: 45px;
}

/* Ensure form inputs are visible */
input[type="text"],
input[type="email"],
input[type="password"] {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid var(--border-color) !important;
    color: white !important;
}

/* Fix for placeholders */
::placeholder {
    color: var(--text-muted) !important;
    opacity: 0.8 !important;
}

/* Loading state */
.btn-loading {
    position: relative;
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px 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);
    }
}

/* Form validation states */
.form-control.error {
    border-color: var(--danger-color) !important;
    background: rgba(239, 68, 68, 0.05) !important;
}

.form-control.success {
    border-color: var(--success-color) !important;
    background: rgba(34, 197, 94, 0.05) !important;
}

.error-message {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}