/* Custom Premium Design System for Taxi Tek */

@font-face {
    font-family: 'Al Jazeera';
    src: url('Al-Jazeera-Arabic-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --primary-bg: #ffffff;
    --primary-light: #f8f9fa;
    --primary-dark: #0037ff;
    --accent-color: #10cf7b;
    --accent-hover: #0ea964;
    --text-color: #0b1e4f;
    --text-muted: #718096;
    --danger-color: #e53e3e;
    --success-color: #38a169;
    --card-bg: #f8f9fa;
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Al Jazeera', 'Cairo', sans-serif;
    background-color: #f3f4f6;
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
}

/* App Layout */
#app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    max-width: 480px; /* Force mobile-app style view for screenshot accuracy */
    background-color: #ffffff;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.08);
    position: relative;
}

/* Header */
.app-header {
    background-color: #ffffff;
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-text {
    color: var(--primary-dark);
    font-size: 1.8rem;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -1px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.plus-btn {
    background-color: var(--accent-color);
    color: #ffffff;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(16, 207, 123, 0.25);
    transition: var(--transition);
}

.plus-btn:hover {
    background-color: var(--accent-hover);
    transform: scale(1.05);
}

.nav-btn-captain {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(0, 55, 255, 0.15);
    background: transparent;
    color: var(--primary-dark);
}

.nav-btn-captain:hover {
    background-color: rgba(0, 55, 255, 0.05);
}

/* Views Control */
.view {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    flex-grow: 1;
}

.view.active {
    display: flex;
    flex-direction: column;
    opacity: 1;
}

/* Home View */
#home-view {
    width: 100%;
    padding: 12px 20px;
    gap: 16px;
}

/* Services Cards Grid */
.services-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.service-card {
    border-radius: var(--border-radius);
    padding: 24px 32px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    height: 165px;
    border: none;
}

/* Specific Card Backgrounds mimicking the screenshot exactly */
.taxi-card {
    background-color: #003eff;
    box-shadow: 0 6px 20px rgba(0, 62, 255, 0.2);
}

.taxi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 62, 255, 0.3);
}

.food-card {
    background-color: #efa292;
    box-shadow: 0 6px 20px rgba(239, 162, 146, 0.2);
}

.food-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(239, 162, 146, 0.3);
}

.box-card {
    background-color: #4ecbb4;
    box-shadow: 0 6px 20px rgba(78, 203, 180, 0.2);
    height: 180px; /* slightly taller due to subtitle & info footer */
    padding-bottom: 35px;
}

.box-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(78, 203, 180, 0.3);
}

.card-info {
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    color: #ffffff;
}

.card-info h2 {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.card-info .sub-text {
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 0.9;
}

.card-image-wrapper {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 200px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* White sedan inside the taxi card */
.car-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.car-image {
    width: 105%;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.15));
}

.car-brand-text {
    position: absolute;
    bottom: 40px;
    right: 48px;
    font-size: 0.65rem;
    font-weight: 800;
    color: #003eff;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'Cairo', sans-serif;
    transform: skewX(-5deg);
}

.food-image {
    width: 125px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
}

.box-image {
    width: 150px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
}

.box-footer-text {
    position: absolute;
    bottom: 8px;
    right: 32px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #ffffff;
    opacity: 0.95;
}

/* Map Layout & Sidebar */
#map-view {
    height: calc(100vh - 66px);
}

.map-layout {
    display: flex;
    flex-direction: row;
    height: 100%;
    width: 100%;
}

.booking-sidebar {
    width: 380px;
    background-color: rgba(11, 30, 79, 0.95);
    position: relative;
    overflow: hidden;
}

/* Floating Overlay Layout */
.map-floating-header {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    pointer-events: none;
}

.map-circle-btn {
    pointer-events: auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #333333;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: var(--transition);
}

.map-circle-btn:hover {
    transform: scale(1.05);
    background-color: #f7f9fa;
}

.kirkuk-pill {
    pointer-events: auto;
    background-color: #ffffff;
    border: 1.5px solid #003eff;
    color: #003eff;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 6px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 62, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Floating Address Panel */
.floating-address-panel {
    position: absolute;
    top: 76px;
    left: 16px;
    right: 16px;
    background-color: #ffffff;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 6px 12px;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.address-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.address-input-row:not(:last-child) {
    border-bottom: 1px solid #edf2f7;
}

.address-input-row i {
    font-size: 1.1rem;
}

.address-input-row .pickup-icon {
    color: #003eff; /* Blue circle for pickup as shown in the screenshot */
}

.address-input-row .dest-icon {
    color: #003eff; /* Blue square/marker for destination as shown in the screenshot */
}

.address-input-row input {
    flex-grow: 1;
    border: none;
    outline: none;
    font-family: 'Cairo', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2d3748;
    background: transparent;
}

.address-input-row input::placeholder {
    color: #a0aec0;
}

.gps-btn {
    background: transparent;
    border: none;
    color: #003eff;
    font-size: 1.05rem;
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
}

.gps-btn:hover {
    transform: scale(1.1);
}

/* Floating Bottom Sheet */
.booking-bottom-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #ffffff;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    color: #1a202c;
}

