@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&family=Tajawal:wght@400;500;700&display=swap');

:root {
    --navy: #0B1730;
    --blue: #3A8DFF;
    --blue-dark: #2563EB;
    --yellow: #F6C445;
    --light: #F7F9FC;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --white: #FFFFFF;
    --border: #E2E8F0;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    touch-action: manipulation; /* Disable double-tap zoom */
}

body {
    font-family: 'Tajawal', 'Cairo', sans-serif;
    background-color: var(--light);
    color: var(--text-main);
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px; /* Reduced padding */
    border-radius: 50px; /* More rounded/modern, less bulky */
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background-color: var(--blue-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--navy);
    color: var(--white);
}

.btn-outline {
    border: 2px solid var(--blue);
    color: var(--blue);
    background: transparent;
}

.btn-outline:hover {
    background-color: var(--blue);
    color: var(--white);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

/* Header */
header {
    background-color: var(--navy);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

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

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo span { color: var(--yellow); }

.nav-links {
    display: none; /* Hidden on mobile */
    gap: 30px;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    position: relative;
}

.nav-links a:hover {
    color: var(--yellow);
}

.auth-buttons {
    display: flex;
    gap: 15px;
}

@media (min-width: 768px) {
    .nav-links { display: flex; }
}

/* Hero Section */
.hero {
    background-color: var(--navy);
    color: var(--white);
    padding: 80px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero .container {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 40px;
}

.hero-content {
    text-align: center;
    z-index: 2;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    line-height: 1.3;
    font-weight: 800;
}

.hero-content p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-image {
    width: 100%;
    max-width: 600px;
    position: relative;
    z-index: 1;
}

.hero-image img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.3));
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

@media (min-width: 992px) {
    .hero .container {
        flex-direction: row;
        text-align: right;
        justify-content: space-between;
    }

    .hero-content {
        text-align: right;
        flex: 1;
        max-width: 50%;
    }

    .hero-content p {
        margin-right: 0;
        margin-left: 0;
    }

    .hero-image {
        flex: 1;
        max-width: 45%;
    }
    
    .hero-content h1 {
        font-size: 3.5rem;
    }
}

/* Features Strip */
.features-strip {
    background-color: var(--blue-dark);
    color: var(--white);
    padding: 30px 0;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
}

/* Sections General */
.section {
    padding: 80px 0;
    background-color: var(--white);
}

.section:nth-child(even) {
    background-color: var(--light);
}

/* Split Section (Text + Image) */
.split-section .container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    align-items: center;
}

.split-content {
    flex: 1;
}

.split-image {
    flex: 1;
    width: 100%;
}

.split-image img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.feature-list {
    margin-top: 30px;
    display: grid;
    gap: 15px;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--navy);
}

.feature-list li::before {
    content: '\2713'; /* Checkmark */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--blue);
    color: white;
    border-radius: 50%;
    font-size: 0.8rem;
    flex-shrink: 0;
}

@media (min-width: 992px) {
    .split-section .container {
        flex-direction: row;
        align-items: center;
    }
    
    .split-image {
        order: 2; /* Image on right */
    }
    
    .split-content {
        order: 1; /* Text on left (visually right in RTL) */
    }
}

/* Steps Box */
.steps-box {
    background: var(--navy);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    color: var(--white);
}

.steps-container {
    display: grid;
    gap: 30px;
    margin-top: 40px;
}

.step-item {
    background: rgba(255,255,255,0.05);
    padding: 30px;
    border-radius: var(--radius-md);
    transition: 0.3s;
    border: 1px solid rgba(255,255,255,0.1);
}

.step-item:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.1);
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--yellow);
    color: var(--navy);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 auto 20px;
}

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

/* Pricing Grid */
.pricing-grid {
    display: grid;
    gap: 30px;
    margin-top: 40px;
}

.price-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
    position: relative;
    border: 1px solid var(--border);
}

.price-card.featured {
    border: 2px solid var(--blue);
    transform: scale(1.05);
    z-index: 2;
}

.badge {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--blue);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
}

.price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--navy);
    margin: 20px 0;
}

