/* ============================================
   ShipMZ - Main CSS
   Shipping & Logistics Theme (Maritime Blue)
   ============================================ */

/* Reset and base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --azul-primario: #0e4d8f;
    --azul-escuro: #0a3460;
    --azul-claro: #1a6fc4;
    --amarelo: #f0a500;
    --cinza-azul: #5a6878;
    --texto: #1a1a2e;
    --texto-suave: #5a6878;
    --fundo: #ffffff;
    --fundo-suave: #f0f4f9;
    --borda: #d0dae6;
    --sombra: 0 2px 8px rgba(0,0,0,0.08);
    --sombra-media: 0 4px 16px rgba(0,0,0,0.12);
    /* Keep verde aliases for backward compat with any remaining references */
    --verde-primario: #0e4d8f;
    --verde-escuro: #0a3460;
    --verde-claro: #1a6fc4;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Roboto, -apple-system, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--texto);
    background: var(--fundo);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--azul-primario);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--azul-escuro);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--texto);
}

h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 1rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.75rem; }

p { margin-bottom: 1rem; }

/* ============================================
   HEADER
   ============================================ */
.site-header {
    background: #fff;
    box-shadow: var(--sombra);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 20px;
}

.logo {
    font-size: 1.5rem;
    color: var(--azul-primario);
    font-weight: 800;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.main-nav ul a {
    color: var(--texto);
    font-weight: 500;
}

.main-nav ul a:hover {
    color: var(--azul-primario);
}

.nav-auth {
    display: flex;
    gap: 0.5rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: 2px solid transparent;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: var(--azul-primario);
    color: white;
    border-color: var(--azul-primario);
}

.btn-primary:hover {
    background: var(--azul-escuro);
    border-color: var(--azul-escuro);
    color: white;
    transform: translateY(-1px);
}

.btn-outline {
    border-color: var(--azul-primario);
    color: var(--azul-primario);
    background: transparent;
}

.btn-outline:hover {
    background: var(--azul-primario);
    color: white;
}

.btn-large {
    padding: 0.9rem 2rem;
    font-size: 1.05rem;
}

/* ============================================
   HERO
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--azul-primario) 0%, var(--azul-escuro) 100%);
    color: white;
    padding: 5rem 0;
    text-align: center;
}

.hero h1 {
    color: white;
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    max-width: 700px;
    margin: 0 auto 2rem;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero .btn-primary {
    background: var(--amarelo);
    color: var(--texto);
}

.hero .btn-primary:hover {
    background: #d4900a;
}

.hero .btn-outline {
    border-color: white;
    color: white;
}

.hero .btn-outline:hover {
    background: white;
    color: var(--azul-primario);
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    padding: 4rem 0;
}

.section-alt {
    background: var(--fundo-suave);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    margin-bottom: 0.5rem;
}

.section-title p {
    color: var(--texto-suave);
    font-size: 1.1rem;
}

/* ============================================
   GRIDS
   ============================================ */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: var(--sombra);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sombra-media);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: var(--azul-primario);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.card h3 {
    color: var(--azul-primario);
    margin-bottom: 0.5rem;
}

/* Article card */
.article-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--sombra);
    transition: transform 0.2s;
}

.article-card:hover {
    transform: translateY(-4px);
}

.article-card-image {
    height: 200px;
    background: linear-gradient(135deg, var(--azul-claro), var(--azul-primario));
    background-size: cover;
    background-position: center;
}

.article-card-body {
    padding: 1.5rem;
}

.article-card-meta {
    font-size: 0.85rem;
    color: var(--texto-suave);
    margin-bottom: 0.5rem;
}

.article-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.article-card h3 a {
    color: var(--texto);
}

.article-card h3 a:hover {
    color: var(--azul-primario);
}

/* ============================================
   CTA (Call to Action)
   ============================================ */
.cta {
    background: var(--azul-primario);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.cta h2 {
    color: white;
}

.cta p {
    font-size: 1.15rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta .btn-primary {
    background: var(--amarelo);
    color: var(--texto);
}

/* ============================================
   STATS
   ============================================ */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--azul-primario);
    display: block;
}

.stat-label {
    color: var(--texto-suave);
    font-weight: 500;
}

/* ============================================
   FORMS
   ============================================ */
.form-box {
    max-width: 450px;
    margin: 3rem auto;
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--sombra-media);
}

.form-box h1 {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--texto);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--borda);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--azul-primario);
}

.form-box .btn {
    width: 100%;
    padding: 0.9rem;
    font-size: 1.05rem;
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--texto-suave);
}

