/* * Private Car - Professional Stylesheet
 * Theme: Premium Automotive Red & Dark Grey
 */

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

:root {
    --primary-color: #801313;
    --primary-hover: #a01a1a;
    --bg-color: #f4f6f9;
    --card-bg: #ffffff;
    --text-dark: #2d3436;
    --text-light: #636e72;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Header & Nav --- */
header {
    background: var(--white);
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 15px;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-color);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* --- Main Layout --- */
.main-container {
    max-width: 1200px;
    width: 100%;
    margin: 30px auto;
    padding: 0 20px;
    flex: 1;
}

.page-title {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: var(--text-dark);
    border-left: 5px solid var(--primary-color);
    padding-left: 15px;
}

/* --- Forms & Cards --- */
.auth-card, .content-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 500px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease-in-out;
}

.content-card.wide {
    max-width: 100%;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: #fafafa;
}

.form-control:focus {
    border-color: var(--primary-color);
    background: var(--white);
    outline: none;
    box-shadow: 0 0 0 3px rgba(128, 19, 19, 0.1);
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    width: 100%;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(128, 19, 19, 0.3);
}

.btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* --- Services Grid --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.service-card {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid #eee;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.service-card.selected {
    background-color: #fff5f5;
    border: 2px solid var(--primary-color);
}

.service-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 10px;
}

/* --- Tables (Responsive) --- */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
}

.table th, .table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background-color: var(--primary-color);
    color: var(--white);
    font-weight: 500;
}

/* --- Alerts --- */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}
.alert-error { background: #fee2e2; color: #b91c1c; }
.alert-success { background: #d1fae5; color: #047857; }

/* --- Install PWA Prompt --- */
#install-prompt {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    padding: 15px 20px;
    border-radius: 50px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 2000;
    align-items: center;
    gap: 15px;
}
#install-prompt button {
    padding: 8px 20px;
    font-size: 0.9rem;
    border-radius: 20px;
}

/* --- Footer --- */
footer {
    background: #1a1a1a;
    color: #888;
    text-align: center;
    padding: 20px;
    margin-top: auto;
    font-size: 0.85rem;
}

footer a { color: #fff; text-decoration: none; }

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Mobile Responsive --- */
/* --- Mobile Responsive & App Menu --- */
@media (max-width: 768px) {
    /* تنسيق الزر (الهبرغر) */
    .menu-toggle { 
        display: block; 
        font-size: 1.8rem;
        color: var(--primary-color);
        cursor: pointer;
        z-index: 1001; /* ليبقى فوق القائمة */
    }

    /* خلفية معتمة عند فتح القائمة */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(3px); /* تأثير ضبابي حديث */
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* القائمة الجانبية نفسها */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%; /* مخفية خارج الشاشة */
        width: 280px; /* عرض القائمة */
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        padding: 80px 20px 20px 20px; /* مساحة من الأعلى */
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1); /* حركة سلايد ناعمة */
        z-index: 999;
        gap: 10px;
    }
    
    .nav-links.active { 
        right: 0; /* إظهار القائمة */
    }

    /* ترويسة القائمة (شكل جمالي) */
    .nav-links::before {
        content: 'Private Car';
        position: absolute;
        top: 0;
        right: 0;
        width: 93%;
        height: 60px;
        background: var(--primary-color);
        color: white;
        display: flex;
        align-items: center;
        padding-left: 20px;
        font-weight: bold;
        font-size: 1.2rem;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    /* روابط القائمة */
    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: flex;
        align-items: center;
        padding: 15px;
        border-radius: 10px;
        color: var(--text-dark);
        font-size: 1rem;
        background: #f8f9fa;
        transition: all 0.2s;
    }

    .nav-links a:hover, .nav-links a.active {
        background: #fff1f1; /* خلفية حمراء فاتحة جداً */
        color: var(--primary-color);
        transform: translateX(-5px); /* حركة بسيطة لليسار */
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }

    /* إضافة مسافة للأيقونات (إذا استخدمت FontAwesome) */
    .nav-links a i {
        margin-right: 15px;
        width: 25px;
        text-align: center;
    }

    /* تحسينات الجدول للموبايل (موجودة سابقاً) */
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr { margin-bottom: 15px; border: 1px solid #eee; border-radius: 12px; background: white; padding: 10px; }
    .table td { 
        text-align: right; 
        padding: 10px; 
        padding-left: 50%; 
        position: relative;
        border-bottom: 1px solid #f0f0f0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .table td:last-child { border-bottom: none; }
    .table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #888;
        font-size: 0.85rem;
    }
}
/* --- Mobile Bottom Navigation --- */
.bottom-nav {
    display: none; /* مخفي على الكمبيوتر */
}

