/* ============================================================================
   TaxiBook Mon Compte - Design System (style mdriver / orange)
   ============================================================================ */

:root {
    --primary: #FFB800;
    --primary-dark: #EAB308;
    --secondary: #F3F4F6;
    --success: #10b981;
    --danger: #ef4444;
    --info: #3b82f6;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --border: #E5E7EB;
}

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

* { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: #f9fafb; color: var(--text-primary); -webkit-font-smoothing: antialiased; }

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn-primary {
    background-color: var(--primary);
    color: white;
    padding: 0.875rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    box-shadow: 0 4px 14px -2px rgba(255, 184, 0, 0.4);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
}
.btn-primary:hover:not(:disabled) { background-color: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 6px 18px -2px rgba(255, 184, 0, 0.5); }
.btn-primary:disabled { background-color: #D1D5DB; cursor: not-allowed; box-shadow: none; }

.btn-secondary {
    background-color: var(--secondary);
    color: var(--text-primary);
    padding: 0.875rem 1.5rem;
    border-radius: 0.75rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
}
.btn-secondary:hover:not(:disabled) { background-color: #E5E7EB; }

.btn-outline {
    background: white;
    color: var(--text-primary);
    padding: 0.875rem 1.5rem;
    border-radius: 0.75rem;
    border: 1.5px solid var(--border);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.2s;
}
.btn-outline:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }

.btn-danger {
    background: #fef2f2;
    color: var(--danger);
    padding: 0.875rem 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid #fecaca;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
}
.btn-danger:hover:not(:disabled) { background: #fee2e2; }

/* ============================================================================
   CARDS
   ============================================================================ */
.card {
    background-color: white;
    padding: 1rem;
    border-radius: 0.875rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
}

.card-flat {
    background: white;
    border-radius: 0.875rem;
    border: 1px solid var(--border);
    overflow: hidden;
}

/* ============================================================================
   INPUTS
   ============================================================================ */
.input-field {
    width: 100%;
    padding: 0.75rem 0.875rem;
    border: 2px solid var(--border);
    border-radius: 0.625rem;
    font-size: 0.9375rem;
    background: white;
    color: var(--text-primary);
    transition: all 0.15s;
    font-family: inherit;
}
.input-field:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 184, 0, 0.15);
}
.input-field::placeholder { color: #9CA3AF; }

textarea.input-field { resize: vertical; min-height: 80px; }

.input-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.4rem;
}

/* ============================================================================
   STATUS BADGES
   ============================================================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
}
.status-badge.completed { background: #d1fae5; color: #065f46; }
.status-badge.in_progress, .status-badge.onboard { background: #dbeafe; color: #1e40af; }
.status-badge.driver_arrived { background: #cffafe; color: #155e75; }
.status-badge.searching { background: #ede9fe; color: #6d28d9; }
.status-badge.booked, .status-badge.pending, .status-badge.accepted, .status-badge.driver_arriving, .status-badge.awaiting_payment { background: #fef3c7; color: #92400e; }
.status-badge.cancelled, .status-badge.cancelled_central, .status-badge.no_driver, .status-badge.no_show { background: #fee2e2; color: #991b1b; }

/* ============================================================================
   ITEM ROW (cards listing)
   ============================================================================ */
.item-row {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
    cursor: pointer;
    background: white;
}
.item-row:last-child { border-bottom: none; }
.item-row:hover { background: #fafbfc; }

.icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ============================================================================
   FILTER TABS
   ============================================================================ */
.filter-tab {
    display: flex;
    background: #f1f5f9;
    border-radius: 0.625rem;
    padding: 3px;
    gap: 2px;
}
.filter-tab-item {
    flex: 1;
    padding: 0.5rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
    border: none;
    background: none;
    font-family: inherit;
}
.filter-tab-item.active {
    background: white;
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    font-weight: 600;
}

/* ============================================================================
   VEHICLE SELECTION
   ============================================================================ */
.vehicle-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    gap: 0.875rem;
}
.vehicle-item:hover { border-color: var(--primary); background-color: rgba(255, 184, 0, 0.04); }
.vehicle-item.selected { border-color: var(--primary); background-color: rgba(255, 184, 0, 0.08); }

/* ============================================================================
   PAYMENT METHOD CARD
   ============================================================================ */
.pm-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    border-radius: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid var(--border);
    background: white;
}
.pm-card.selected { border-color: var(--primary); background-color: rgba(255, 184, 0, 0.06); }
.pm-radio {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid #d1d5db;
    flex-shrink: 0;
    transition: all 0.15s;
}
.pm-card.selected .pm-radio { border: 5px solid var(--primary); }

