/* ============================================================================
   TaxiBook Driver App - Styles
   ============================================================================ */

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

/* Variables CSS */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --orange: #f97316;
}

/* Reset */
* {
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: #f8fafc;
    overscroll-behavior: none;
}

/* App Container */
.app-container {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 80px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-item.active {
    color: var(--primary);
}

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

.nav-item span {
    font-size: 11px;
    font-weight: 500;
}

/* Status Toggle */
.status-toggle {
    position: relative;
    width: 100%;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.status-btn {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.status-btn.online {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-btn.offline {
    border-color: #9ca3af;
    background: rgba(156, 163, 175, 0.1);
    color: #6b7280;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

/* Map Container */
.map-container {
    height: 250px;
    border-radius: 16px;
    overflow: hidden;
    margin: 0 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

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

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Offer Card */
.offer-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 20px;
    padding: 24px;
    margin: 16px;
    animation: slideUp 0.3s ease-out;
}

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

.offer-timer {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-100%); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loader */
.loader {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Menu Item Style */
.menu-item {
    background: white;
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.menu-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.menu-item:active {
    transform: scale(0.98);
}

/* Document Upload */
.doc-upload {
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.doc-upload:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.doc-upload.uploaded {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.doc-upload.uploading {
    opacity: 0.7;
    pointer-events: none;
}

/* Input Styles */
.input-field {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.2s;
    outline: none;
    box-sizing: border-box;
}

.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: white;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Ride Status Progress */
.ride-progress {
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    position: relative;
}

.ride-progress::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 50px;
    right: 50px;
    height: 3px;
    background: #e5e7eb;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

.step-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.step-dot.active {
    background: var(--primary);
    color: white;
}

.step-dot.completed {
    background: var(--success);
    color: white;
}

/* Earnings Card */
.earnings-card {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 20px;
    padding: 24px;
    margin: 16px;
}

.earnings-stat {
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

/* Chat Modal Styles */
.chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f8fafc;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.chat-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 16px 20px;
    padding-top: max(16px, env(safe-area-inset-top));
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.chat-header-back {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-header-back:hover {
    background: rgba(255,255,255,0.3);
}

.chat-header-back i {
    font-size: 18px;
}

.chat-header-info {
    flex: 1;
}

.chat-header-info h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chat-header-info p {
    margin: 2px 0 0;
    font-size: 13px;
    opacity: 0.85;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Chat Message Styles */
.chat-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
    animation: messageSlide 0.3s ease-out;
    position: relative;
}

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

.chat-message.sent {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.chat-message.received {
    align-self: flex-start;
    background: white;
    color: #1f2937;
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.chat-message.system {
    align-self: center;
    max-width: 90%;
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
    font-size: 13px;
    text-align: center;
    border-radius: 12px;
    padding: 8px 16px;
}

.chat-message-time {
    font-size: 11px;
    margin-top: 6px;
    opacity: 0.7;
}

.chat-message.sent .chat-message-time {
    text-align: right;
    color: rgba(255,255,255,0.85);
}

.chat-message.received .chat-message-time {
    text-align: left;
    color: #9ca3af;
}

/* Chat Input Area */
.chat-input-area {
    background: white;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.chat-quick-replies {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    border-bottom: 1px solid #f1f5f9;
    -webkit-overflow-scrolling: touch;
}

.chat-quick-replies::-webkit-scrollbar {
    display: none;
}

.chat-quick-btn {
    padding: 8px 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-quick-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.chat-input-row {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
}

.chat-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.chat-input::placeholder {
    color: #9ca3af;
}

.chat-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.chat-send-btn i {
    font-size: 18px;
}

/* Legacy message styles (keep for compatibility) */
.message {
    max-width: 80%;
    margin-bottom: 12px;
    animation: fadeIn 0.3s ease-out;
}

.message.sent {
    margin-left: auto;
}

.message.received {
    margin-right: auto;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
}

.message.sent .message-bubble {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received .message-bubble {
    background: white;
    color: #1f2937;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.message-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
    text-align: right;
}

.message.received .message-time {
    text-align: left;
}

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

/* Offer Full Screen */
.offer-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(to bottom, #1e3a5f 0%, #0f172a 100%);
    display: flex;
    flex-direction: column;
}

.offer-fullscreen-map {
    flex: 1;
    min-height: 200px;
}

.offer-fullscreen-content {
    padding: 24px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.offer-fullscreen-timer {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: white;
    margin: 0 auto 24px;
}

/* Badge Notification */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Validation pending overlay */
.validation-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
}

.validation-card {
    background: white;
    border-radius: 20px;
    padding: 32px;
    margin: 24px;
    text-align: center;
    max-width: 400px;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.pending { background: #fef3c7; color: #92400e; }
.status-badge.searching { background: #dbeafe; color: #1e40af; }
.status-badge.accepted { background: #d1fae5; color: #065f46; }
.status-badge.driver_arriving { background: #dbeafe; color: #1e40af; }
.status-badge.driver_arrived { background: #d1fae5; color: #065f46; }
.status-badge.in_progress { background: #dbeafe; color: #1e40af; }
.status-badge.completed { background: #d1fae5; color: #065f46; }
.status-badge.cancelled { background: #fee2e2; color: #991b1b; }

/* ============================================================================
   Validation Status Banners
   ============================================================================ */

.validation-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    margin: 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.validation-banner i {
    font-size: 24px;
    margin-top: 2px;
}

.validation-banner div {
    flex: 1;
}

.validation-banner strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.validation-banner p {
    font-size: 12px;
    margin: 0;
    opacity: 0.9;
}

.validation-banner.pending {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.validation-banner.disabled {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

.validation-banner.rejected {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.validation-banner.approved {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

/* Bouton désactivé */
.status-btn.disabled-btn {
    opacity: 0.5;
    cursor: not-allowed;
}

.status-btn.disabled-btn:active {
    transform: none;
}

/* Scale In Animation */
@keyframes scaleIn {
    from { 
        opacity: 0; 
        transform: scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: scale(1); 
    }
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out;
}

/* Documents Alert Modal - z-index très élevé pour passer au-dessus de Leaflet */
.documents-alert-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
}
