/* ============================================================================
   TaxiBook Client App - Styles
   ============================================================================ */

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

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

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

.btn-primary:disabled { 
    background-color: #D1D5DB; 
    cursor: not-allowed; 
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover { 
    background-color: #E5E7EB; 
}

/* Cards */
.card {
    background-color: white;
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

/* Code Inputs - 6 chiffres avec support collage */
.code-inputs {
    display: flex;
    gap: 0.35rem;
    justify-content: center;
    margin: 1rem 0;
}

.code-digit {
    width: 2.5rem;
    height: 3rem;
    text-align: center;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1.25rem;
    font-weight: bold;
    transition: all 0.15s ease;
    caret-color: var(--primary);
}

.code-digit:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 184, 0, 0.2);
    transform: scale(1.05);
}

.code-digit:not(:placeholder-shown),
.code-digit:not([value=""]) {
    background-color: rgba(255, 184, 0, 0.05);
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    width: calc(100% - 40px);
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    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 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
    animation: toastSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.notification.success { 
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.75) 0%, rgba(5, 150, 105, 0.7) 100%);
    color: white;
    border-color: rgba(16, 185, 129, 0.2);
}

.notification.error { 
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.75) 0%, rgba(220, 38, 38, 0.7) 100%);
    color: white;
    border-color: rgba(239, 68, 68, 0.2);
}

.notification.info { 
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.75) 0%, rgba(37, 99, 235, 0.7) 100%);
    color: white;
    border-color: rgba(59, 130, 246, 0.2);
}

.notification-content {
    flex: 1;
    line-height: 1.4;
}

@keyframes toastSlideIn {
    0% { 
        transform: translateX(100%) scale(0.9); 
        opacity: 0; 
    }
    60% { 
        transform: translateX(-10px) scale(1.02); 
        opacity: 0.8; 
    }
    100% { 
        transform: translateX(0) scale(1); 
        opacity: 1; 
    }
}

@keyframes toastSlideOut {
    0% { 
        transform: translateX(0) scale(1); 
        opacity: 1; 
    }
    100% { 
        transform: translateX(100%) scale(0.9); 
        opacity: 0; 
    }
}

.notification.slide-out {
    animation: toastSlideOut 0.3s ease-in forwards;
}

.notification:hover {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

/* Navigation */
.nav-item.active {
    color: var(--primary);
    background-color: rgba(255, 184, 0, 0.1);
}

/* Inputs */
.input-field {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
}

.input-field:focus {
    border-color: var(--primary);
    outline: none;
}

/* Vehicle selection */
.vehicle-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.vehicle-item:hover {
    border-color: var(--primary);
    background-color: rgba(255, 184, 0, 0.05);
}

.vehicle-item.selected {
    border-color: var(--primary);
    background-color: rgba(255, 184, 0, 0.1);
}

/* Spinner */
.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

.animate-slide-down {
    animation: slideDown 0.3s ease-out forwards;
}

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

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

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* Map containers */
.map-container {
    width: 100%;
    height: 100%;
    min-height: 200px;
}

/* Chat styles */
.chat-modal {
    position: fixed;
    inset: 0;
    background: white;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.chat-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem;
    padding-top: max(1rem, env(safe-area-inset-top));
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-message {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

.chat-message.sent {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.chat-message.received {
    align-self: flex-start;
    background: white;
    border: 1px solid var(--border);
    border-bottom-left-radius: 0.25rem;
}

.chat-message.system {
    align-self: center;
    background: var(--border);
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.75rem;
}

.chat-input-area {
    padding: 0.75rem 1rem;
    background: white;
    border-top: 1px solid var(--border);
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    display: flex;
    gap: 0.5rem;
}

.chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    font-size: 0.875rem;
    outline: none;
}

.chat-input:focus {
    border-color: var(--primary);
}

.chat-send-btn {
    width: 2.75rem;
    height: 2.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.chat-send-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

/* Quick replies */
.quick-replies {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    overflow-x: auto;
    background: #f8fafc;
}

.quick-reply-btn {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    font-size: 0.8125rem;
    white-space: nowrap;
    cursor: pointer;
}

.quick-reply-btn:hover {
    background: #f1f5f9;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 1.25rem;
    font-size: 0.75rem;
    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; }

/* Active ride card */
.active-ride-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 1rem;
    padding: 1rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.active-ride-card:hover {
    transform: scale(1.02);
}

/* Message notification toast */
.message-notification-toast {
    position: fixed;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 9998;
    cursor: pointer;
    animation: slideDown 0.3s ease-out forwards;
}

/* Safe area support */
@supports (padding-top: env(safe-area-inset-top)) {
    .safe-area-top {
        padding-top: env(safe-area-inset-top);
    }
    .safe-area-bottom {
        padding-bottom: env(safe-area-inset-bottom);
    }
}
