/* استيراد خط 'Cairo' العصري والمميز للمواقع الحديثة */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Cairo', sans-serif;
}

body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #f8fafc;
    min-height: 100vh;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 1100px;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* ==========================================
    تنسيق الهيدر الاحترافي الفاخر
   ========================================== */
.main-app-header {
    text-align: center;
    margin-bottom: 35px;
    margin-top: 20px;
}

/* 1. شارة الـ AI الذكية علوية */
.logo-badge {
    display: inline-block;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: #38bdf8;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

/* 2. اسم التطبيق بالتدرج اللوني الانسيابي */
.app-title {
    font-size: 2.4rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

/* 3. البراندينج الفرعي الإنجليزي */
.branding-sub {
    font-size: 1.1rem;
    font-weight: 700;
    color: #38bdf8;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
    text-transform: uppercase;
    opacity: 0.95;
}

/* الوصف الفرعي */
.app-subtitle {
    color: #94a3b8;
    font-size: 1.05rem;
    margin: 0 auto;
    max-width: 500px;
    line-height: 1.5;
    font-weight: 300;
}

/* تأثير حركة النجوم التفاعلية */
.sparkle {
    display: inline-block;
    animation: sparkleFloat 2s ease-in-out infinite;
}

@keyframes sparkleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(to left, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

header p {
    color: #94a3b8;
    font-size: 16px;
    font-weight: 300;
}

/* ==========================================
    تقسيم العناصر والأزرار الأساسية للمنصة
   ========================================== */
main {
    display: flex;
    gap: 40px;
}

section {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
}

h2 {
    color: #38bdf8;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 25px;
    position: relative;
    padding-right: 15px;
}

h2::before {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 4px;
    background: #38bdf8;
    border-radius: 2px;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #cbd5e1;
}

input[type="text"], textarea, select {
    width: 100%;
    padding: 14px 16px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #f8fafc;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: left 16px center;
    cursor: pointer;
}

[dir="rtl"] select {
    background-position: left 16px center;
    padding-left: 45px;
}

input[type="text"]:focus, textarea:focus, select:focus {
    border-color: #38bdf8;
    background: #0f172a;
    outline: none;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

input[type="text"]::placeholder, textarea::placeholder {
    color: #64748b;
}

select option {
    background: #1e293b;
    color: #f8fafc;
}

button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
    margin-top: auto;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(56, 189, 248, 0.4);
    background: linear-gradient(135deg, #0ea5e9 0%, #4f46e5 100%);
}

button:active {
    transform: translateY(0);
}

.result-box {
    min-height: 320px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 20px;
    color: #e2e8f0;
    line-height: 1.8;
    font-size: 15px;
}

.placeholder-text {
    color: #64748b;
    text-align: center;
    margin-top: 130px;
    font-weight: 300;
}

#loading {
    color: #fbbf24;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hidden {
    display: none !important;
}

/* ==========================================
    تذييل الصفحة الاحترافي (Footer)
   ========================================== */
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    padding-bottom: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
    color: #64748b;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.developer-name {
    background: linear-gradient(to left, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.footer-gpg-text {
    font-size: 11px;
    color: #475569;
    font-family: monospace;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.02);
    padding: 2px 10px;
    border-radius: 4px;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    color: #4a5568;
}

.footer-links a {
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.2s ease, color 0.2s ease;
}

.footer-links a:hover {
    transform: translateY(-1px);
}

.link-github { color: #f8fafc; }
.link-linkedin { color: #3b82f6; }
.link-email { color: #10b981; }

/* التجاوب والتوافق التام مع الهواتف والتابلت */
@media (max-width: 900px) {
    main {
        flex-direction: column;
        gap: 25px;
    }
    body {
        padding: 20px 10px;
    }
    .container {
        padding: 20px;
    }
    .app-title {
        font-size: 1.8rem;
    }
    .branding-sub {
        font-size: 0.95rem;
    }
    .app-subtitle {
        font-size: 0.95rem;
    }
}

/* ==========================================
    تنسيقات الواجهة الترحيبية (Splash Screen)
   ========================================== */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0f172a;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 60px 20px;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.splash-content {
    margin-top: auto;
    text-align: center;
}

.splash-logo {
    color: #38bdf8;
    font-size: 28px;
    margin-bottom: 20px;
    animation: pulseLogo 1.5s infinite;
}

.loader {
    border: 4px solid #1e293b;
    border-top: 4px solid #38bdf8;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

.splash-footer {
    margin-top: auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.splash-footer p {
    font-size: 11px;
    color: #64748b;
    text-transform: lowercase;
    letter-spacing: 2px;
}

.developer-brand {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(to left, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gpg-key {
    font-size: 10px;
    color: #475569;
    font-family: monospace;
    letter-spacing: 1px;
    margin-top: 4px;
    background: rgba(255, 255, 255, 0.03);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulseLogo {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

/* ==========================================
    تنسيقات لوحة الميزات المتقدمة (ATS & GPG Panel)
   ========================================== */
.advanced-features-panel {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.btn-secondary {
    flex: 1;
    padding: 12px;
    background: #1e293b;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    transition: all 0.2s ease;
    margin-top: 0;
}

.btn-secondary:hover {
    background: #2d3748;
    color: #38bdf8;
    border-color: #38bdf8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
}

/* ==========================================
    تنسيقات القائمة المنسدلة والصفحة المنبثقة للاعدادات
   ========================================== */
.top-left-dropdown {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 1000;
    direction: ltr;
}

.dropdown-trigger-btn {
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.dropdown-trigger-btn:hover {
    background: #334155;
    color: #38bdf8;
    border-color: #38bdf8;
}

.dropdown-menu-content {
    position: absolute;
    top: 42px;
    left: 0;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    width: 140px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    overflow: hidden;
}

.dropdown-menu-content button {
    width: 100%;
    background: none;
    border: none;
    color: #cbd5e1;
    padding: 10px 12px;
    text-align: right;
    direction: rtl;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
    box-shadow: none;
    margin-top: 0;
}

.dropdown-menu-content button:hover {
    background: #334155;
    color: #38bdf8;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-content {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    direction: rtl;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
    color: #f8fafc;
    padding-right: 0;
}

.modal-header h2::before {
    display: none;
}

.close-modal-x {
    background: none;
    border: none;
    color: #64748b;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    width: auto;
    padding: 0;
    box-shadow: none;
    margin-top: 0;
}

.close-modal-x:hover {
    color: #ef4444;
    background: none;
}

.modal-body {
    padding: 20px;
    direction: rtl;
    text-align: right;
}

.settings-section-card {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.settings-section-card h3 {
    margin: 0 0 8px 0;
    font-size: 15px;
    color: #38bdf8;
}

.settings-section-card p {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.6;
}

.action-settings-btn {
    background: #2563eb;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
    width: auto;
    box-shadow: none;
    margin-top: 0;
}

.action-settings-btn:hover {
    background: #1d4ed8;
}

.settings-link {
    color: #38bdf8;
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
}

.settings-link:hover {
    text-decoration: underline;
}

.modal-footer a {
    transition: opacity 0.2s ease, text-decoration 0.2s ease;
}

.modal-footer a:hover {
    text-decoration: underline !important;
    opacity: 0.85;
}

/* ==========================================
    🌟 التحديث الجديد: أنماط الجولة التعريفية المتقدمة (App Tour Layout)
   ========================================== */
.tour-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000; /* أعلى من كل العناصر */
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.tour-card {
    background: #1e293b;
    border: 1px solid rgba(56, 189, 248, 0.2);
    width: 100%;
    max-width: 460px;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 15px;
    direction: rtl;
    text-align: center;
    position: relative;
    animation: scaleUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tour-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tour-step-badge {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: bold;
}

.tour-skip-link {
    background: none;
    border: none;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
    width: auto;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

.tour-skip-link:hover {
    color: #ef4444;
    background: none;
}

.tour-main-icon {
    font-size: 3.5rem;
    margin: 10px 0;
    animation: bounceEffect 2s infinite;
}

.tour-main-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.tour-main-desc {
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.6;
}

.tour-footer {
    margin-top: 10px;
}

.tour-next-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
    color: white;
    font-weight: bold;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.tour-next-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
    background: linear-gradient(135deg, #0ea5e9 0%, #1d4ed8 100%);
}

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

@keyframes scaleUp {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes bounceEffect {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
