/* ==========================================================================
   1. VARIÁVEIS E IDENTIDADE VISUAL (TEMA REAL DO ÔNIBUS)
   ========================================================================== */
:root {
    /* Cores fiéis à pintura da Viação */
    --bus-red: #D01018;             /* Vermelho vivo da faixa e letreiro */
    --bus-red-dark: #9E080F;        /* Vermelho escuro para gradientes/hovers */
    --bus-yellow: #FFB703;          /* Amarelo da faixa superior */
    --bus-yellow-hover: #E5A400;    /* Amarelo para hover */
    
    /* Cores neutras da carroceria e suporte */
    --white: #FFFFFF;
    --bg-light: #F4F6F9;            /* Cinza bem claro para contraste de cards */
    --text-dark: #1E293B;           /* Grafite escuro para legibilidade perfeita */
    --text-muted: #64748B;          /* Texto secundário */
    --dark-asphalt: #181D24;        /* Tom escuro neutro para o rodapé */
    --border-color: #E2E8F0;
    
    --radius: 10px;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
    --danger: #EF4444;
}

/* ==========================================================================
   2. RESET E BASE
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

/* ==========================================================================
   3. CABEÇALHO (HEADER) E FAIXA DO ÔNIBUS
   ========================================================================== */
/* Aviso informativo do guichê no topo */
.top-notice-bar {
    background: #FFFBEB;
    color: #92400E;
    padding: 8px 16px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    border-bottom: 1px solid #FDE68A;
}

header {
    background-color: var(--white); /* Carroceria branca limpa */
    color: var(--text-dark);
    padding: 0.9rem 1.5rem 0.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* Efeito da pintura lateral do ônibus (Amarelo fino em cima, Vermelho grosso embaixo) */
header::after {
    content: '';
    display: block;
    width: 100%;
    height: 6px;
    margin-top: 0.8rem;
    background: linear-gradient(
        to bottom,
        var(--bus-yellow) 0%,
        var(--bus-yellow) 35%,
        var(--bus-red) 35%,
        var(--bus-red) 100%
    );
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

/* Logo principal e selo inclinado */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-novo-horizonte,
.logo-box-retro {
    display: inline-flex;
    align-items: center;
    position: relative;
    background: linear-gradient(180deg, var(--bus-red) 0%, var(--bus-red-dark) 100%);
    padding: 6px 20px;
    transform: skewX(-18deg); /* Inclinação lateral clássica */
    border-top: 3px solid var(--bus-yellow);
    border-bottom: 3px solid var(--bus-yellow);
    border-right: 3px solid var(--bus-yellow);
    border-left: 6px solid var(--bus-yellow);
    box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.2);
}

.logo-novo-horizonte .logo-texto,
.logo-box-retro .brand-title {
    display: inline-block;
    transform: skewX(18deg); /* Desfaz a inclinação no texto */
    color: var(--white);
    font-weight: 900;
    font-style: italic; /* Itálico marcante como na lataria */
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* Menu de Navegação */
.nav-menu {
    display: flex;
    gap: 6px;
}

.nav-link {
    background: transparent;
    border: none;
    color: var(--text-dark);
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover {
    color: var(--bus-red);
    background: #FEF2F2;
}

.nav-link.active {
    color: var(--white);
    background: var(--bus-red);
}

/* ==========================================================================
   4. HERO & BARRA DE BUSCA
   ========================================================================== */
.tab-content { display: none; }
.tab-content.active { display: block; }

.hero {
    background: linear-gradient(135deg, var(--bus-red) 0%, var(--bus-red-dark) 100%);
    color: var(--white);
    padding: 3.8rem 1.5rem 5.5rem;
    text-align: center;
    position: relative;
}

.hero h1 {
    font-size: 2.3rem;
    font-weight: 900;
    margin-bottom: 8px;
    text-shadow: 1px 2px 4px rgba(0,0,0,0.25);
}

.hero p {
    color: rgba(255, 255, 255, 0.92);
    font-size: 1.1rem;
    max-width: 620px;
    margin: 0 auto;
}

/* Card Flutuante de Busca */
.search-card {
    max-width: 920px;
    margin: -45px auto 35px;
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 10;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group select, 
.form-group input, 
.form-group textarea {
    padding: 11px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group select:focus,
.form-group input:focus {
    border-color: var(--bus-red);
}

/* Botão de Consulta em Amarelo Ouro */
.btn-search {
    background-color: var(--bus-yellow);
    color: #451A03;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(255, 183, 3, 0.35);
}

.btn-search:hover {
    background-color: var(--bus-yellow-hover);
    transform: translateY(-1px);
}

/* ==========================================================================
   5. CARDS DE HORÁRIOS & SEÇÕES
   ========================================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem 3.5rem;
}

.section-padding { padding-top: 2rem; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.section-header h2 {
    font-weight: 800;
    color: var(--text-dark);
}

.badge-live {
    background: #FEF2F2;
    color: var(--bus-red);
    border: 1px solid #FECACA;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 22px;
}

.schedule-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--bus-red); /* Detalhe do topo em vermelho */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

.schedule-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.1);
}

.route-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-color);
}

.cities {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--bus-red);
}

