/**
 * VTC Flash Booking - Styles Frontend
 * 
 * Design Mobile-First, inspiré Tailwind CSS
 * 
 * @package VTC_Flash_Booking
 */

/* ==========================================================================
   Variables CSS
   ========================================================================== */

:root {
    --vtc-primary: #2563eb;
    --vtc-primary-light: #3b82f6;
    --vtc-primary-dark: #1d4ed8;
    --vtc-accent: #2563eb;
    --vtc-success: #2563eb;
    --vtc-error: #dc2626;
    --vtc-warning: #d97706;
    --vtc-whatsapp: #25d366;
    --vtc-whatsapp-dark: #128c7e;
    --vtc-text: #1f2937;
    --vtc-text-light: #6b7280;
    --vtc-bg: #f9fafb;
    --vtc-white: #ffffff;
    --vtc-border: #e5e7eb;
    --vtc-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --vtc-shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --vtc-shadow-xl: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --vtc-radius: 8px;
    --vtc-radius-sm: 6px;
    --vtc-transition: all 0.15s ease;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

.vtc-flash-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    color: var(--vtc-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.vtc-flash-container *,
.vtc-flash-container *::before,
.vtc-flash-container *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   Formulaire Principal
   ========================================================================== */

.vtc-flash-form {
    background: var(--vtc-white);
    border-radius: var(--vtc-radius);
    box-shadow: var(--vtc-shadow-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.vtc-flash-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--vtc-border);
}

.vtc-flash-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--vtc-text);
    margin: 0;
}

.vtc-flash-icon {
    width: 26px;
    height: 26px;
    color: var(--vtc-primary);
}

/* ==========================================================================
   Champs de Formulaire
   ========================================================================== */

.vtc-flash-field {
    margin-bottom: 20px;
}

.vtc-flash-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--vtc-text);
    margin-bottom: 8px;
}

.vtc-flash-input {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    border: 1px solid var(--vtc-border);
    border-radius: var(--vtc-radius-sm);
    background: var(--vtc-white);
    color: var(--vtc-text);
    transition: var(--vtc-transition);
    -webkit-appearance: none;
    appearance: none;
}

.vtc-flash-input:focus {
    outline: none;
    border-color: var(--vtc-primary);
    box-shadow: 0 0 0 2px rgba(55, 65, 81, 0.1);
}

.vtc-flash-input::placeholder {
    color: var(--vtc-text-light);
}

.vtc-flash-input.error {
    border-color: var(--vtc-error);
    animation: shake 0.4s ease;
}

.vtc-flash-input.success-flash {
    animation: successFlash 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes successFlash {
    0% { background-color: var(--vtc-white); }
    50% { background-color: #c6f6d5; }
    100% { background-color: var(--vtc-white); }
}

/* Champ datetime-local amélioré */
.vtc-flash-input[type="datetime-local"] {
    min-height: 54px;
}

/* Boutons de temps rapide */
.vtc-flash-time-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.vtc-flash-btn-time {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--vtc-white);
    border: 1px solid var(--vtc-primary);
    border-radius: var(--vtc-radius-sm);
    color: var(--vtc-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--vtc-transition);
}

.vtc-flash-btn-time svg {
    width: 16px;
    height: 16px;
    color: var(--vtc-primary);
}

.vtc-flash-btn-time:hover {
    background: rgba(37, 99, 235, 0.05);
}

.vtc-flash-btn-time:active {
    transform: scale(0.98);
}

.vtc-flash-btn-time.active {
    background: var(--vtc-primary);
    color: var(--vtc-white);
}

.vtc-flash-btn-time.active svg {
    color: var(--vtc-white);
}

/* ==========================================================================
   Groupe Input avec Bouton GPS
   ========================================================================== */

.vtc-flash-input-group {
    display: flex;
    gap: 8px;
}

.vtc-flash-input-group .vtc-flash-autocomplete-wrapper {
    flex: 1;
}

.vtc-flash-btn-geo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px;
    background: var(--vtc-white);
    color: var(--vtc-primary);
    border: 1px solid var(--vtc-primary);
    border-radius: var(--vtc-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--vtc-transition);
    white-space: nowrap;
    min-width: 80px;
}

