/* Reset e Variáveis */
:root {
    --preto: #1a1a1a;
    --cinza-escuro: #2d2d2d;
    --cinza: #404040;
    --cinza-claro: #666;
    --roxo: #8b5cf6;
    --roxo-escuro: #7c3aed;
    --vermelho: #ef4444;
    --branco: #ffffff;
    --fonte: 'Arial', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--fonte);
    background-color: var(--preto);
    color: var(--branco);
    line-height: 1.6;
}

.admin-body {
    background: var(--cinza-escuro);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--preto), var(--cinza-escuro));
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(139, 92, 246, 0.3);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo h1 {
    color: var(--roxo);
    font-size: 1.8rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--branco);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--roxo);
}

.admin-link {
    color: var(--roxo) !important;
    font-weight: bold;
}

/* Admin Header */
.admin-header {
    background: linear-gradient(135deg, var(--preto), var(--cinza-escuro));
    padding: 1rem 0;
    box-shadow: 0 2px 20px rgba(139, 92, 246, 0.3);
}

.admin-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Tela de Login */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--preto), var(--cinza-escuro));
}

.login-container {
    background: var(--cinza-escuro);
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    color: var(--roxo);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-credentials {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--preto);
    border-radius: 8px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--cinza-claro);
}

/* Admin Container */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 20px;
}

/* Dashboard */
.dashboard-section {
    margin-bottom: 3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.stat-card {
    background: var(--cinza-escuro);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--roxo);
}

.stat-card h3 {
    color: var(--cinza-claro);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: var(--roxo);
    font-size: 2.5rem;
    font-weight: bold;
}

/* Management Section */
.management-section {
    background: var(--cinza-escuro);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    color: var(--roxo);
}

/* Lista de Veículos */
.veiculos-list {
    display: grid;
    gap: 1.5rem;
}

.veiculo-item {
    background: var(--preto);
    padding: 1.5rem;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--cinza);
    transition: all 0.3s ease;
}

.veiculo-item:hover {
    border-color: var(--roxo);
    transform: translateY(-2px);
}

.veiculo-info h4 {
    color: var(--roxo);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.veiculo-info p {
    color: var(--cinza-claro);
    margin-bottom: 0.25rem;
}

.veiculo-actions {
    display: flex;
    gap: 0.5rem;
}

/* Seções */
section {
    padding: 100px 0 50px;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--roxo);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Feed de Carros */
.feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.car-card {
    background: var(--cinza-escuro);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.car-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(139, 92, 246, 0.4);
}

/* Carrossel */
.carousel {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: var(--preto);
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(139, 92, 246, 0.8);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.3s ease;
    z-index: 10;
}

.carousel-btn:hover {
    background: var(--roxo);
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 10;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.carousel-dot.active {
    background: var(--roxo);
}

/* Informações do Card */
.car-info {
    padding: 1.5rem;
}

.car-model {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--roxo);
    margin-bottom: 0.5rem;
}

.car-price {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--branco);
    margin-bottom: 1rem;
}

.car-description {
    color: var(--cinza-claro);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Botões */
.btn-primary {
    background: linear-gradient(135deg, var(--roxo), var(--roxo-escuro));
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--roxo);
    border: 2px solid var(--roxo);
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background: var(--roxo);
    color: white;
}

.btn-danger {
    background: var(--vermelho);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.8rem;
    min-height: 36px;
}

/* Formulários */
.veiculo-form, .contact-form, .login-form {
    max-width: 600px;
    margin: 0 auto;
    background: var(--cinza-escuro);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--branco);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--cinza);
    border-radius: 8px;
    background: var(--preto);
    color: var(--branco);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--roxo);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding: 1rem 0;
    position: sticky;
    bottom: 0;
    background: var(--cinza-escuro);
    border-top: 1px solid var(--cinza);
    z-index: 1000;
}

/* Preview de Imagens */
.preview-container {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.preview-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--roxo);
    position: relative;
}

.preview-image .remove-image {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--vermelho);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
}

/* Footer */
.footer {
    background: var(--cinza-escuro);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--roxo);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section p {
    color: var(--cinza-claro);
    margin-bottom: 0.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: var(--cinza-claro);
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--roxo);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--cinza);
    color: var(--cinza-claro);
}

/* ===== CORREÇÕES DO MODAL ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    overflow-y: auto;
}

.modal-content {
    background: var(--cinza-escuro);
    margin: 2% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: modalAppear 0.3s ease;
}

.modal-content.large-modal {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.small-modal {
    max-width: 400px;
    padding: 2rem;
    text-align: center;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    color: var(--branco);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: var(--roxo);
}

.modal-info {
    padding: 2rem;
}

/* Mensagens de estado */
.no-vehicles {
    text-align: center;
    color: var(--cinza-claro);
    font-size: 1.2rem;
    padding: 3rem;
    background: var(--cinza-escuro);
    border-radius: 10px;
    border: 2px dashed var(--cinza);
}

/* Responsividade */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .feed-grid {
        grid-template-columns: 1fr;
    }
    
    .carousel {
        height: 200px;
    }
    
    section {
        padding: 80px 0 30px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal-content.large-modal {
        width: 95%;
        margin: 5% auto;
        max-height: 95vh;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .veiculo-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .veiculo-actions {
        align-self: flex-end;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .preview-container {
        justify-content: center;
    }
    
    .login-container {
        padding: 2rem;
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.4rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .car-price {
        font-size: 1.4rem;
    }
    
    .veiculo-form, .contact-form {
        padding: 1.5rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-card p {
        font-size: 2rem;
    }
}