/* Custom Styles for AutoStock */

:root {
    --primary-color: #0D47A1;
    --secondary-color: #1A73E8;
    --text-color: #424242;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #0D47A1 0%, #1A73E8 50%, #0D47A1 100%);
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-pattern {
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.min-vh-75 {
    min-height: 75vh;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Card Hover Effect */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Navbar */
.navbar-brand {
    font-size: 1.25rem;
}

.nav-link {
    transition: opacity 0.3s ease;
}

.nav-link:hover {
    opacity: 0.8;
}

/* Buttons */
.btn {
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

/* Forms */
.form-control:focus,
.form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.25rem rgba(26, 115, 232, 0.25);
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Dashboard Styles */
.sidebar {
    min-height: calc(100vh - 56px);
    background-color: #f8f9fa;
    transition: left 0.3s ease;
}

.sidebar .nav-link {
    color: var(--text-color);
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: var(--secondary-color);
    color: white;
}

/* Sidebar Mobile */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 56px;
        bottom: 0;
        width: 280px;
        z-index: 1040;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        overflow-y: auto;
        transition: left 0.3s ease;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1039;
        transition: opacity 0.3s ease;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    /* Ajustar conteúdo quando sidebar está aberta */
    body.sidebar-open {
        overflow: hidden;
    }
    
    /* Garantir que conteúdo principal não fique atrás da sidebar */
    .container-fluid > .row > main,
    .container-fluid > .row > .col-md-9,
    .container-fluid > .row > .col-lg-10 {
        width: 100%;
        margin-left: 0 !important;
    }
    
    /* Em mobile, o navbar-toggler controla a sidebar */
    /* O collapse do navbar pode ser ocultado se não houver muitos itens */
    /* Garantir que navbar-toggler seja visível */
    .navbar-toggler {
        display: block !important;
    }
    
    /* Se o navbar só tiver um item (Sair), pode exibir diretamente em mobile */
    .navbar-collapse .navbar-nav:only-child .nav-item:only-child .nav-link {
        padding: 0.5rem 1rem;
    }
}

/* Vehicle Card */
.vehicle-card {
    transition: transform 0.3s ease;
}

.vehicle-card:hover {
    transform: scale(1.02);
}

.vehicle-card img {
    height: 200px;
    object-fit: cover;
}

/* Stats Card */
.stats-card {
    border-left: 4px solid var(--secondary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        min-height: auto;
        padding: 3rem 0;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .display-5 {
        font-size: 1.75rem;
    }
    
    /* Botões com tamanho mínimo para touch */
    .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.5rem 1rem;
    }
    
    .btn-sm {
        min-height: 36px;
        min-width: 36px;
    }
    
    /* Espaçamento entre elementos clicáveis */
    .btn + .btn,
    .nav-link + .nav-link {
        margin-top: 0.5rem;
    }
    
    /* Formulários responsivos */
    .form-control,
    .form-select {
        font-size: 16px; /* Evita zoom no iOS */
        min-height: 44px;
    }
    
    /* Cards de tabela para mobile */
    .table-mobile-card {
        display: block;
    }
    
    .table-mobile-card thead {
        display: none;
    }
    
    .table-mobile-card tbody,
    .table-mobile-card tr,
    .table-mobile-card td {
        display: block;
        width: 100%;
    }
    
    .table-mobile-card tr {
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
        padding: 1rem;
        background: white;
    }
    
    .table-mobile-card td {
        border: none;
        padding: 0.5rem 0;
        text-align: left !important;
    }
    
    .table-mobile-card td:before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: var(--text-color);
    }
    
    /* Ocultar tabela desktop em mobile */
    .table-desktop {
        display: none;
    }
}

/* Utilities */
.text-balance {
    text-wrap: balance;
}

.bg-opacity-10 {
    background-color: rgba(var(--bs-primary-rgb), 0.1) !important;
}

.backdrop-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Feature Cards */
.feature-card {
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.feature-card:hover {
    background-color: #e3f2fd;
    transform: translateY(-5px);
}

/* Text utilities */
.text-white-50 {
    color: rgba(255, 255, 255, 0.5) !important;
}

.text-white-50:hover {
    color: rgba(255, 255, 255, 0.75) !important;
}

/* Logo Standardization */
.logo {
    max-width: 220px;
    height: auto;
    object-fit: contain;
}

.logo-preview {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

#logoPreview {
    background: #f8f9fa !important;
    border: 2px solid #dee2e6;
    border-radius: 8px;
}

.header-logo {
    height: 64px;
    max-height: 72px;
    max-width: 300px;
    width: auto;
    object-fit: contain;
}

@media (max-width: 768px) {
    .logo {
        max-width: 150px;
    }
    
    #logoPreview {
        min-width: 200px !important;
        min-height: 80px !important;
        max-width: 100% !important;
    }
    
    .header-logo {
        height: 48px;
        max-height: 56px;
        max-width: 200px;
    }
    
    /* Modal de filtros */
    .filters-modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: white;
        z-index: 1050;
        overflow-y: auto;
        display: none;
    }
    
    .filters-modal.show {
        display: block;
    }
    
    /* Botão CTA flutuante mobile */
    .cta-button-mobile {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        border-radius: 0;
        margin: 0;
        padding: 1rem;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    }
    
    /* Upload de imagens mobile */
    .image-upload-area {
        min-height: 120px;
        padding: 1.5rem;
    }
    
    /* Lazy loading de imagens */
    img[loading="lazy"] {
        opacity: 0;
        transition: opacity 0.3s;
    }
    
    img[loading="lazy"].loaded {
        opacity: 1;
    }
}