.vtc-flash-btn-geo:hover:not(:disabled) {
    background: var(--vtc-primary);
    color: var(--vtc-white);
}

.vtc-flash-btn-geo:active:not(:disabled) {
    transform: scale(0.98);
}

.vtc-flash-btn-geo:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.vtc-flash-btn-geo.loading {
    pointer-events: none;
}

.vtc-flash-btn-geo.loading .vtc-flash-geo-icon {
    animation: spin 1s linear infinite;
}

.vtc-flash-geo-icon {
    width: 18px;
    height: 18px;
}

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

/* Masquer le texte GPS sur petit écran */
@media (max-width: 360px) {
    .vtc-flash-geo-text {
        display: none;
    }
    
    .vtc-flash-btn-geo {
        min-width: 54px;
        padding: 12px;
    }
}

/* ==========================================================================
   Autocomplétion
   ========================================================================== */

.vtc-flash-autocomplete-wrapper {
    position: relative;
}

.vtc-flash-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--vtc-white);
    border: 1px solid var(--vtc-border);
    border-top: none;
    border-radius: 0 0 var(--vtc-radius-sm) var(--vtc-radius-sm);
    box-shadow: var(--vtc-shadow-lg);
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 250px;
    overflow-y: auto;
    display: none;
}

.vtc-flash-suggestions.active {
    display: block;
}

.vtc-flash-suggestion {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: var(--vtc-transition);
    border-bottom: 1px solid var(--vtc-border);
}

.vtc-flash-suggestion:last-child {
    border-bottom: none;
}

.vtc-flash-suggestion:hover,
.vtc-flash-suggestion.highlighted {
    background: var(--vtc-bg);
}

.vtc-flash-suggestion-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--vtc-text-light);
    margin-top: 2px;
}

.vtc-flash-suggestion-text {
    font-size: 0.9375rem;
    color: var(--vtc-text);
    line-height: 1.4;
}

/* ==========================================================================
   Bouton Submit
   ========================================================================== */

.vtc-flash-btn-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    margin-top: 24px;
    background: var(--vtc-white);
    color: var(--vtc-primary);
    border: 2px solid var(--vtc-primary);
    border-radius: var(--vtc-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--vtc-transition);
}

.vtc-flash-btn-submit:hover:not(:disabled) {
    background: var(--vtc-primary);
    color: var(--vtc-white);
}

.vtc-flash-btn-submit:active:not(:disabled) {
    transform: scale(0.99);
}

.vtc-flash-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.vtc-flash-btn-icon {
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   Modal de Succès
   ========================================================================== */

.vtc-flash-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.vtc-flash-modal.active {
    display: flex;
}

.vtc-flash-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.vtc-flash-modal-content {
    position: relative;
    background: var(--vtc-white);
    border-radius: var(--vtc-radius);
    padding: 32px 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--vtc-shadow-xl);
    text-align: center;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vtc-flash-modal-content.animate-in {
    transform: scale(1);
    opacity: 1;
}

.vtc-flash-modal-header {
    margin-bottom: 20px;
}

.vtc-flash-success-icon {
    width: 56px;
    height: 56px;
    color: var(--vtc-primary);
    margin-bottom: 12px;
}

.vtc-flash-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--vtc-text);
    margin: 0;
}

.vtc-flash-modal-body {
    margin-bottom: 24px;
}

.vtc-flash-modal-body p {
    font-size: 0.9375rem;
    color: var(--vtc-text-light);
    margin: 0;
}

.vtc-flash-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vtc-flash-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 20px;
    border: none;
    border-radius: var(--vtc-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--vtc-transition);
}

.vtc-flash-btn svg {
    width: 22px;
    height: 22px;
}

.vtc-flash-btn-primary {
    background: var(--vtc-primary);
    color: var(--vtc-white);
}

.vtc-flash-btn-primary:hover {
    background: var(--vtc-primary-light);
    color: var(--vtc-white);
}

.vtc-flash-btn-whatsapp {
    background: var(--vtc-whatsapp);
    color: var(--vtc-white);
}

