/* ==========================================
   منصة صفحات الهبوط - ملف التنسيقات الرئيسي
   ========================================== */

/* المتغيرات */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --dark: #1e293b;
    --dark-bg: #0f172a;
    --light: #f8fafc;
    --border: #e2e8f0;
    --text: #334155;
    --text-light: #64748b;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* الأساسيات */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* الحاويات */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

/* الخلفية */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    z-index: 1;
}

/* صفحات المصادقة */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-box {
    background: white;
    border-radius: 24px;
    padding: 50px;
    box-shadow: var(--shadow-xl);
    max-width: 480px;
    width: 100%;
}

.auth-box h1 {
    font-size: 32px;
    font-weight: 900;
    color: var(--dark);
    margin-bottom: 10px;
    text-align: center;
}

.auth-box p {
    color: var(--text-light);
    text-align: center;
    margin-bottom: 35px;
    font-size: 15px;
}

/* النماذج */
.form-group {
    margin-bottom: 24px;
}

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

.form-group input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s;
    background: var(--light);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* الأزرار */
.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Cairo', sans-serif;
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

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

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-gradient {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
}

.btn-gradient:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

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

/* رسائل الخطأ */
.error-message {
    background: #fee;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid #fecaca;
}

.error-message.hidden {
    display: none;
}

/* الروابط */
.link-primary {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}

.link-primary:hover {
    opacity: 0.8;
    text-decoration: underline;
}

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

.mt-20 {
    margin-top: 20px;
}

/* الهيدر */
header {
    padding: 20px 0;
    position: relative;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    padding: 15px 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo {
    font-size: 28px;
    font-weight: 900;
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.user-email {
    color: white;
    font-size: 14px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 10px;
}

/* لوحة التحكم */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.dashboard-header h2 {
    font-size: 32px;
    font-weight: 900;
    color: white;
}

.pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* مؤشر التحميل */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    background: white;
    padding: 30px 50px;
    border-radius: 15px;
    font-size: 18px;
    font-weight: 600;
    box-shadow: var(--shadow-xl);
}

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    font-weight: 600;
    color: white;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

/* الاستجابة للهاتف */
@media (max-width: 768px) {
    .auth-box {
        padding: 30px 25px;
    }
    
    .auth-box h1 {
        font-size: 24px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }
    
    .pages-grid {
        grid-template-columns: 1fr;
    }
}