/* ============================================================================
   NOTIFICATIONS (TOAST)
   ============================================================================ */
.notification {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    padding: 0.875rem 1.25rem;
    border-radius: 0.875rem;
    font-weight: 600;
    font-size: 0.875rem;
    z-index: 1100;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
    animation: toastSlideIn 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    pointer-events: auto;
    cursor: pointer;
    color: white;
    max-width: 480px;
    margin: 0 auto;
}
@media (min-width: 640px) {
    .notification { left: auto; right: 20px; }
}
.notification.success { background: linear-gradient(135deg, rgba(16, 185, 129, 0.92) 0%, rgba(5, 150, 105, 0.88) 100%); }
.notification.error { background: linear-gradient(135deg, rgba(239, 68, 68, 0.92) 0%, rgba(220, 38, 38, 0.88) 100%); }
.notification.info { background: linear-gradient(135deg, rgba(59, 130, 246, 0.92) 0%, rgba(37, 99, 235, 0.88) 100%); }
.notification-content { flex: 1; line-height: 1.4; }

@keyframes toastSlideIn {
    0% { transform: translateY(-100%) scale(0.95); opacity: 0; }
    60% { transform: translateY(8px) scale(1.01); opacity: 0.95; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes toastSlideOut {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-100%) scale(0.95); opacity: 0; }
}
.notification.slide-out { animation: toastSlideOut 0.25s ease-in forwards; }

/* ============================================================================
   SPINNERS
   ============================================================================ */
.spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid #f3f3f3;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}
.spinner-sm { width: 1rem; height: 1rem; border-width: 2px; }
.spinner-light { border: 3px solid rgba(255,255,255,0.3); border-top-color: white; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================================
   ACTIVE RIDE CARD (orange gradient hero)
   ============================================================================ */
.active-ride-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 1rem;
    padding: 1.125rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 8px 20px -4px rgba(255, 184, 0, 0.45);
}
.active-ride-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -4px rgba(255, 184, 0, 0.55); }

/* ============================================================================
   SLIDE PANELS (mobile-style detail views)
   ============================================================================ */
