/* assets/css/style.css */
:root {
    --primary-green: #047857; /* Deep Emerald Green */
    --primary-dark: #065f46;
    --primary-light: #d1fae5;
    --accent-gold: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-body: #f9fafb;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif; /* Great for Dari/Pashto */
    background-color: var(--bg-body);
    color: var(--text-dark);
    line-height: 1.6;
}

/* --- HEADER & NAVIGATION --- */
.main-header {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}
.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-green);
    text-decoration: none;
}
.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a { text-decoration: none; color: var(--text-dark); font-weight: 500; }
.nav-links a:hover { color: var(--primary-green); }

/* Language Switcher */
.lang-switcher select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: var(--white);
    font-weight: 500;
    cursor: pointer;
}

/* --- BUTTONS --- */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}
.btn-primary { background: var(--primary-green); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-whatsapp { background: #25D366; color: var(--white); }
.btn-whatsapp:hover { background: #128C7E; }

/* --- FORMS & CARDS --- */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 30px;
    max-width: 500px;
    margin: 40px auto;
}
.card h2 { color: var(--primary-green); margin-bottom: 20px; text-align: center; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--text-dark); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: border 0.3s;
}
.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* --- DASHBOARD LAYOUT --- */
.dashboard-container { display: flex; min-height: 100vh; }
.sidebar {
    width: 250px;
    background: var(--primary-dark);
    color: var(--white);
    padding: 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}
.sidebar h3 { color: var(--primary-light); margin-bottom: 20px; }
.sidebar a {
    display: block;
    color: var(--white);
    text-decoration: none;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 5px;
}
.sidebar a:hover, .sidebar a.active { background: var(--primary-green); }

.main-content {
    flex: 1;
    margin-inline-start: 250px; /* Logical property for RTL/LTR support */
    padding: 30px;
}

/* --- WHATSAPP FLOATING BUTTON --- */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    inset-inline-end: 30px; /* Logical property */
    background: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 999;
    text-decoration: none;
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        padding: 15px;
    }
    .sidebar h3 { width: 100%; text-align: center; }
    .sidebar a { flex: 1; text-align: center; padding: 10px; }
    .main-content { margin-inline-start: 0; padding: 15px; }
    .header-container { flex-direction: column; text-align: center; }
}
/* =========================================
   AGENCY LANDING PAGE STYLES
   ========================================= */
