/* ============ BASE STYLES ============ */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-image: url('../image/bg.jpg') !important;
    background-repeat: repeat;
}

/* ============ LAYOUT STRUCTURE ============ */
.container {
    flex: 1;
    width: 100%;
    overflow: visible !important;
}

/* ============ GENERAL COMPONENTS ============ */
/* Cards */
.card {
    border-radius: 12px !important;
    border-bottom: solid 1px #DCDCDC;
}

.card .card-content {
    padding: 15px;
    padding-top: 25px !important;
    padding-bottom: 5px !important;
}

.highlight {
    border-radius: 12px !important;
    border-bottom: solid 1px #DCDCDC !important;
}

/* Modal */
.modal {
    margin-top: 10px !important;
    width: 80% !important;
    height: calc(90% - 40px) !important;
    max-height: 900px !important;
    border-radius: 12px !important;
    border-bottom: solid 1px #DCDCDC !important;
}

.modal-veiculo {
    width: 70%;
    max-width: 900px;
}

.modal .modal-footer .btn-flat {
    color: #373252;
}

.modal-content {
    padding: 24px;
    text-align: center;
    height: calc(100% - 56px) !important;
    min-height: calc(100% - 56px) !important;
    box-sizing: border-box;
}

/* Image Modal */
#modal-foto {
    z-index: 1000 !important;
    background-color: rgba(0, 0, 0, 0.95) !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden !important;
}

#modal-foto .modal-content {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#modal-img {
    max-width: 100%;
    max-height: 80%;
    object-fit: contain;
    border-radius: 12px;
}

#modal-foto .fechar {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 36px;
    font-weight: bold;
    color: #404040;
    cursor: pointer;
}

#modal-info {
    background: transparent;
    position: absolute;
    bottom: 25px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Chip */
.chip {
    font-size: 18px;
    font-weight: 800;
    border-radius: 25px;
    padding: 0 20px;
    height: 36px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* ============ THEME STYLES ============ */
/* Purple Theme */
.btn-nubank {
    background-color: #7168A4 !important;
    border-radius: 50px;
    text-transform: none;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.btn-nubank:hover {
    background-color: #373252 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-excluir {
    background-color: #ff4d4d !important;
    border-radius: 24px;
}

.btn-excluir:hover {
    background-color: #e60000 !important;
}

.btn-editar {
    background-color: #7168A4 !important;
    border-radius: 24px;
}

.btn-editar:hover {
    background-color: #373252 !important;
}

.btn-filtrar {
    background-color: #4a148c !important;
    border-radius: 24px;
}

.purple tr,
.purple th {
    background-color: #7168A4 !important;
    color: white !important;
}

.purple-text {
    color: #373252 !important;
}

.purple {
    color: #373252 !important;
}

.titulo-secao {
    font-size: 1.8rem;
    font-weight: normal;
    color: #373252 !important; 
    padding: 6px 15px;
    margin: 8px 0 12px;
}

/* ============ VEHICLE PAGE STYLES ============ */
/* Vehicle Grid */
.veiculos-grid {
    display: grid;
    gap: 20px;
    padding: 10px;
    margin: 20px 0;
}

/* Vehicle Cards */
.veiculo-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 373px;
    width: 100%;
    box-sizing: border-box;
    border: solid 1px #EDEDED;
    padding: 10px;
}

.veiculo-card-th {
    background-image: url('../image/bg_sth_2.png');
    background-position: top left;
    background-repeat: no-repeat;
    color: #FFFFFF !important;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.4), 0 0 8px rgba(255, 213, 79, 0.5) inset;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 373px;
    width: 100%;
    box-sizing: border-box;
    border-left: 0px solid #FFFFF;
    border-top: 2px solid #F5F5F5;
    border-bottom: 3px solid #AF3215;
    border-right: 2px solid #F5F5F5;
    padding: 10px;
    position: relative;
    background-clip: padding-box;
}

/* Card Image Container */
.card-image-container {
    width: calc(100% - 16px);
    height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 15px;
    position: relative;
    background: white;
    border-radius: 8px;
    padding: 8px;
    overflow: hidden;
}

.card-image-container img {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease;
}

.veiculo-card:hover .card-image-container img {
    transform: scale(1.05);
}

/* Card Top */
.card-top {
    height: 0;
    padding: 0;
    overflow: hidden;
}

/* Card Info */
.card-info {
    padding: 0 15px 15px;
    text-align: center;
    flex-grow: 1;
}

.veiculo-nome {
    color: #333;
    font-weight: 600;
    margin: 8px 0 4px;
    font-size: 1.1rem;
}

.veiculo-serie, .veiculo-ano {
    color: #666;
    font-size: 0.9rem;
    margin: 3px 0;
}

/* TH Card Text */
.veiculo-card-th .veiculo-nome,
.veiculo-card-th .veiculo-serie,
.veiculo-card-th .veiculo-ano {
    color: #FFFFFF;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
    font-weight: bold;
}

/* Card Actions */
.card-actions {
    padding: 0 15px 20px;
    text-align: center;
}

.btn-associar {
    width: 100%;
    margin: 0;
    transition: all 0.3s ease;
    text-transform: capitalize !important;
}

/* Hover Effects */
.veiculo-card:hover {
    transform: translateY(-5px);
}

.veiculo-card-th:hover {
    box-shadow: 0 0 16px rgba(255, 248, 225, 0.7), 0 0 24px rgba(156, 39, 176, 0.5);
    transform: scale(1.015);
}

/* ============ UTILITY CLASSES ============ */
.switch label {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
    text-align: left;
}

/* Link Styles */
a.colecao-link {
    color: inherit;
    text-decoration: none;
    display: block;
    padding: 8px 0;
    transition: color 0.3s;
}

a.colecao-link:hover {
    color: #7168A4;
    text-decoration: underline;
}

/* Modal Overlay */
.modal-overlay {
    background-color: rgba(0, 0, 0, 0.85) !important;
    backdrop-filter: blur(4px);
    z-index: 10000 !important;
}

/* Z-index Management */
nav {
    z-index: 998;
}

.user-panel {
    z-index: 997;
}

/* ============ ANIMATIONS ============ */
.pulse {
    animation: pulse 0.5s;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ============ RESPONSIVE STYLES ============ */
@media (max-width: 600px) {
    h4.purple-text {
        font-size: 1.3rem;
        margin: 0.5rem 0;
    }
    
    .veiculos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 8px;
    }
    
    .veiculo-card, .veiculo-card-th {
        min-height: 320px;
        padding: 8px;
        padding-top: 10px;
    }
    
    .card-image-container {
        height: 180px;
        margin-bottom: 10px;
    }
    
    .veiculo-nome {
        font-size: 1rem;
        margin: 5px 0 3px;
    }
    
    .veiculo-serie, .veiculo-ano {
        font-size: 0.8rem;
    }
    
    .btn-associar {
        padding: 0 8px;
        font-size: 0.9rem;
    }
}

@media (min-width: 600px) and (max-width: 899px) {
    .veiculos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) and (max-width: 1199px) {
    .veiculos-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .veiculos-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 400px) {
    .veiculos-grid {
        grid-template-columns: 1fr;
    }
    
    .card-image-container {
        height: 200px;
    }
}