.slide-panel {
    position: fixed;
    inset: 0;
    background: #f9fafb;
    z-index: 200;
    animation: slideIn 0.25s ease-out;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.slide-panel.closing { animation: slideOut 0.2s ease-in forwards; }
@keyframes slideOut { from { transform: translateX(0); } to { transform: translateX(100%); } }

@media (min-width: 768px) {
    .slide-panel {
        max-width: 540px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
    }
    @keyframes slideIn { from { opacity: 0; transform: translateX(-50%) translateY(24px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
    @keyframes slideOut { from { opacity: 1; transform: translateX(-50%) translateY(0); } to { opacity: 0; transform: translateX(-50%) translateY(24px); } }
}

.slide-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 5;
}
.slide-back {
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    font-size: 1.125rem;
    padding: 0.375rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.slide-back:hover { background: #f1f5f9; }

/* ============================================================================
   CHAT
   ============================================================================ */
.chat-area { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; background: #f8fafc; }
.chat-bubble { max-width: 80%; padding: 0.625rem 0.875rem; border-radius: 0.875rem; font-size: 0.875rem; line-height: 1.4; word-break: break-word; }
.chat-bubble.user { background: var(--primary); color: white; align-self: flex-end; border-bottom-right-radius: 0.25rem; }
.chat-bubble.support { background: white; color: var(--text-primary); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 0.25rem; }
.chat-bubble.system { background: var(--secondary); color: var(--text-secondary); align-self: center; font-size: 0.75rem; padding: 0.375rem 0.75rem; border-radius: 0.75rem; }
.chat-input-bar { display: flex; gap: 0.5rem; padding: 0.75rem 1rem; background: white; border-top: 1px solid var(--border); }
.chat-input { flex: 1; padding: 0.625rem 1rem; border: 1px solid var(--border); border-radius: 1.25rem; font-size: 0.875rem; outline: none; font-family: inherit; }
.chat-input:focus { border-color: var(--primary); }
.chat-send {
    width: 2.5rem; height: 2.5rem;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}
.chat-send:hover:not(:disabled) { background: var(--primary-dark); }
.chat-send:disabled { background: #d1d5db; cursor: not-allowed; }

/* ============================================================================
   BOTTOM NAVIGATION
   ============================================================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    padding: 0.375rem 0.5rem;
    padding-bottom: max(0.375rem, env(safe-area-inset-bottom));
    z-index: 50;
    backdrop-filter: blur(12px);
    background-color: rgba(255, 255, 255, 0.96);
}
.bottom-nav-inner {
    display: flex;
    justify-content: space-around;
    max-width: 540px;
    margin: 0 auto;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    padding: 0.5rem 0.875rem;
    border-radius: 0.625rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.25s ease;
    font-family: inherit;
    flex: 1;
}
.nav-item .nav-icon { font-size: 1.125rem; transition: transform 0.2s; }
.nav-item .nav-label { font-size: 0.6875rem; font-weight: 500; }
.nav-item:hover { color: #64748b; transform: translateY(-1px); }
.nav-item.active {
    color: var(--primary);
    background-color: rgba(255, 184, 0, 0.1);
}
.nav-item.active .nav-icon { transform: scale(1.15); }
.nav-item.active .nav-label { font-weight: 700; }

/* ============================================================================
   APP SHELL LAYOUT
   ============================================================================ */
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f0f1f3;
}

.app-content {
    flex: 1;
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    background: #f9fafb;
    padding-bottom: 5rem; /* room for bottom nav */
}

@media (min-width: 768px) {
    .app-content {
        margin-top: 1.25rem;
        margin-bottom: 1.25rem;
        border-radius: 1rem;
        box-shadow: 0 8px 28px rgba(0,0,0,0.08);
        border: 1px solid var(--border);
        overflow: visible;
        padding-bottom: 0;
    }
    .bottom-nav {
        position: sticky;
        bottom: 1.25rem;
        max-width: 540px;
        margin: 0 auto;
        border-radius: 1rem;
        border: 1px solid var(--border);
    }
}

.page-header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
}
.page-header h1 { font-size: 1rem; font-weight: 700; color: #111827; margin: 0; }
.page-content { padding: 1rem; display: flex; flex-direction: column; gap: 0.875rem; }

/* App top-bar (logo + dropdown) */
.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: white;
    border-bottom: 1px solid var(--border);
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: scale(1); } }
.fade-in { animation: fadeIn 0.3s ease-out; }
.fade-in-up { animation: fadeInUp 0.4s ease-out; }
.scale-in { animation: scaleIn 0.3s ease-out; }

/* ============================================================================
   EMPTY STATE
   ============================================================================ */
.empty-state { text-align: center; padding: 3rem 1.25rem; color: #94a3b8; }
.empty-state .empty-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: #cbd5e1;
    font-size: 1.5rem;
}

/* ============================================================================
   DROPDOWN
   ============================================================================ */
.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.375rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 220px;
    z-index: 50;
    overflow: hidden;
    animation: scaleIn 0.15s ease-out;
    transform-origin: top right;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.6875rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.dropdown-item:hover { background: #f8fafc; }
.dropdown-item.active { background: rgba(255, 184, 0, 0.08); color: var(--primary); font-weight: 600; }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: #fef2f2; }
.dropdown-sep { height: 1px; background: var(--border); margin: 0.25rem 0; }

/* ============================================================================
   SUGGESTION DROPDOWN (address autocomplete)
   ============================================================================ */
.suggestion-list {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 0.25rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 0.625rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    z-index: 30;
    max-height: 240px;
    overflow-y: auto;
}
.suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
    color: #374151;
    transition: background 0.15s;
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: #fafbfc; }

/* ============================================================================
   SCROLLBAR
   ============================================================================ */
.scrollbar-thin::-webkit-scrollbar { width: 6px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ============================================================================
   SECTION TITLE
   ============================================================================ */
.section-title {
    font-size: 0.6875rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    padding: 0 0.25rem;
}

/* ============================================================================
   LOADING SCREEN
   ============================================================================ */
#loading-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.4s ease;
}
#loading-screen .logo {
    font-size: 1.875rem;
    font-weight: 800;
    color: white;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}
#loading-screen .loading-spinner {
    width: 2.75rem; height: 2.75rem;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
