/* ===================================================
   Bubbles Star — Mobile Car Wash
   Main Stylesheet
   =================================================== */

:root {
    --primary:      #0A2647;   /* كحلي داكن */
    --accent:       #1EAEDB;   /* أزرق مائي */
    --accent-light: #E8F7FD;
    --gold:         #C9A84C;   /* ذهبي للعلامة */
    --text-main:    #1a1a2e;
    --text-muted:   #6c757d;
    --bg:           #F5F8FA;
    --white:        #ffffff;
    --success:      #28a745;
    --danger:       #dc3545;
    --warning:      #ffc107;
    --radius:       12px;
    --shadow:       0 4px 20px rgba(10,38,71,.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'NotoSansArabic', 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text-main);
    direction: rtl;
    text-align: right;
}

/* ===== Navbar ===== */
.navbar-bubbles {
    background: var(--primary);
    padding: 14px 20px;
    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,.2);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.navbar-brand .logo-text {
    color: var(--white);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.navbar-brand .logo-text span { color: var(--gold); }

.nav-links a {
    color: rgba(255,255,255,.85);
    text-decoration: none;
    margin-right: 18px;
    font-size: .9rem;
    transition: color .2s;
}

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

/* ===== Cards ===== */
.card-bubbles {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    margin-bottom: 20px;
}

/* ===== Buttons ===== */
.btn-primary-bubbles {
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background .2s, transform .1s;
}

.btn-primary-bubbles:hover { background: #0d3560; transform: translateY(-1px); }
.btn-primary-bubbles:active { transform: translateY(0); }

.btn-accent-bubbles {
    background: var(--accent);
    color: var(--white);
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

.btn-accent-bubbles:hover { background: #178ab5; }

.btn-outline-bubbles {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 8px;
    padding: 10px 22px;
    font-size: .95rem;
    cursor: pointer;
    transition: all .2s;
}

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

/* ===== Form Controls ===== */
.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: .9rem;
    color: var(--text-main);
}

.form-group .optional-badge {
    background: #e9ecef;
    color: var(--text-muted);
    font-size: .72rem;
    padding: 1px 7px;
    border-radius: 20px;
    font-weight: 400;
    margin-right: 6px;
}

.form-control-bubbles {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-main);
    background: var(--white);
    transition: border-color .2s, box-shadow .2s;
    direction: rtl;
}

.form-control-bubbles:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(30,174,219,.15);
}

/* ===== Phone Input ===== */
.phone-input-wrapper {
    display: flex;
    align-items: center;
    border: 1.5px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: var(--white);
    transition: border-color .2s;
}

.phone-input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(30,174,219,.15);
}

.phone-prefix {
    background: #f8f9fa;
    padding: 12px 14px;
    font-weight: 600;
    color: var(--text-muted);
    border-left: 1.5px solid #dee2e6;
    white-space: nowrap;
    font-size: .95rem;
}

.phone-input-wrapper input {
    flex: 1;
    border: none;
    padding: 12px 12px;
    font-size: 1rem;
    direction: ltr;
    text-align: left;
    outline: none;
}

/* ===== OTP Input ===== */
.otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    direction: ltr;
    margin: 20px 0;
}

.otp-inputs input {
    width: 52px;
    height: 60px;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    color: var(--primary);
    transition: border-color .2s;
}

.otp-inputs input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(30,174,219,.15);
}

/* ===== Calendar / Booking Grid ===== */
.booking-steps {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    justify-content: center;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .85rem;
    color: var(--text-muted);
}

.step-item.active { color: var(--accent); font-weight: 600; }
.step-item.done { color: var(--success); }

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 700;
}

.step-item.active .step-num { background: var(--accent); color: white; }
.step-item.done .step-num   { background: var(--success); color: white; }

.step-divider {
    flex: 1;
    height: 2px;
    background: #dee2e6;
    max-width: 40px;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-top: 10px;
}

.service-card {
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 18px 14px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: white;
}

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

