/* ============================================
   ASDP - Shared Styles
   Arabic RTL, Brand Colors, Typography
   ============================================ */

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

:root {
    /* Alzamil Brand */
    --alzamil-blue: #1a5276;
    --alzamil-blue-light: #2980b9;
    --alzamil-blue-dark: #0d2f4a;
    --alzamil-green: #27ae60;

    /* Score Colors */
    --score-green: #2ecc71;
    --score-green-bg: #d5f5e3;
    --score-yellow: #f39c12;
    --score-yellow-bg: #fef9e7;
    --score-red: #e74c3c;
    --score-red-bg: #fdedec;
    --score-black: #2c3e50;
    --score-black-bg: #eaecee;

    /* WhatsApp Colors */
    --wa-green: #075e54;
    --wa-green-light: #25d366;
    --wa-bubble-sent: #dcf8c6;
    --wa-bubble-received: #ffffff;
    --wa-bg: #ece5dd;

    /* Neutrals */
    --bg-light: #f8f9fa;
    --bg-dark: #1a1a2e;
    --text-primary: #1a1a2e;
    --text-secondary: #6c757d;
    --text-light: #ffffff;
    --border-light: #e9ecef;

    /* Spacing */
    --nav-height: 60px;
}

/* ---- Global Reset & RTL ---- */
* {
    box-sizing: border-box;
}

html {
    direction: rtl;
}

body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-size: 16px;
    line-height: 1.6;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
}

.text-brand {
    color: var(--alzamil-blue);
}

.text-score-green { color: var(--score-green); }
.text-score-yellow { color: var(--score-yellow); }
.text-score-red { color: var(--score-red); }
.text-score-black { color: var(--score-black); }

/* ---- Navigation ---- */
.asdp-navbar {
    background: linear-gradient(135deg, var(--alzamil-blue-dark), var(--alzamil-blue));
    padding: 0 1.5rem;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.asdp-navbar .nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.2rem;
}

.asdp-navbar .nav-brand .logo-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.asdp-navbar .nav-links {
    display: flex;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.asdp-navbar .nav-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.asdp-navbar .nav-links a:hover,
.asdp-navbar .nav-links a.active {
    background: rgba(255,255,255,0.15);
    color: white;
}

/* ---- Score Badges ---- */
.score-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
}

.score-badge.green {
    background: var(--score-green-bg);
    color: #1e8449;
    border: 1px solid var(--score-green);
}

.score-badge.yellow {
    background: var(--score-yellow-bg);
    color: #b7950b;
    border: 1px solid var(--score-yellow);
}

.score-badge.red {
    background: var(--score-red-bg);
    color: #c0392b;
    border: 1px solid var(--score-red);
}

.score-badge.black {
    background: var(--score-black-bg);
    color: var(--score-black);
    border: 1px solid #95a5a6;
}

/* ---- Delivery Class Badges ---- */
.class-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
}

.class-badge.class-a { background: #d4efdf; color: #1e8449; }
.class-badge.class-b { background: #d6eaf8; color: #1a5276; }
.class-badge.class-c-1 { background: #d5f5e3; color: #0e6655; }
.class-badge.class-c-2 { background: #fdebd0; color: #b7950b; }
.class-badge.class-d { background: #fadbd8; color: #c0392b; }

/* ---- Status Badges ---- */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.loading { background: #e8f4f8; color: #2980b9; }
.status-badge.enroute { background: #d5f5e3; color: #27ae60; }
.status-badge.delivered { background: #d4efdf; color: #1e8449; }
.status-badge.delayed { background: #fdebd0; color: #e67e22; }
.status-badge.pending { background: #f2f3f4; color: #6c757d; }
.status-badge.failed { background: #fadbd8; color: #e74c3c; }

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.green { background: var(--score-green); }
.status-dot.blue { background: var(--alzamil-blue-light); }
.status-dot.yellow { background: var(--score-yellow); }
.status-dot.red { background: var(--score-red); }
.status-dot.gray { background: #bdc3c7; }

.status-dot.pulse {
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* ---- Cards ---- */
.asdp-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.asdp-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.asdp-card .card-body {
    padding: 1.5rem;
}

/* ---- Buttons ---- */
.btn-brand {
    background: linear-gradient(135deg, var(--alzamil-blue), var(--alzamil-blue-light));
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-brand:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(26,82,118,0.3);
    color: white;
}

.btn-brand:active {
    transform: translateY(0);
}

.btn-brand.btn-lg {
    padding: 16px 40px;
    font-size: 1.15rem;
    border-radius: 14px;
}

.btn-success-brand {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-success-brand:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(39,174,96,0.3);
    color: white;
}

.btn-outline-brand {
    background: transparent;
    color: var(--alzamil-blue);
    border: 2px solid var(--alzamil-blue);
    padding: 10px 28px;
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* ---- KPI Card ---- */
.kpi-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid var(--border-light);
    text-align: center;
}

.kpi-card .kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 12px;
}

.kpi-card .kpi-value {
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 4px;
}

.kpi-card .kpi-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.kpi-card .kpi-delta {
    font-size: 0.8rem;
    font-weight: 700;
    margin-top: 6px;
}

.kpi-delta.up { color: var(--score-green); }
.kpi-delta.down { color: var(--score-red); }

/* ---- Utility ---- */
.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.divider {
    height: 1px;
    background: var(--border-light);
    margin: 1.5rem 0;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-up {
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Language Toggle Button ---- */
.lang-toggle-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    border: 2px solid #e0e0e0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
    cursor: pointer;
    font-weight: 800;
    font-size: 1rem;
    color: #1a5276;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-family: 'Tajawal', 'Segoe UI', system-ui, sans-serif;
}
.lang-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    border-color: #1a5276;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .asdp-navbar .nav-links {
        display: none;
    }

    .page-container {
        padding: 1rem;
    }

    .kpi-card .kpi-value {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15px;
    }
}