.settings-modal {
    display: none; /* مخفي افتراضياً */
}

@media (max-width: 768px) {
    /* إخفاء زر القائمة العلوي القديم لأننا سنعتمد على السفلي */
    .menu-toggle {
        display: none !important;
    }
    
    /* مسافة في أسفل الصفحة عشان المحتوى ما يتغطى بالشريط */
    body {
        padding-bottom: 80px; 
    }

    /* تصميم الشريط السفلي */
    .bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 65px;
        background: #ffffff;
        box-shadow: 0 -2px 20px rgba(0,0,0,0.1);
        z-index: 2000;
        border-top: 1px solid #f0f0f0;
    }

    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #999;
        font-size: 0.75rem;
        width: 25%;
        height: 100%;
        transition: all 0.3s;
    }

    .nav-item i {
        font-size: 1.4rem;
        margin-bottom: 4px;
    }

    /* حالة العنصر النشط */
    .nav-item.active {
        color: var(--primary-color);
        font-weight: 600;
    }
    
    .nav-item:active {
        background-color: #f9f9f9;
    }

    /* --- قائمة الإعدادات المنبثقة (Bottom Sheet) --- */
    .settings-modal {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5); /* خلفية معتمة */
        z-index: 3000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
    }

    .settings-modal.open {
        opacity: 1;
        visibility: visible;
    }

    .settings-content {
        position: absolute;
        bottom: -100%; /* تبدأ من تحت الشاشة */
        left: 0;
        width: 100%;
        background: white;
        border-radius: 20px 20px 0 0;
        padding: 20px;
        transition: bottom 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .settings-modal.open .settings-content {
        bottom: 0; /* تطلع لفوق */
    }

    .settings-header {
        text-align: center;
        margin-bottom: 20px;
        color: var(--primary-color);
        font-weight: bold;
        font-size: 1.1rem;
        position: relative;
    }
    
    /* خط صغير فوق القائمة للسحب */
    .settings-header::before {
        content: '';
        width: 40px;
        height: 4px;
        background: #ddd;
        border-radius: 10px;
        position: absolute;
        top: -10px;
        left: 50%;
        transform: translateX(-50%);
    }

    .settings-link {
        display: flex;
        align-items: center;
        padding: 15px;
        color: var(--text-dark);
        text-decoration: none;
        border-bottom: 1px solid #f5f5f5;
        font-size: 1rem;
    }

    .settings-link:last-child {
        border-bottom: none;
        color: #dc3545; /* لون أحمر لتسجيل الخروج */
    }

    .settings-link i {
        width: 30px;
        font-size: 1.2rem;
    }
}
/* تنسيق صورة اللوغو */
.logo img {
    max-height: 50px; /* أقصى ارتفاع عشان ما تطلع برا الشريط */
    width: auto;      /* العرض يتعدل تلقائي للحفاظ على الأبعاد */
    object-fit: contain;
    vertical-align: middle;
    transition: transform 0.3s ease;
}

/* تأثير بسيط عند مرور الماوس */
.logo img:hover {
    transform: scale(1.05);
}

/* تعديل خاص للموبايل عشان اللوغو ما يكون كبير زيادة */
@media (max-width: 768px) {
    .logo img {
        max-height: 40px;
    }
}
/* تنسيق شبكة الإحصائيات */
.stats-grid {
    display: grid;
    /* هذا السطر يقسم المساحة لـ 3 أعمدة متساوية بالضبط */
    grid-template-columns: repeat(3, 1fr); 
    gap: 10px; /* مسافة صغيرة بين الكروت */
    margin: 30px auto;
    width: 100%;
    max-width: 600px;
}

/* تنسيق محتوى الكارت */
.stats-grid .content-card {
    /* هذا السطر السحري بيخلي الكرت مربع تماماً (الطول = العرض) */
    aspect-ratio: 1 / 1; 
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px !important; /* تقليل الحواف الداخلية */
    height: auto !important; /* إلغاء أي ارتفاع ثابت */
    min-height: 0 !important;
}

/* تصغير الخطوط شوي عشان توسع داخل المربع */
.stats-grid .content-card h3 {
    font-size: 0.8rem !important; /* تصغير عنوان "Today's Orders" */
    margin-bottom: 5px;
}

.stats-grid .content-card p {
    font-size: 1.2rem !important; /* تصغير الرقم */
    margin: 0;
}

.stats-grid .content-card i {
    font-size: 1.5rem !important; /* تصغير الأيقونة */
    margin-bottom: 10px !important;
}