.service-card.selected {
    border-color: var(--accent);
    background: var(--accent-light);
    box-shadow: 0 0 0 3px rgba(30,174,219,.2);
}

.service-card .service-name {
    font-weight: 700;
    font-size: .95rem;
    color: var(--primary);
    margin-bottom: 6px;
}

.service-card .service-price {
    color: var(--accent);
    font-weight: 800;
    font-size: 1.1rem;
}

.service-card .service-duration {
    color: var(--text-muted);
    font-size: .78rem;
    margin-top: 4px;
}

/* Date Picker */
.date-picker-wrapper { margin: 16px 0; }

.mini-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-top: 12px;
}

.cal-day-header {
    text-align: center;
    font-size: .75rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 4px 0;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    font-size: .9rem;
    border: 1.5px solid transparent;
    transition: all .15s;
}

.cal-day:hover:not(.disabled):not(.empty) {
    border-color: var(--accent);
    background: var(--accent-light);
}

.cal-day.selected { background: var(--accent); color: white; font-weight: 700; }
.cal-day.today    { border-color: var(--gold); font-weight: 700; }
.cal-day.disabled { color: #ccc; cursor: not-allowed; }
.cal-day.empty    { cursor: default; }

/* Time Slots */
.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.time-slot {
    padding: 10px 8px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
    font-size: .9rem;
    background: white;
}

.time-slot:hover { border-color: var(--accent); background: var(--accent-light); }

.time-slot.selected {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    font-weight: 700;
}

.time-slot .slot-teams {
    font-size: .72rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.time-slot.selected .slot-teams { color: rgba(255,255,255,.8); }

/* ===== Booking Confirmation Card ===== */
.confirm-card {
    background: linear-gradient(135deg, var(--primary) 0%, #0d3560 100%);
    color: white;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
}

.confirm-icon { font-size: 3rem; margin-bottom: 12px; }
.confirm-number { font-size: 1.5rem; font-weight: 800; color: var(--gold); }

.booking-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,.1);
    font-size: .9rem;
}

.booking-detail-row:last-child { border-bottom: none; }
.booking-detail-row .label { opacity: .75; }
.booking-detail-row .value { font-weight: 600; }

/* ===== Status Badge ===== */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 700;
}