/* ============================================
   ALERTS / FLASH
   ============================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: #e8f5e9;
    color: #1b5e20;
    border-color: #4caf50;
}

.alert-error {
    background: #ffebee;
    color: #b71c1c;
    border-color: #f44336;
}

.alert-warning {
    background: #fff8e1;
    color: #e65100;
    border-color: #ff9800;
}

.alert-info {
    background: #e3f2fd;
    color: #0d47a1;
    border-color: #2196f3;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: #0d1b2a;
    color: #9ab3cc;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.site-footer h3,
.site-footer h4 {
    color: white;
    margin-bottom: 1rem;
}

.site-footer ul {
    list-style: none;
}

.site-footer ul li {
    margin-bottom: 0.5rem;
}

.site-footer a {
    color: #9ab3cc;
}

.site-footer a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #1b3a5c;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    
    .hero {
        padding: 3rem 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .site-header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-nav {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .main-nav ul {
        gap: 1rem;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .section {
        padding: 2.5rem 0;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* ============================================
   NAVBAR Bootstrap Custom
   ============================================ */

.site-navbar {
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    padding: 0.75rem 0;
    transition: box-shadow 0.2s, padding 0.2s;
}

.site-navbar.scrolled {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 0.5rem 0;
}

/* Logo */
.navbar-brand {
    color: var(--azul-primario) !important;
    font-size: 1.4rem;
    transition: color 0.2s;
}

.navbar-brand:hover {
    color: var(--azul-escuro) !important;
}

.navbar-logo {
    max-height: 42px;
    width: auto;
    object-fit: contain;
}

.brand-text {
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Menu items */
.navbar .nav-link {
    color: #1a1a2e !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 6px;
    transition: all 0.2s;
    position: relative;
}

.navbar .nav-link:hover {
    color: var(--azul-primario) !important;
    background: rgba(14, 77, 143, 0.06);
}

.navbar .nav-link.active {
    color: var(--azul-primario) !important;
    font-weight: 600;
}

/* Active page indicator */
.navbar .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: var(--azul-primario);
    border-radius: 2px;
}

@media (max-width: 991px) {
    .navbar .nav-link.active::after {
        display: none;
    }
    .navbar .nav-link.active {
        background: rgba(14, 77, 143, 0.08);
    }
}

/* Dropdowns */
.dropdown-menu {
    border: 1px solid #d0dae6;
    border-radius: 8px;
    padding: 0.5rem;
    margin-top: 0.5rem !important;
    min-width: 220px;
}

.dropdown-item {
    border-radius: 5px;
    padding: 0.55rem 0.85rem;
    font-size: 0.92rem;
    transition: all 0.15s;
}

.dropdown-item:hover {
    background: rgba(14, 77, 143, 0.08);
    color: var(--azul-escuro);
}

.dropdown-item:active,
.dropdown-item.active {
    background: var(--azul-primario);
    color: white;
}

/* Desktop search */
.search-form {
    min-width: 220px;
}

.search-form .form-control {
    border-color: #d0dae6;
}

.search-form .form-control:focus {
    border-color: var(--azul-primario);
    box-shadow: 0 0 0 0.2rem rgba(14, 77, 143, 0.15);
}

.search-form .btn-outline-success,
.search-form .btn-outline-primary {
    border-color: var(--azul-primario);
    color: var(--azul-primario);
}

.search-form .btn-outline-success:hover,
.search-form .btn-outline-primary:hover {
    background: var(--azul-primario);
    color: white;
}

/* User avatar */
.user-avatar {
    width: 30px;
    height: 30px;
    background: var(--azul-primario);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.user-dropdown .btn {
    border: 1px solid #d0dae6;
    background: #f8fafc;
    font-weight: 500;
}

.user-dropdown .btn:hover,
.user-dropdown .btn:focus {
    background: #edf2f7;
    border-color: #c0ccd8;
}

/* Blue buttons (override Bootstrap green) */
.btn-success {
    background: var(--azul-primario);
    border-color: var(--azul-primario);
}

.btn-success:hover,
.btn-success:focus {
    background: var(--azul-escuro);
    border-color: var(--azul-escuro);
}

.btn-outline-success {
    color: var(--azul-primario);
    border-color: var(--azul-primario);
}

.btn-outline-success:hover {
    background: var(--azul-primario);
    border-color: var(--azul-primario);
    color: white;
}

/* Text color overrides */
.text-success {
    color: var(--azul-primario) !important;
}

/* Toggler hamburger */
.navbar-toggler {
    border: 1px solid #d0dae6;
    padding: 0.4rem 0.6rem;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(14, 77, 143, 0.2);
}

/* ============================================
   MOBILE
   ============================================ */
@media (max-width: 991px) {
    .site-navbar {
        padding: 0.6rem 0;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-collapse {
        padding-top: 1rem;
        margin-top: 0.5rem;
        border-top: 1px solid #e0e6ed;
    }
    
    .navbar .nav-link {
        padding: 0.7rem 0.5rem !important;
        border-radius: 6px;
    }
    
    .navbar .nav-link i {
        width: 22px;
        text-align: center;
        color: #5a6878;
    }
    
    .navbar-nav {
        margin-bottom: 0.75rem !important;
    }
    
    .dropdown-menu {
        border: none;
        background: #f8fafc;
        margin: 0.25rem 0 0.5rem 1.5rem !important;
        padding: 0.25rem;
        box-shadow: none;
    }
    
    .user-dropdown {
        width: 100%;
    }
}