/**
 * 🏠 HOME STYLE - RotaTruck v5.0
 * Estilos específicos da tela inicial
 * Baseado na imagem oficial.png
 */

/* ==================== AJUSTES ESPECÍFICOS DA HOME ==================== */

/* Garantir que o card fique centralizado verticalmente */
.app-content {
    justify-content: flex-start;
    padding-top: 0;
}

/* Card de rota - ajustes visuais */
.card-route {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* Logo maior e mais destaque */
.app-header .logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--color-bg-dark) 0%, #1a1f25 100%);
    box-shadow: var(--shadow-lg);
}

.app-header .logo-icon svg,
.app-header .logo-icon img {
    width: 40px;
    height: 40px;
}

/* Título maior */
.app-header h1 {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    background: linear-gradient(135deg, #FFFFFF 0%, #EDEDED 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


/* ==================== FORM ESPECÍFICO ==================== */

/* Labels com mais destaque */
.card-route .form-label {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
}

/* Inputs maiores e mais espaçados */
.card-route .form-input,
.card-route .form-select {
    height: 48px;
    font-size: var(--font-size-md);
    border-width: 1.5px;
}

.card-route .form-input:focus,
.card-route .form-select:focus {
    border-width: 1.5px;
}

/* Botão GPS com destaque */
.card-route .btn-gps {
    width: 48px;
    height: 48px;
    font-size: var(--font-size-xl);
    box-shadow: var(--shadow-md);
}

.card-route .btn-gps:hover {
    box-shadow: var(--shadow-lg), var(--shadow-glow-primary);
}

/* Select com seta maior */
.card-route .form-select {
    background-size: 14px;
    background-position: right var(--spacing-md) center;
}


/* ==================== BOTÃO CALCULAR (DESTAQUE) ==================== */

.btn-calcular {
    margin-top: var(--spacing-lg);
    height: 56px;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.02em;
    text-transform: none;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.btn-calcular::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-calcular:hover::before {
    width: 300px;
    height: 300px;
}

.btn-calcular:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl), var(--shadow-glow-primary);
}

.btn-calcular:active {
    transform: translateY(-1px);
}

/* Ícone do foguete no botão */
.btn-calcular svg,
.btn-calcular i {
    font-size: 22px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}


/* ==================== SIDEBAR - VISUAL NA HOME ==================== */

/* Sidebar com mais transparência na home */
.sidebar {
    background: rgba(0, 0, 0, 0.5);
}

/* Nav items na home - mais sutil */
.nav-item {
    font-size: 10px;
    font-weight: var(--font-weight-semibold);
    text-transform: capitalize;
}

/* Ícones maiores */
.nav-item svg,
.nav-item i {
    font-size: 24px;
    margin-bottom: 2px;
}

/* Item ativo com mais destaque */
.nav-item.active {
    background: rgba(255, 107, 53, 0.15);
    color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

.nav-item.active::before {
    width: 4px;
    height: 32px;
    box-shadow: var(--shadow-glow-primary);
}


/* ==================== ANIMAÇÕES SUTIS ==================== */

/* Fade-in suave ao carregar */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-header {
    animation: fadeInUp 0.5s ease var(--ease-out) forwards;
}

.card-route {
    animation: fadeInUp 0.6s ease var(--ease-out) 0.1s forwards;
    opacity: 0;
    animation-fill-mode: forwards;
}

/* Hover suave nos inputs */
.form-input:hover,
.form-select:hover {
    border-color: rgba(255, 107, 53, 0.3);
}

/* Transição suave ao focar */
.form-input:focus,
.form-select:focus {
    transform: translateY(-1px);
}


/* ==================== ESTADOS DE VALIDAÇÃO ==================== */

/* Input inválido */
.form-input.invalid,
.form-select.invalid {
    border-color: var(--color-error);
}

.form-input.invalid:focus,
.form-select.invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Mensagem de erro */
.form-error {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--color-error);
    margin-top: var(--spacing-xs);
    animation: fadeInUp 0.3s ease;
}

/* Input válido (opcional) */
.form-input.valid {
    border-color: var(--color-success);
}


/* ==================== LOADING STATE ==================== */

/* Botão em loading */
.btn-calcular.loading {
    pointer-events: none;
    position: relative;
    color: transparent;
}

.btn-calcular.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}


/* ==================== BACKGROUND OVERLAY ==================== */

/* Overlay escuro sobre o mapa (mais contraste) */
.app-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(15, 18, 22, 0.85) 0%,
        rgba(15, 18, 22, 0.75) 50%,
        rgba(15, 18, 22, 0.85) 100%
    );
    z-index: var(--z-mapa);
    pointer-events: none;
}


/* ==================== RESPONSIVE - MOBILE ==================== */

@media (max-width: 768px) {
    .app-header h1 {
        font-size: var(--font-size-2xl);
    }
    
    .card-route {
        max-width: none;
        margin: 0 var(--spacing-md) var(--spacing-md);
    }
    
    .btn-calcular {
        height: 52px;
        font-size: var(--font-size-md);
    }
}

@media (max-width: 480px) {
    .app-header {
        gap: var(--spacing-sm);
    }
    
    .app-header .logo-icon {
        width: 52px;
        height: 52px;
    }
    
    .app-header .logo-icon svg,
    .app-header .logo-icon img {
        width: 32px;
        height: 32px;
    }
    
    .app-header h1 {
        font-size: var(--font-size-xl);
    }
    
    .card-route {
        padding: var(--spacing-lg);
    }
    
    .card-route h2 {
        font-size: var(--font-size-lg);
    }
    
    .form-input,
    .form-select,
    .btn-gps {
        height: 44px;
    }
    
    .btn-calcular {
        height: 48px;
    }
}

/* iPhone SE e menores */
@media (max-width: 375px) {
    .card-route {
        padding: var(--spacing-md);
    }
    
    .form-group {
        margin-bottom: var(--spacing-md);
    }
}


/* ==================== ACESSIBILIDADE ==================== */

/* Focus visible para teclado */
.btn:focus-visible,
.form-input:focus-visible,
.form-select:focus-visible,
.nav-item:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Reduzir animações para quem prefere */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* ==================== DARK MODE (garantia) ==================== */

/* Forçar dark mode mesmo se sistema estiver light */
@media (prefers-color-scheme: light) {
    :root {
        color-scheme: dark;
    }
    
    body {
        background: var(--color-bg);
        color: var(--color-text);
    }
}