﻿/* ==========================================================================
   XPIP - Modern Dark Fintech Styling Architecture (Pure CSS3)
   ========================================================================== */

/* Import Google Fonts (Cairo & Tajawal) with System Fallback */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Tajawal:wght@400;500;700;900&display=swap');

:root {
    /* Color Palette */
    --bg-primary: #080B12;
    --bg-secondary: #111827;
    --bg-card: #1E293B;
    --bg-card-hover: #283548;
    --bg-input: #0F172A;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(124, 58, 237, 0.3);

    /* Brand Colors */
    --primary: #7C3AED;
    --primary-hover: #6D28D9;
    --primary-light: rgba(124, 58, 237, 0.15);
    
    --accent: #22C55E;
    --accent-hover: #16A34A;
    --accent-light: rgba(34, 197, 94, 0.15);

    --danger: #EF4444;
    --danger-light: rgba(239, 68, 68, 0.15);
    --warning: #F59E0B;

    /* Text Colors */
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;

    /* Shadows & Effects */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(124, 58, 237, 0.25);
    --glass-bg: rgba(17, 24, 39, 0.75);
    --glass-border: rgba(255, 255, 255, 0.06);

    /* Spacing & Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --font-main: 'Cairo', 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: all 0.25s ease-in-out;
}

/* Light Theme Variables Toggle */
[data-theme="light"] {
    --bg-primary: #F8FAFC;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F1F5F9;
    --bg-input: #F1F5F9;
    --border-color: #E2E8F0;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* Reset & Global Elements */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    scroll-behavior: smooth;
    direction: rtl;
    text-align: right;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.6;
}

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

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

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

h1 { font-size: 2.75rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

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

.text-gradient {
    background: linear-gradient(135deg, #A78BFA 0%, #7C3AED 50%, #22C55E 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    padding: 16px 0;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 10px 0;
    box-shadow: var(--shadow-md);
}

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

/* Brand Logo */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.logo-icon-svg, .brand-logo img {
    height: 44px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    border-radius: 6px;
    transition: var(--transition);
}

.brand-name {
    color: var(--text-primary);
}

.brand-name span {
    color: var(--accent);
}

/* Nav Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 6px 4px;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }
.btn-block { width: 100%; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.45);
}

.btn-outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50px;
    text-transform: uppercase;
}

.badge-vip { background: rgba(124, 58, 237, 0.18); color: #A78BFA; border: 1px solid rgba(124, 58, 237, 0.4); }
.badge-free { background: rgba(34, 197, 94, 0.18); color: #4ADE80; border: 1px solid rgba(34, 197, 94, 0.4); }
.badge-active { background: rgba(34, 197, 94, 0.15); color: var(--accent); }
.badge-closed { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* Card Components */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card:hover {
    border-color: var(--border-accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* Hero Section */
.hero-section {
    padding: 150px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.hero-content h1 {
    margin-bottom: 16px;
    font-size: 3.2rem;
}

.hero-content p {
    font-size: 1.15rem;
    margin-bottom: 32px;
    max-width: 540px;
}

.hero-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Hero Chart Box */
.hero-chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 20px;
    box-shadow: var(--shadow-lg);
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.symbol-tabs {
    display: flex;
    gap: 8px;
}

.hero-symbol-tab {
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.hero-symbol-tab.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.live-price-box {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 1.2rem;
}

.price-up { color: var(--accent); }
.price-down { color: var(--danger); }

.canvas-wrap {
    width: 100%;
    height: 260px;
    position: relative;
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Stats Section */
.stats-section {
    padding: 40px 0;
    background: var(--bg-secondary);
    border-y: 1px solid var(--border-color);
}

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

.stat-box {
    text-align: center;
    padding: 20px;
}

.counter-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-primary);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* Section Title */
.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.section-header p {
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Grid Layouts */
.products-grid, .courses-grid, .books-grid, .signals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* Modal Styling */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-backdrop.active {
    opacity: 1;
}

.modal-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 550px;
    position: relative;
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: 16px;
    left: 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
    min-width: 300px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .col {
    flex: 1;
}

/* Dropdown User Menu */
.user-dropdown {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 50px;
    cursor: pointer;
    color: var(--text-primary);
}

.user-avatar-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
}

.dropdown-menu {
    position: absolute;
    top: 110%;
    left: 0;
    width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 8px 0;
    display: none;
    z-index: 1050;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-header {
    padding: 10px 16px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    width: 100%;
    background: transparent;
    border: none;
    text-align: right;
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 6px 0;
}

/* Footer */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 30px;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col p {
    margin-top: 16px;
    font-size: 0.95rem;
}

.footer-col h4 {
    margin-bottom: 20px;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: var(--text-secondary);
}

.footer-col ul li a:hover {
    color: var(--primary);
}

.disclaimer-box {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 30px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
}
