:root {
    --primary: #22d3ee;
    --primary-dark: #0891b2;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --bg-light: #f8fafc;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --dark: #0f172a;
    --text-muted: #64748b;
    --white: #ffffff;
}

body {
    background-color: #f8fafc; /* Fallback */
    background-color: var(--bg-light);
    color: #1e293b;
    direction: rtl;
    text-align: right;
    margin: 0;
    font-family: 'Tajawal', 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Layout */
.sidebar {
    width: 280px;
    height: 100vh;
    background-color: #0f172a; /* Fallback */
    background-color: var(--sidebar-bg);
    position: fixed;
    right: 0;
    top: 0;
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.main-wrapper {
    margin-right: 280px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Sidebar Styling */
.sidebar-header {
    padding: 0 1.5rem 2rem;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
}

.logo i {
    width: 35px;
    height: 35px;
    background: #22d3ee; /* Fallback */
    background: var(--primary);
    color: #0f172a; /* Fallback */
    color: var(--sidebar-bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.logo-subtitle {
    display: block;
    font-size: 0.75rem;
    color: #475569;
    margin-top: 4px;
}

.nav-links {
    list-style: none;
    padding: 0 1rem;
    flex-grow: 1;
}

.nav-links li {
    margin-bottom: 4px;
}

.nav-links a {
    color: var(--sidebar-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0.9rem 1.2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.nav-links a i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-links a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-links a.active {
    background: var(--primary);
    color: #0f172a;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-link {
    color: var(--sidebar-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    transition: 0.3s;
}

.sidebar-link:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Top Bar Styling */
.top-bar {
    height: 80px;
    background: white;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
}

.top-bar-right {
    display: flex;
    align-items: center;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 25px;
}

.page-title h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0;
}

.page-title p {
    color: #94a3b8;
    font-size: 0.8rem;
    margin: 0;
}

.search-box {
    position: relative;
    width: 250px;
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.search-box input {
    width: 100%;
    padding: 0.5rem 2.8rem 0.5rem 1rem;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.85rem;
}

/* Dropdowns */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
    transition: 0.3s;
}

.dropdown-toggle:hover {
    opacity: 0.8;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 250px;
    background: white;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
    margin-top: 15px;
    display: none;
    z-index: 1001;
    animation: fadeInDown 0.2s ease-out;
}

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

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
    padding: 0 1.2rem 0.8rem;
    font-weight: 800;
    color: #0f172a;
    font-size: 0.95rem;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 0.5rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1.2rem;
    color: #475569;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: right;
    cursor: pointer;
}

.dropdown-item:hover {
    background: #f8fafc;
    color: #2563eb;
}

.dropdown-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.dropdown-item div p {
    margin: 0;
    font-size: 0.85rem;
    color: #1e293b;
    line-height: 1.4;
}

.dropdown-item div span {
    font-size: 0.75rem;
    color: #94a3b8;
}

.dropdown-user-info {
    padding: 0.5rem 1.2rem 1rem;
    display: flex;
    flex-direction: column;
}

.dropdown-user-info strong {
    color: #0f172a;
    font-size: 0.95rem;
}

.dropdown-user-info span {
    color: #94a3b8;
    font-size: 0.8rem;
}

.dropdown-footer {
    display: block;
    text-align: center;
    padding: 0.8rem;
    background: #f8fafc;
    color: #2563eb;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    border-top: 1px solid #f1f5f9;
}

.logout-item {
    color: #ef4444 !important;
}

.logout-item:hover {
    background: #fef2f2 !important;
}

hr {
    border: 0;
    border-top: 1px solid #f1f5f9;
    margin: 0.5rem 0;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: 0.3s;
}

.dropdown.profile-dropdown:hover .user-profile img {
    border-color: #2563eb;
}

/* Main Content Area */
.main-content {
    padding: 2.5rem;
    flex-grow: 1;
}

/* Stats Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border: 1px solid #f1f5f9;
    position: relative;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
}

.stat-icon {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.stat-arrow {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 0.75rem;
    color: #10b981;
}

.stat-info {
    text-align: right;
}

.stat-info p {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1;
}

.stat-info h3 {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 600;
    margin-top: 5px;
    margin-bottom: 0;
}

/* Colors for stats */
.icon-blue { background: #eff6ff; color: #3b82f6; }
.icon-cyan { background: #ecfeff; color: #06b6d4; }
.icon-green { background: #f0fdf4; color: #10b981; }
.icon-orange { background: #fff7ed; color: #f59e0b; }

/* Grid for cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.5rem;
}

.card {
    background: white;
    padding: 1.5rem;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid #f1f5f9;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
}

.quick-actions button:hover, .quick-actions a.btn-action:hover {
    background-color: #f8f9fa;
    border-color: var(--primary);
}

.ai-hint {
    background: linear-gradient(135deg, var(--primary), #1dd1a1);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #dfe6e9;
}

/* Landing Page Specifics */
.landing-body {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
    min-height: 100vh;
}

.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 150px;
}

.landing-btn {
    padding: 0.7rem 1.5rem;
    border-radius: 30px;
    font-weight: bold;
    text-decoration: none;
    transition: 0.3s;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--dark);
    display: inline-block;
    text-align: center;
    border: none;
}

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

.btn-outline {
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    padding: 0.7rem 1.5rem;
    border-radius: 30px;
    display: inline-block;
}
.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.hero {
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    position: relative;
    overflow: hidden;
    min-height: 80vh;
    text-align: center;
    padding: 6rem 150px 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.floating-icons {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.float-icon {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: float 6s ease-in-out infinite;
}

.float-icon.telegram { top: 20%; left: 30%; animation-delay: 0s; }
.float-icon.whatsapp { top: 60%; left: 20%; animation-delay: 2s; }
.float-icon.bot { top: 70%; left: 40%; animation-delay: 1s; background: white; color: black; border-radius: 10px; border-bottom-right-radius: 0; }
.float-icon.main-bot { top: 40%; left: 25%; background: var(--primary); padding: 30px; border-radius: 30px; font-size: 3rem; animation: floatMain 8s ease-in-out infinite; box-shadow: 0 0 30px rgba(0, 210, 211, 0.5); }

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

@keyframes floatMain {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.05); }
}

.hero h1 {
    font-size: 3.5rem;
    max-width: 800px;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    position: relative;
    z-index: 2;
}

.hero h1 span {
    color: var(--primary);
}

.hero p {
    font-size: 1.2rem;
    color: #94a3b8;
    max-width: 600px;
    margin-bottom: 2.5rem;
}

.hero-btns {
    display: flex;
    gap: 1.5rem;
}

.pricing-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary) !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
}

.features-section {
    padding: 6rem 150px;
    background-color: #ffffff;
    color: var(--dark);
    text-align: center;
}

.features-section h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    text-align: right;
    transition: 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: rgba(0, 210, 211, 0.1);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
    color: var(--dark);
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* CTA Section */
.cta-section {
    padding: 5rem 150px;
    background-color: #f8fafc;
}

.cta-banner {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    padding: 4rem 2rem;
    border-radius: 20px;
    text-align: center;
    color: white;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.cta-banner h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-banner p {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-bottom: 2rem;
}

/* Landing Footer */
.landing-footer {
    padding: 4rem 150px 2rem;
    background-color: #ffffff;
    color: var(--dark);
    border-top: 1px solid #e2e8f0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-logo i {
    color: var(--primary);
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    color: #64748b;
    font-size: 1.5rem;
    transition: 0.3s;
}

.social-links a:hover {
    color: var(--primary);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #f1f5f9;
    color: #94a3b8;
    font-size: 0.9rem;
}

.footer-bottom a {
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
}

@media (max-width: 991px) {
    .landing-nav, .hero, .features-section, .pricing-section, .cta-section, .landing-footer {
        padding-left: 5% !important;
        padding-right: 5% !important;
    }
}

@media (max-width: 768px) {
    .landing-nav {
        flex-direction: column;
        gap: 1rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .nav-actions {
        display: flex;
        width: 100%;
        justify-content: center;
        gap: 5px;
    }

    .landing-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .hero h1 {
        font-size: 2rem;
        line-height: 1.3;
    }

    .hero p {
        font-size: 1rem;
    }

    .floating-icons {
        position: relative;
        height: auto;
        width: 100%;
        margin-top: 4rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2.5rem;
        padding-bottom: 3rem;
    }

    .float-icon {
        position: static !important;
        transform: translate(0, 0) !important;
        width: auto !important;
        min-width: 120px;
        max-width: 90%;
        margin: 0.5rem 0;
        animation: none !important;
    }

    .float-icon.bot {
        order: 1;
        width: 90% !important;
    }

    .float-icon.main-bot { 
        order: 2;
        width: 60px !important; 
        height: 60px !important; 
        font-size: 1.5rem;
    }

    .float-icon.telegram, .float-icon.whatsapp {
        order: 3;
        display: inline-flex;
        width: 150px !important;
    }

    /* Wrap telegram and whatsapp in a row on mobile */
    .floating-icons {
        flex-flow: row wrap;
        justify-content: center;
    }

    .features-grid, .pricing-grid {
        grid-template-columns: 1fr !important;
    }

    .features-section h2, .pricing-section h2 {
        font-size: 1.8rem !important;
    }

    .footer-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    .pricing-section {
        padding-top: 4rem !important;
    }
}

/* Dashboard Responsive Styles */
@media (max-width: 991px) {
    .sidebar {
        right: -280px; /* Hide off-screen to the right */
        left: auto;
        transform: none !important;
        transition: right 0.3s ease;
        box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    }

    .sidebar.active {
        right: 0 !important;
    }

    .main-wrapper {
        margin-right: 0 !important;
    }

    .top-bar {
        padding: 0 1rem;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    .menu-toggle {
        display: flex !important;
    }

    .search-box {
        display: none;
    }
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: #f1f5f9;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #0f172a;
    font-size: 1.2rem;
}

/* Modal Close Button */
.close {
    font-size: 2.2rem !important;
    font-weight: 300;
    color: #94a3b8;
    transition: 0.2s;
    line-height: 1;
    cursor: pointer;
}

.close:hover {
    color: #ef4444;
    transform: scale(1.1);
}