.vtc-flash-btn-whatsapp:hover {
    background: var(--vtc-whatsapp-dark);
    color: var(--vtc-white);
}

.vtc-flash-btn-new {
    width: 100%;
    padding: 14px;
    margin-top: 16px;
    background: transparent;
    border: 2px dashed var(--vtc-border);
    border-radius: var(--vtc-radius-sm);
    color: var(--vtc-text-light);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--vtc-transition);
}

.vtc-flash-btn-new:hover {
    border-color: var(--vtc-accent);
    color: var(--vtc-accent);
    background: var(--vtc-bg);
}

/* ==========================================================================
   Loader
   ========================================================================== */

.vtc-flash-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
}

.vtc-flash-loader.active {
    display: flex;
}

.vtc-flash-loader-content {
    text-align: center;
}

.vtc-flash-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--vtc-border);
    border-top-color: var(--vtc-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

.vtc-flash-loader-content p {
    font-size: 1rem;
    color: var(--vtc-text);
    font-weight: 500;
    margin: 0;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.vtc-flash-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--vtc-text);
    color: var(--vtc-white);
    border-radius: var(--vtc-radius-sm);
    box-shadow: var(--vtc-shadow-xl);
    font-size: 0.9375rem;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: calc(100vw - 32px);
}

.vtc-flash-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.vtc-flash-toast svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.vtc-flash-toast-error {
    background: var(--vtc-error);
}

/* ==========================================================================
   Message d'erreur (plugin non configuré)
   ========================================================================== */

.vtc-flash-error {
    background: #fed7d7;
    border: 1px solid #fc8181;
    color: #c53030;
    padding: 16px 20px;
    border-radius: var(--vtc-radius-sm);
    font-size: 0.9375rem;
    line-height: 1.5;
}

/* Honeypot - caché des utilisateurs mais visible des bots */
.vtc-flash-hp {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    height: 0;
    width: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

/* ==========================================================================
   Responsive - Tablette et Desktop
   ========================================================================== */

@media (min-width: 640px) {
    .vtc-flash-container {
        padding: 24px;
    }
    
    .vtc-flash-form {
        padding: 32px;
    }
    
    .vtc-flash-title {
        font-size: 1.75rem;
    }
    
    .vtc-flash-modal-actions {
        flex-direction: row;
    }
    
    .vtc-flash-btn {
        flex: 1;
    }
}

/* ==========================================================================
   Mode sombre (respect des préférences utilisateur)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .vtc-flash-container {
        color: #e2e8f0;
    }
    
    .vtc-flash-form {
        background: #1a202c;
        border: 1px solid #2d3748;
    }
    
    .vtc-flash-header {
        border-bottom-color: #2d3748;
    }
    
    .vtc-flash-title {
        color: #90cdf4;
    }
    
    .vtc-flash-label {
        color: #e2e8f0;
    }
    
    .vtc-flash-input {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .vtc-flash-input:focus {
        border-color: var(--vtc-accent);
    }
    
    .vtc-flash-input::placeholder {
        color: #a0aec0;
    }
    
    .vtc-flash-suggestions {
        background: #2d3748;
        border-color: var(--vtc-accent);
    }
    
    .vtc-flash-suggestion:hover,
    .vtc-flash-suggestion.highlighted {
        background: #4a5568;
    }
    
    .vtc-flash-suggestion-text {
        color: #e2e8f0;
    }
    
    .vtc-flash-modal-content {
        background: #1a202c;
    }
    
    .vtc-flash-modal-title {
        color: #90cdf4;
    }
    
    .vtc-flash-loader {
        background: rgba(26, 32, 44, 0.95);
    }
    
    .vtc-flash-loader-content p {
        color: #e2e8f0;
    }
    
    .vtc-flash-btn-time {
        background: #2d3748;
        border-color: #4a5568;
        color: #9ca3af;
    }
    
    .vtc-flash-btn-time:hover {
        background: #4a5568;
        border-color: #9ca3af;
        color: #e2e8f0;
    }
    
    .vtc-flash-btn-time.active {
        background: #4a5568;
        border-color: #6b7280;
        color: #e2e8f0;
    }

    .vtc-flash-btn-geo {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
}