.agency-landing { background: #f3f4f6; }
.agency-hero {
    position: relative; height: 400px; background: linear-gradient(135deg, var(--primary-dark), var(--primary-green));
    display: flex; align-items: center; justify-content: center; text-align: center; color: white; overflow: hidden;
}
.agency-hero::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: url('https://images.unsplash.com/photo-1560518883-ce09059eeffa?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
    background-size: cover; background-position: center; opacity: 0.2;
}
.agency-hero-content { position: relative; z-index: 2; padding: 20px; }
.agency-logo-large { width: 120px; height: 120px; border-radius: 50%; border: 5px solid white; object-fit: cover; background: white; margin-bottom: 20px; box-shadow: 0 10px 20px rgba(0,0,0,0.2); }
.agency-hero h1 { font-size: 2.5rem; margin-bottom: 10px; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.agency-hero p { font-size: 1.2rem; opacity: 0.9; margin-bottom: 20px; }
.agency-section { max-width: 1200px; margin: 40px auto; padding: 0 20px; }
.agency-section h2 { color: var(--primary-green); border-bottom: 3px solid var(--primary-light); display: inline-block; padding-bottom: 5px; margin-bottom: 30px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 40px; }
.stat-card { background: white; padding: 30px; border-radius: 12px; text-align: center; box-shadow: var(--shadow); }
.stat-card h3 { font-size: 2.5rem; color: var(--primary-green); margin: 0; }

/* =========================================
   CMS DASHBOARD STYLES
   ========================================= */
.cms-layout { display: flex; min-height: 100vh; background: #f9fafb; }
.cms-sidebar { width: 260px; background: var(--primary-dark); color: white; padding: 20px 0; position: fixed; height: 100vh; overflow-y: auto; transition: all 0.3s; z-index: 100; }
.cms-sidebar .logo-area { padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); text-align: center; }
.cms-sidebar .logo-area img { height: 40px; margin-bottom: 10px; }
.cms-sidebar .logo-area h3 { font-size: 1.1rem; color: var(--primary-light); margin: 0; }
.cms-menu { list-style: none; padding: 20px 0; margin: 0; }
.cms-menu li a { display: flex; align-items: center; gap: 15px; padding: 15px 25px; color: rgba(255,255,255,0.8); text-decoration: none; transition: all 0.2s; border-left: 4px solid transparent; }
.cms-menu li a:hover, .cms-menu li a.active { background: rgba(255,255,255,0.1); color: white; border-left-color: var(--accent-gold); }
.cms-menu li a .icon { font-size: 1.2rem; width: 24px; text-align: center; }
.cms-main { flex: 1; margin-inline-start: 260px; padding: 30px; }
.cms-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; background: white; padding: 20px; border-radius: 12px; box-shadow: var(--shadow); }

/* =========================================
   CHAT & NETWORK STYLES
   ========================================= */
.chat-layout { display: flex; height: calc(100vh - 150px); background: white; border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.chat-sidebar { width: 300px; border-inline-end: 1px solid #e5e7eb; display: flex; flex-direction: column; }
.chat-sidebar-header { padding: 20px; border-bottom: 1px solid #e5e7eb; background: #f9fafb; }
.chat-list { flex: 1; overflow-y: auto; }
.chat-item { display: flex; align-items: center; gap: 15px; padding: 15px 20px; cursor: pointer; transition: background 0.2s; border-bottom: 1px solid #f3f4f6; }
.chat-item:hover, .chat-item.active { background: var(--primary-light); }
.chat-item img { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; }
.chat-item-info h4 { margin: 0; font-size: 0.95rem; }
.chat-item-info p { margin: 0; font-size: 0.8rem; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.chat-main { flex: 1; display: flex; flex-direction: column; }
.chat-main-header { padding: 20px; border-bottom: 1px solid #e5e7eb; background: #f9fafb; display: flex; align-items: center; gap: 15px; }
.chat-messages { flex: 1; padding: 20px; overflow-y: auto; background: #f3f4f6; display: flex; flex-direction: column; gap: 15px; }
.msg-bubble { max-width: 70%; padding: 12px 18px; border-radius: 18px; position: relative; word-wrap: break-word; }
.msg-sent { align-self: flex-end; background: var(--primary-green); color: white; border-bottom-right-radius: 4px; }
.msg-received { align-self: flex-start; background: white; color: var(--text-dark); border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.chat-input-area { padding: 20px; border-top: 1px solid #e5e7eb; display: flex; gap: 10px; background: white; }
.chat-input-area input { flex: 1; padding: 12px 20px; border: 1px solid #d1d5db; border-radius: 30px; outline: none; }
.chat-input-area button { padding: 12px 25px; background: var(--primary-green); color: white; border: none; border-radius: 30px; cursor: pointer; font-weight: bold; }

/* Mobile Responsiveness for CMS */
@media (max-width: 768px) {
    .cms-sidebar { width: 100%; height: auto; position: relative; display: flex; flex-wrap: wrap; padding: 10px; }
    .cms-sidebar .logo-area { width: 100%; border-bottom: none; padding-bottom: 10px; }
    .cms-menu { display: flex; flex-wrap: wrap; width: 100%; padding: 0; }
    .cms-menu li { flex: 1; min-width: 50%; }
    .cms-menu li a { justify-content: center; padding: 10px; border-left: none; border-bottom: 3px solid transparent; }
    .cms-menu li a.active { border-bottom-color: var(--accent-gold); }
    .cms-main { margin-inline-start: 0; padding: 15px; }
    .chat-layout { flex-direction: column; height: auto; }
    .chat-sidebar { width: 100%; height: 300px; border-inline-end: none; border-bottom: 1px solid #e5e7eb; }
}