.status-Pending    { background: #fff3cd; color: #856404; }
.status-Confirmed  { background: #cce5ff; color: #004085; }
.status-InProgress { background: #d1ecf1; color: #0c5460; }
.status-Completed  { background: #d4edda; color: #155724; }
.status-Cancelled  { background: #f8d7da; color: #721c24; }

/* ===== Page Header ===== */
.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
}

.page-header p {
    color: var(--text-muted);
    margin-top: 4px;
    font-size: .9rem;
}

/* ===== Alert Messages ===== */
.alert-bubbles {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: .9rem;
    font-weight: 500;
}

.alert-error   { background: #f8d7da; color: #721c24; border-right: 4px solid var(--danger); }
.alert-success { background: #d4edda; color: #155724; border-right: 4px solid var(--success); }
.alert-info    { background: #cce5ff; color: #004085; border-right: 4px solid var(--accent); }

/* ===== Footer ===== */
.footer-bubbles {
    background: var(--primary);
    color: rgba(255,255,255,.6);
    text-align: center;
    padding: 20px;
    font-size: .85rem;
    margin-top: 40px;
}

.footer-bubbles span { color: var(--gold); }

/* ===== Admin Sidebar ===== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 240px;
    background: var(--primary);
    padding: 20px 0;
    position: fixed;
    height: 100%;
    right: 0;
    top: 0;
    overflow-y: auto;
}

.admin-sidebar .brand {
    padding: 16px 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    margin-bottom: 10px;
}

.admin-sidebar .brand h2 {
    color: white;
    font-size: 1.1rem;
}

.admin-sidebar .brand span { color: var(--gold); }

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-size: .9rem;
    transition: all .15s;
}

.admin-nav-item:hover,
.admin-nav-item.active {
    background: rgba(255,255,255,.1);
    color: white;
    border-right: 3px solid var(--gold);
}

.admin-nav-item .nav-icon { font-size: 1.1rem; width: 22px; text-align: center; }

.admin-content {
    margin-right: 240px;
    flex: 1;
    padding: 28px;
    background: var(--bg);
}

/* ===== Stats Cards ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-icon.blue   { background: #cce5ff; }
.stat-icon.green  { background: #d4edda; }
.stat-icon.gold   { background: #fff3cd; }
.stat-icon.red    { background: #f8d7da; }

.stat-num {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stat-label { color: var(--text-muted); font-size: .82rem; margin-top: 3px; }

/* ===== Table ===== */
.table-bubbles {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    font-size: .88rem;
}

.table-bubbles th {
    background: var(--primary);
    color: white;
    padding: 12px 16px;
    font-weight: 600;
    text-align: right;
}

.table-bubbles td {
    padding: 11px 16px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.table-bubbles tr:hover td { background: #fafbfc; }
.table-bubbles tr:last-child td { border-bottom: none; }

/* ===== Mobile Header ===== */
.mobile-header {
    display: none;
    align-items: center;
    gap: 14px;
    background: var(--primary);
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 1100;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.mobile-brand {
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.hamburger {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 999;
}

.sidebar-overlay.open { display: block; }

/* optional badge in break form */
.optional-badge {
    background: #e9ecef;
    color: var(--text-muted);
    font-size: .72rem;
    padding: 1px 7px;
    border-radius: 20px;
    font-weight: 400;
    margin-right: 4px;
}

/* ===== Responsive — Tablet (iPad) ===== */
@media (max-width: 1024px) {
    .admin-sidebar {
        width: 200px;
    }
    .admin-content {
        margin-right: 200px;
        padding: 20px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Responsive — Mobile ===== */
@media (max-width: 768px) {
    /* Stack mobile-header on top of content */
    .admin-layout {
        flex-direction: column;
    }

    /* Show mobile header */
    .mobile-header {
        display: flex;
        width: 100%;
        flex-shrink: 0;
    }

    /* Hide sidebar brand (shown in mobile-header instead) */
    .admin-sidebar .brand { display: none; }

    /* Sidebar: off-canvas drawer from the right */
    .admin-sidebar {
        width: 260px;
        transform: translateX(110%);
        transition: transform .3s ease;
        z-index: 1000;
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    /* Content takes full width, no sidebar margin */
    .admin-content {
        margin-right: 0;
        padding: 16px;
        width: 100%;
    }

    /* Grid adjustments */
    .stats-grid      { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .services-grid   { grid-template-columns: repeat(2, 1fr); }
    .time-slots-grid { grid-template-columns: repeat(3, 1fr); }
    .card-bubbles    { padding: 14px; }
    .page-header h1  { font-size: 1.3rem; }

    /* Tables: horizontal scroll */
    .table-bubbles {
        min-width: 520px;
    }

    .card-bubbles {
        overflow-x: auto;
    }

    /* Schedule form grids: stack into 2 columns */
    .card-bubbles div[style*="grid-template-columns"] {
        grid-template-columns: 1fr 1fr !important;
    }

    /* OTP inputs */
    .otp-inputs input {
        width: 42px;
        height: 52px;
        font-size: 1.3rem;
    }

    /* Booking steps */
    .booking-steps { gap: 4px; }
    .step-item { font-size: .78rem; }
    .step-num  { width: 24px; height: 24px; font-size: .72rem; }
}

@media (max-width: 400px) {
    .stats-grid      { grid-template-columns: 1fr; }
    .services-grid   { grid-template-columns: 1fr; }
    .time-slots-grid { grid-template-columns: repeat(2, 1fr); }
    .otp-inputs input { width: 36px; height: 44px; font-size: 1.1rem; }
    .card-bubbles   { padding: 12px; }
}