/* Surge Warning Banner */
.surge-banner {
    background-color: #fff3f0;
    border: 1px solid rgba(255, 99, 71, 0.15);
    border-radius: 12px;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 700;
}

.surge-text {
    color: #d9422b;
}

.surge-link {
    color: #003eff;
    cursor: pointer;
    text-decoration: underline;
}

/* Category Tabs */
.sheet-tabs {
    display: flex;
    border-bottom: 2px solid #edf2f7;
    margin-bottom: 4px;
}

.tab-item {
    padding: 8px 16px;
    font-weight: 800;
    font-size: 0.95rem;
    color: #718096;
    cursor: pointer;
}

.tab-item.active {
    color: #003eff;
    border-bottom: 3px solid #003eff;
    margin-bottom: -2.5px;
}

/* Ride Options */
.ride-options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ride-option-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-radius: 14px;
    border: 2px solid #edf2f7;
    cursor: pointer;
    transition: var(--transition);
}

.ride-option-card.active {
    border-color: #003eff;
    background-color: rgba(0, 62, 255, 0.02);
}

.ride-option-details {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ride-icon-container {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blue-car-svg {
    width: 100%;
    height: auto;
}

.bolt-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background-color: #ffd54f;
    color: #003eff;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    border: 1.5px solid #ffffff;
}

.ride-text-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ride-badge-economy {
    font-size: 0.65rem;
    font-weight: 700;
    color: #718096;
}

.ride-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1a202c;
}

.ride-price-meta {
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.ride-price-val {
    font-size: 1.15rem;
    font-weight: 900;
    color: #003eff;
}

.ride-price-sub {
    font-size: 0.7rem;
    font-weight: 600;
    color: #718096;
}

/* Primary Booking Button */
.btn-primary-booking {
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    padding: 14px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    background-color: #003eff;
    color: #ffffff;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 62, 255, 0.2);
}

.btn-primary-booking:hover:not(:disabled) {
    background-color: #0031ca;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 62, 255, 0.3);
}

.btn-primary-booking:disabled {
    background-color: #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
    box-shadow: none;
}

/* Captains Badge */
.captains-live-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #718096;
}

.pulse-green {
    width: 8px;
    height: 8px;
    background-color: #10cf7b;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 207, 123, 0.7);
    animation: greenPulse 1.6s infinite;
}

@keyframes greenPulse {
    70% { box-shadow: 0 0 0 6px rgba(16, 207, 123, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 207, 123, 0); }
}

.live-status-card {
    background-color: rgba(56, 161, 105, 0.1);
    border: 1px solid rgba(56, 161, 105, 0.2);
    padding: 12px 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--success-color);
}

.pulses {
    box-shadow: 0 0 0 0 rgba(56, 161, 105, 0.7);
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    70% {
        box-shadow: 0 0 0 8px rgba(56, 161, 105, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(56, 161, 105, 0);
    }
}

/* Map Area */
.map-container-wrapper {
    flex-grow: 1;
    position: relative;
    height: 100%;
}

#map {
    height: 100%;
    width: 100%;
}

/* Customized leafleft dark styling overlay hint */
.leaflet-container {
    background: var(--primary-bg) !important;
}

.leaflet-tile {
    filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

.map-overlay-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(11, 30, 79, 0.85);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: #0f2761;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 450px;
    padding: 24px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: modalSlide 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.captain-status-box {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-label {
    font-weight: 600;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch label {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.toggle-switch label:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-switch input:checked + label {
    background-color: var(--success-color);
}

.toggle-switch input:checked + label:before {
    transform: translateX(30px);
}

.sim-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Custom Map Marker Branding */
.custom-captain-marker {
    background: none;
    border: none;
}

.marker-pin-wrapper {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.marker-pin-wrapper i {
    font-size: 2.1rem;
    color: #ffd54f; /* Premium Taxi Golden-Yellow */
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
}

.marker-label {
    position: absolute;
    bottom: -18px;
    background-color: #0b1e4f;
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsiveness */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .map-layout {
        flex-direction: column-reverse;
    }
    
    .booking-sidebar {
        width: 100%;
        height: 50%;
        box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.5);
    }
    
    .map-container-wrapper {
        height: 50%;
    }
}

/* Custom Screenshot-Matched Route Markers */
.custom-route-marker-pickup, .custom-route-marker-dest {
    background: none !important;
    border: none !important;
}

.route-marker-container {
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    transform: translate(-12px, -12px); /* Offset L.divIcon anchor */
}

.circle-marker {
    width: 24px;
    height: 24px;
    background-color: #003eff;
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
    position: relative;
}

.circle-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background-color: #ffffff;
    border-radius: 50%;
}

.square-marker {
    width: 24px;
    height: 24px;
    background-color: #003eff;
    border: 3px solid #ffffff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
    position: relative;
}

.square-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background-color: #ffffff;
}

.marker-label-pill {
    background-color: #ffffff;
    color: #1a202c;
    font-weight: 800;
    font-size: 0.78rem;
    padding: 4px 12px;
    border-radius: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

