/**
 * Meio Norte Express - Animações e Transições Profissionais
 */

/* ============================================
   VARIÁVEIS DE ANIMAÇÃO
   ============================================ */
:root {
    --animation-fast: 0.2s;
    --animation-normal: 0.3s;
    --animation-slow: 0.5s;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out-expo: cubic-bezier(0.87, 0, 0.13, 1);
}

/* ============================================
   TRANSIÇÕES GERAIS
   ============================================ */
a, button, .btn, .nav-link, .service-card, 
.hero-consultation-card, .info-card, .timeline-item,
input, select, textarea {
    transition: all var(--animation-normal) var(--ease-out-expo);
}

/* ============================================
   ANIMAÇÕES DE ENTRADA
   ============================================ */

/* Fade In Up */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s var(--ease-out-expo) forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scale In */
.scale-in {
    opacity: 0;
    transform: scale(0.9);
    animation: scaleIn 0.5s var(--ease-out-expo) forwards;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide In Left */
.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    animation: slideInLeft 0.6s var(--ease-out-expo) forwards;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In Right */
.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    animation: slideInRight 0.6s var(--ease-out-expo) forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   MODAL ANIMAÇÕES
   ============================================ */
.modal-overlay {
    opacity: 0;
    transition: opacity var(--animation-normal) ease;
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.show {
    opacity: 1;
}

.modal-content {
    transform: translateY(-20px) scale(0.95);
    opacity: 0;
    transition: all var(--animation-normal) var(--ease-out-expo);
    background: #fff;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-overlay.show .modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: var(--primary-color, #0066cc);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #6b7280;
    cursor: pointer;
    padding: 5px;
    border-radius: 8px;
    transition: all var(--animation-fast);
}

.modal-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-info {
    text-align: center;
    color: #6b7280;
    margin-bottom: 20px;
}

.modal-contact-info {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
}

.modal-contact-info p {
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-contact-info i {
    color: var(--primary-color, #0066cc);
    width: 20px;
    text-align: center;
}

/* Quote Modal */
.quote-modal {
    max-width: 700px;
}

.quote-modal h4 {
    color: var(--primary-color, #0066cc);
    margin: 20px 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
    font-size: 1rem;
}

.quote-modal h4:first-child {
    margin-top: 0;
}

/* ============================================
   NOTIFICAÇÕES
   ============================================ */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 18px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 350px;
    max-width: 500px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transform: translateX(120%);
    transition: transform var(--animation-normal) var(--ease-out-expo), box-shadow 0.3s ease;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
}

.notification.show {
    transform: translateX(0);
}

.notification:hover {
    transform: translateX(-5px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.notification.error {
    border-left: 5px solid rgba(255, 255, 255, 0.8);
    animation: slideInError 0.4s ease, pulseError 2s ease infinite;
}

.notification i {
    font-size: 1.25rem;
}

.notification span {
    flex: 1;
    font-size: 0.95rem;
}

.notification-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    padding: 5px;
    font-size: 0.9rem;
    transition: opacity var(--animation-fast);
}

.notification-close:hover {
    opacity: 1;
}

/* Notification Types */
.notification-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.notification-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.notification-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.notification-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

@keyframes slideInError {
    0% {
        transform: translateX(120%) scale(0.9);
        opacity: 0;
    }
    50% {
        transform: translateX(-10px) scale(1.02);
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes pulseError {
    0%, 100% {
        box-shadow: 0 15px 40px rgba(239, 68, 68, 0.3);
    }
    50% {
        box-shadow: 0 15px 40px rgba(239, 68, 68, 0.5), 0 0 20px rgba(239, 68, 68, 0.3);
    }
}

/* ============================================
   LOADER GLOBAL
   ============================================ */
.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity var(--animation-normal);
}

.global-loader.show {
    opacity: 1;
}

.loader-content {
    text-align: center;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--primary-color, #0066cc);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader-message {
    color: #374151;
    font-size: 1rem;
    font-weight: 500;
}

/* ============================================
   TRACKING INFO CARD
   ============================================ */
.tracking-info-card {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
}

.info-row {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-item {
    flex: 1;
}

.info-item label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 4px;
}

.info-item span {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    color: #1e293b;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge.status-aguardando-embarque {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.status-em-trânsito,
.status-badge.status-embarque-realizado {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.status-entregue {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.status-cancelado,
.status-badge.status-devolvido {
    background: #fee2e2;
    color: #991b1b;
}

/* ============================================
   TIMELINE MELHORADA
   ============================================ */
.tracking-timeline {
    position: relative;
    padding-left: 30px;
}

.tracking-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-color, #0066cc), #e5e7eb);
}

.timeline-item {
    position: relative;
    padding: 0 0 24px 20px;
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInTimeline 0.4s var(--ease-out-expo) forwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideInTimeline {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -30px;
    width: 24px;
    height: 24px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #9ca3af;
    transition: all var(--animation-normal);
}

.timeline-item.active .timeline-marker {
    background: var(--primary-color, #0066cc);
    border-color: var(--primary-color, #0066cc);
    color: white;
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.2);
}

.timeline-content {
    background: #fff;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.timeline-item.active .timeline-content {
    border-color: var(--primary-color, #0066cc);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.1);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.timeline-header h4 {
    margin: 0;
    font-size: 1rem;
    color: #1f2937;
}

.timeline-date {
    font-size: 0.8rem;
    color: #9ca3af;
    white-space: nowrap;
}

.timeline-content p {
    margin: 0 0 8px;
    color: #6b7280;
    font-size: 0.9rem;
}

.timeline-location {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #9ca3af;
}

.timeline-location i {
    color: var(--primary-color, #0066cc);
}

/* ============================================
   HOVER EFFECTS
   ============================================ */
.btn:hover, 
.service-card:hover, 
.hero-consultation-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.nav-link:hover {
    color: var(--primary-color, #0066cc);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .notification {
        left: 20px;
        right: 20px;
        min-width: auto;
        max-width: none;
    }
    
    .info-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .modal-content {
        margin: 20px;
        max-height: calc(100vh - 40px);
    }
}