.badge-obs {
    background: #F1F5F9;
    color: var(--text-muted);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.times-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.time-chip {
    background: #F8FAFC;
    border: 1.5px solid var(--border-color);
    color: var(--text-dark);
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.92rem;
    transition: 0.15s;
}

.time-chip:hover {
    background: var(--bus-red);
    color: var(--white);
    border-color: var(--bus-red);
}

.info-footer {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================================================
   6. SERVIÇOS & SOBRE A EMPRESA
   ========================================================================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.service-card {
    background: var(--white);
    padding: 26px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-top: 4px solid var(--bus-yellow);
}

.service-card i {
    font-size: 2rem;
    color: var(--bus-red);
    margin-bottom: 14px;
}

.service-card h3 {
    margin-bottom: 8px;
    font-size: 1.15rem;
    font-weight: 800;
}

.service-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.about-grid, .contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 35px;
    background: var(--white);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.about-card-box {
    background: linear-gradient(135deg, var(--bus-red) 0%, var(--bus-red-dark) 100%);
    color: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.large-bus-icon {
    font-size: 3.5rem;
    color: var(--bus-yellow);
    margin-bottom: 15px;
}

.phone-highlight {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--bus-yellow);
    margin-top: 10px;
}

.contact-card {
    display: flex;
    gap: 15px;
    align-items: center;
    background: var(--bg-light);
    padding: 16px;
    border-radius: 8px;
    margin-top: 14px;
}

.contact-card i {
    font-size: 1.4rem;
    color: var(--bus-red);
}

/* ==========================================================================
   7. PAINEL ADMINISTRATIVO (ADMIN)
   ========================================================================== */
.admin-body { background: #E2E8F0; }

.admin-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.admin-header {
    background: var(--dark-asphalt);
    border-bottom: 4px solid var(--bus-red);
}

.dash-card {
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.dash-card h3 {
    font-size: 1.15rem;
    color: var(--bus-red);
    margin-bottom: 15px;
    font-weight: 800;
}

.dash-inline-form { display: flex; gap: 10px; }
.dash-inline-form input { flex: 1; padding: 10px 14px; border: 1px solid #CBD5E1; border-radius: 8px; }

.dash-grid-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.dash-table-wrapper { overflow-x: auto; }
.dash-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.dash-table th, .dash-table td { padding: 12px; border: 1px solid var(--border-color); font-size: 0.85rem; text-align: left; }
.dash-table th { background: #F8FAFC; font-weight: 700; color: var(--text-muted); }

.btn-delete-row {
    background: var(--danger);
    color: var(--white);
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.btn-logout {
    background: var(--danger);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
}

/* ==========================================================================
   8. WHATSAPP FLUTUANTE & RODAPÉ
   ========================================================================== */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #25D366;
    color: white;
    width: 55px;
    height: 55px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    text-decoration: none;
    z-index: 999;
    transition: transform 0.2s;
}

.whatsapp-float:hover {
    transform: scale(1.08);
}

footer {
    background-color: var(--dark-asphalt);
    color: var(--white);
    padding: 3rem 1.5rem 1.2rem;
    border-top: 4px solid var(--bus-yellow); /* Detalhe amarelo no topo do rodapé */
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto 2.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
}

.footer-col h4 {
    color: var(--bus-yellow);
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.footer-col p {
    color: #94A3B8;
    font-size: 0.88rem;
    margin-bottom: 8px;
}

.copyright {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    color: #64748B;
}

/* ==========================================================================
   9. RESPONSIVIDADE (MOBILE)
   ========================================================================== */
@media (max-width: 768px) {
    .header-container { flex-direction: column; gap: 12px; }
    .nav-menu { flex-wrap: wrap; justify-content: center; }
    .hero h1 { font-size: 1.8rem; }
    .search-card { margin-top: -30px; }
    .about-grid, .contact-grid { grid-template-columns: 1fr; }
}
/* ==========================================
   ETIQUETA DE PREÇO DA PASSAGEM
   ========================================== */
.badge-price {
    background: #EBFBEE;
    color: #166534;
    font-weight: 800;
    font-size: 0.82rem;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid #BBF7D0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
/* ==========================================
   BARRA DE CATEGORIAS DE CIDADES (CHIPS)
   ========================================== */
.city-chips-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 2px 20px 2px;
    margin-bottom: 15px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Esconde scrollbar feia */
}

.city-chips-bar::-webkit-scrollbar {
    display: none;
}

.chip-btn {
    background: #FFFFFF;
    color: #475569;
    border: 1px solid #CBD5E1;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.chip-btn:hover {
    border-color: var(--bus-red, #D01018);
    color: var(--bus-red, #D01018);
}

.chip-btn.active {
    background: var(--bus-red, #D01018);
    color: #FFFFFF;
    border-color: var(--bus-red, #D01018);
    box-shadow: 0 4px 12px rgba(208, 16, 24, 0.25);
}

/* ORGANIZAÇÃO DOS HORÁRIOS DENTRO DO CARD (ALINHADOS EM GRADE) */
.times-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)) !important;
    gap: 8px !important;
    margin-top: 14px !important;
}

.time-chip {
    text-align: center !important;
    background: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
    padding: 6px 4px !important;
    border-radius: 6px !important;
    font-weight: 800 !important;
    font-size: 0.92rem !important;
    color: #1E293B !important;
}
/* ==========================================
   QUADRO DE HORÁRIOS 100% MOBILE-FIRST
   ========================================== */
.mobile-accordion-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-bottom: 30px;
}

/* O BOTÃO DA CIDADE (GRANDE E FÁCIL DE TOCAR) */
.city-row {
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
}

.city-row.active {
    border-color: var(--bus-red, #D01018);
    box-shadow: 0 4px 15px rgba(208, 16, 24, 0.12);
}

.city-trigger {
    width: 100%;
    padding: 16px 14px;
    background: #FFFFFF;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    text-align: left;
}

.city-trigger-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.city-trigger-left i {
    color: var(--bus-red, #D01018);
    font-size: 1.15rem;
}

.city-trigger-left strong {
    font-size: 1.05rem;
    color: #1E293B;
    font-weight: 800;
}

.city-trigger-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.city-badge-count {
    background: #F1F5F9;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
}

.city-row.active .city-badge-count {
    background: #FEE2E2;
    color: var(--bus-red, #D01018);
}

.city-arrow {
    color: #94A3B8;
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.city-row.active .city-arrow {
    transform: rotate(180deg);
    color: var(--bus-red, #D01018);
}

/* O CONTEÚDO QUE ABRE (IDA E VOLTA) */
.city-content {
    display: none;
    padding: 0 14px 16px 14px;
    background: #FAFAFA;
    border-top: 1px dashed #E2E8F0;
}

.city-row.active .city-content {
    display: block;
}

/* CARD INTERNO DE CADA SENTIDO (IDA OU VOLTA) */
.subroute-card {
    background: #FFFFFF;
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
    border: 1px solid #E2E8F0;
}

.subroute-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 6px;
}

.subroute-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #0F172A;
}

.subroute-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.subroute-time {
    background: #F8FAFC;
    border: 1px solid #CBD5E1;
    color: #0F172A;
    font-weight: 800;
    font-size: 0.88rem;
    padding: 5px 8px;
    border-radius: 6px;
}

.subroute-obs {
    font-size: 0.78rem;
    color: #64748B;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}
/* ==========================================
   QUADRO POR CIDADE E DIAS (PADRÃO OFICIAL)
   ========================================== */
.quadro-cidades-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.card-cidade-oficial {
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden;
}

.cidade-topo-titulo {
    background: #181D24;
    color: #FFFFFF;
    padding: 14px 18px;
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--bus-yellow, #FFB703);
}

.cidade-topo-titulo span i {
    color: var(--bus-yellow, #FFB703);
    margin-right: 8px;
}

.cidade-corpo {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bloco-dias-secao {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 14px;
}

.titulo-dias-faixa {
    font-size: 0.85rem;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px dashed #CBD5E1;
    padding-bottom: 6px;
}

.rota-linha-item {
    margin-bottom: 12px;
}

.rota-linha-item:last-child {
    margin-bottom: 0;
}

.rota-sentido-label {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0F172A;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 6px;
}

.pills-horarios {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pill-hora {
    background: #FFFFFF;
    border: 1.5px solid #94A3B8;
    color: #0F172A;
    font-weight: 800;
    font-size: 0.92rem;
    padding: 5px 10px;
    border-radius: 6px;
}

.rota-obs-texto {
    font-size: 0.78rem;
    color: #64748B;
    margin-top: 5px;
}