.price span {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.price-features {
    text-align: right;
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.price-features li {
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-features li::before {
    content: '\2022';
    color: var(--blue);
    font-size: 1.5rem;
    line-height: 0;
}

@media (min-width: 768px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 900px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Footer */
footer {
    background: #020617; /* Very Dark Navy */
    color: var(--white);
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    gap: 40px;
}

.footer-col h3 {
    color: var(--yellow);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.footer-col a {
    display: block;
    color: rgba(255,255,255,0.7);
    margin-bottom: 10px;
}

.footer-col a:hover {
    color: var(--white);
}

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

/* =========================================
   HOME PAGE DARK THEME OVERRIDE
   Base Colors: BG #0B1730 | Text #F6C445
   ========================================= */
body.home-page {
    background-color: #0B1730 !important;
    color: #F6C445 !important;
}

/* Override all sections */
.home-page .section,
.home-page .section:nth-child(even),
.home-page .features-strip,
.home-page header, 
.home-page footer,
.home-page .hero {
    background-color: #0B1730 !important;
    color: #F6C445 !important;
}

/* Override Text Elements */
.home-page h1, 
.home-page h2, 
.home-page h3, 
.home-page h4, 
.home-page h5, 
.home-page h6, 
.home-page p, 
.home-page span, 
.home-page li, 
.home-page a:not(.btn) {
    color: #F6C445 !important;
}

/* Specific component overrides */
.home-page .price-card {
    background-color: #0B1730 !important;
    border: 1px solid #F6C445 !important;
    box-shadow: 0 0 15px rgba(246, 196, 69, 0.1);
}

.home-page .price-card.featured {
    background-color: #0B1730 !important;
    border: 2px solid #F6C445 !important;
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(246, 196, 69, 0.2);
}

.home-page .badge {
    background-color: #F6C445 !important;
    color: #0B1730 !important;
}

.home-page .price, 
.home-page .price span,
.home-page .price-features li {
    color: #F6C445 !important;
}

/* Buttons */
.home-page .btn-primary {
    background-color: #F6C445 !important;
    color: #0B1730 !important;
    font-weight: 800;
}

.home-page .btn-primary:hover {
    background-color: #e0b13d !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(246, 196, 69, 0.3);
}

.home-page .btn-outline {
    border-color: #F6C445 !important;
    color: #F6C445 !important;
}

.home-page .btn-outline:hover {
    background-color: #F6C445 !important;
    color: #0B1730 !important;
}

/* Feature List Checkmarks */
.home-page .feature-list li::before {
    background-color: #F6C445 !important;
    color: #0B1730 !important;
    content: '\2713';
}

/* Steps Box */
.home-page .steps-box, 
.home-page .step-item {
    background-color: #0B1730 !important;
    border: 1px solid rgba(246, 196, 69, 0.3);
}

.home-page .step-number {
    background-color: #F6C445 !important;
    color: #0B1730 !important;
}

/* Footer links */
.home-page footer a:hover {
    color: #fff !important;
    text-decoration: underline;
}

/* Logo */
.home-page .logo {
    color: #F6C445 !important;
}
.home-page .logo span {
    color: #fff !important;
}

/* =========================================
   RESPONSIVE ADJUSTMENTS
   ========================================= */

@media (max-width: 768px) {
    /* Navbar Mobile Fixes */
    .logo {
        font-size: 1.2rem; /* Reduce logo size */
        gap: 5px;
    }
    
    .btn {
        padding: 6px 12px; /* Reduce button padding */
        font-size: 0.8rem; /* Reduce font size */
        white-space: nowrap; /* Prevent text wrapping */
    }
    
    .auth-buttons {
        gap: 8px; /* Reduce gap between buttons */
    }
    
    header .container {
        padding: 0 15px; /* Adjust padding for small screens */
    }
    
    /* General Section Padding */
    .section {
        padding: 40px 0;
    }
    
    /* Hero Section Mobile */
    .hero {
        padding: 40px 0 60px;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .hero-image img {
        width: 80%; /* Don't take full width on mobile if too tall */
        margin: 0 auto;
        display: block;
    }
    
    /* Steps Box Mobile */
    .steps-box {
        padding: 20px;
    }
    
    /* Pricing Card Mobile */
    .price-card {
        padding: 25px 20px;
    }
    
    .price-card.featured {
        transform: none; /* Disable scaling on mobile */
    }
}

@media (max-width: 480px) {
    /* Extra small screens adjustments */
    .logo {
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
    
    .auth-buttons {
        gap: 5px;
    }
}

/* =========================================
   AUTH PAGES (Login & Signup)
   ========================================= */
body.auth-page {
    background-color: #0B1730;
    color: #F6C445;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0;
}

.auth-container {
    background-color: #162a52; /* Lighter Navy for Card */
    width: 100%;
    max-width: 450px;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    border: 1px solid rgba(246, 196, 69, 0.2); /* Subtle Gold Border */
}

.auth-container h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #F6C445;
}

.auth-container p {
    color: rgba(255,255,255,0.7);
    margin-bottom: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #F6C445;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border-radius: 12px;
    border: 2px solid #2d3748;
    background-color: #0B1730;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #F6C445;
    box-shadow: 0 0 0 4px rgba(246, 196, 69, 0.1);
}

.auth-page .btn-primary {
    background-color: #F6C445;
    color: #0B1730;
    font-weight: 800;
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    border-radius: 12px; /* Matching input radius */
    margin-top: 10px;
}

.auth-page .btn-primary:hover {
    background-color: #e0b13d;
    transform: translateY(-2px);
}

.auth-page a {
    color: #F6C445;
    text-decoration: none;
    transition: 0.3s;
}

.auth-page a:hover {
    text-decoration: underline;
    color: #fff;
}

/* Validation Box Styles (Ported from Signup) */
.validation-box {
    background: #0B1730;
    border: 1px solid #2d3748;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.validation-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #94a3b8; /* Light gray for dark theme */
    transition: all 0.3s ease;
}

.validation-item i {
    font-size: 1.2rem;
}

.validation-item.valid {
    color: #4ade80; /* Green */
}

.validation-item.valid i {
    color: #4ade80;
}

.validation-item.invalid {
    color: #ef4444; /* Red */
}

.validation-item.invalid i {
    color: #ef4444;
}

.url-preview {
    direction: ltr;
    background: #0B1730;
    border: 1px solid #2d3748;
    color: #94a3b8;
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    font-family: 'Courier New', monospace;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.url-preview.valid {
    background: rgba(22, 163, 74, 0.1);
    border-color: #16a34a;
    color: #4ade80;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* =========================================
   DASHBOARD THEME (LIGHT)
   ========================================= */
body.dashboard-page {
    background-color: #f8fafc;
    color: #0F172A;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.dashboard-page .sidebar {
    width: 250px;
    background-color: #0B1730; /* Keep sidebar navy */
    color: #fff;
    flex-shrink: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.dashboard-page .sidebar .logo {
    color: #fff;
    margin-bottom: 40px;
    justify-content: center;
    font-weight: 800;
}

.dashboard-page .sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: rgba(255,255,255,0.7);
    border-radius: var(--radius-sm);
    margin-bottom: 5px;
    transition: 0.3s;
    gap: 10px;
}

.dashboard-page .sidebar-nav a:hover, 
.dashboard-page .sidebar-nav a.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.dashboard-page .main-content {
    flex: 1;
    background-color: #f8fafc;
    padding: 30px;
    overflow-y: auto;
}

.dashboard-page .top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 20px;
}

.dashboard-page h2, 
.dashboard-page h3 {
    color: #0F172A;
}

.dashboard-card {
    background: #fff;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    color: #0F172A;
}

.dashboard-page .stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid #e2e8f0;
}

.dashboard-page .stat-card h3 {
    font-size: 0.9rem;
    color: #64748B;
    margin-bottom: 10px;
}

.dashboard-page .stat-card .value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #0B1730;
}

.dashboard-page .form-control {
    background-color: #fff;
    border-color: #cbd5e1;
    color: #0F172A;
}

.dashboard-page .form-control:read-only {
    background-color: #f1f5f9;
    color: #475569;
}

/* Dashboard Responsive */
@media (max-width: 768px) {
    .dashboard-page .sidebar {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 280px;
        z-index: 1000;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -5px 0 25px rgba(0,0,0,0.15);
        background-color: #0B1730; 
    }
    
    .dashboard-page .sidebar.active {
        transform: translateX(0);
    }
    
    .dashboard-page .main-content {
        padding: 15px;
        width: 100%;
    }
    
    .dashboard-page .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: 0.3s;
        backdrop-filter: blur(2px);
    }
    
    .dashboard-page .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .dashboard-page .mobile-toggle-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 8px;
        background: #fff;
        box-shadow: var(--shadow-sm);
        cursor: pointer;
        border: 1px solid #e2e8f0;
        color: #0B1730;
        font-size: 1.5rem;
    }
}

/* Color Picker Settings Styles (New) */
.settings-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.color-picker-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    position: relative;
}

.color-picker-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    border-color: #cbd5e1;
}

.color-preview-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    cursor: pointer;
}

.color-input-hidden {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.color-preview {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    border: 3px solid #f1f5f9;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.2s;
}

.color-info {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.color-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.color-value-input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    color: #475569;
    background: #f8fafc;
    font-family: 'Monaco', 'Consolas', monospace;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.2s;
}

.color-value-input:focus {
    background: white;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
    color: var(--blue);
}

@media (max-width: 768px) {
    .settings-color-grid { grid-template-columns: 1fr; }
    .color-picker-item { padding: 15px; }
}
