/* Estilos específicos para a página de gerenciamento de veículos */

:root {
    --primary-orange: #f37021;
    --dark-orange: #d65a0e;
    --light-orange: #fff4ed;
    --card-bg: white;
    --text-main: #333;
    --text-sub: #666;
    --border-radius: 12px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
}

/* ========== HEADER ========== */
.page-header {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-left h1 {
    color: var(--text-main);
    font-size: 1.8rem;
    margin: 0;
}

.btn-back {
    background: var(--light-orange);
    color: var(--primary-orange);
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-back:hover {
    background: var(--primary-orange);
    color: white;
    transform: translateX(-5px);
}

.btn-add-vehicle {
    background: var(--primary-orange);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-add-vehicle:hover {
    background: var(--dark-orange);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========== BARRA DE CONTROLES ========== */
.controls-bar {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-box input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(243, 112, 33, 0.1);
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* ========== FILTROS ========== */
.filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 18px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    background: #e0e0e0;
}

.filter-btn.active {
    background: var(--primary-orange);
    color: white;
    border-color: var(--primary-orange);
}

/* ========== ORDENAÇÃO ========== */
.sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-select {
    padding: 10px 35px 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    background: white;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary-orange);
}

/* ========== CONTADOR DE VEÍCULOS ========== */
.vehicle-count {
    padding: 12px 20px;
    background: var(--light-orange);
    border-radius: 8px;
    font-weight: 600;
    color: var(--primary-orange);
    margin-bottom: 20px;
}

/* ========== GRID DE VEÍCULOS ========== */
.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* ========== CARD DE VEÍCULO ========== */
.vehicle-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.vehicle-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.vehicle-card.vendido {
    opacity: 0.75;
}

.vehicle-card.vendido::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.05);
    pointer-events: none;
}

/* ========== IMAGEM DO VEÍCULO ========== */
.vehicle-image {
    position: relative;
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--dark-orange) 100%);
    overflow: hidden;
}

.vehicle-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.vehicle-card:hover .vehicle-image img {
    transform: scale(1.05);
}

.placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 64px;
}

.placeholder-image.large {
    height: 400px;
    font-size: 120px;
}

/* ========== STATUS BADGE ========== */
.status-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.status-badge.available {
    background: #28a745;
    color: white;
}

.status-badge.sold {
    background: #dc3545;
    color: white;
}

.status-badge.reserved {
    background: #ffc107;
    color: #333;
}

/* ========== CONTEÚDO DO CARD ========== */
.vehicle-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.vehicle-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 12px;
    line-height: 1.3;
}

.vehicle-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
    font-size: 13px;
    color: var(--text-sub);
}

.vehicle-details span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.vehicle-details i {
    color: var(--primary-orange);
    font-size: 12px;
}

.vehicle-description {
    font-size: 14px;
    color: var(--text-sub);
    line-height: 1.6;
    margin-bottom: 15px;
    flex: 1;
}

/* ========== FOOTER DO CARD ========== */
.vehicle-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 15px;
    border-top: 2px solid #f5f5f5;
}

.vehicle-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-orange);
}

.vehicle-actions {
    display: flex;
    gap: 6px;
}

.btn-icon {
    background: #f5f5f5;
    color: #666;
    border: none;
    padding: 10px 13px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

.btn-icon.btn-danger {
    background: #ffebee;
    color: #dc3545;
}

.btn-icon.btn-danger:hover {
    background: #dc3545;
    color: white;
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    color: var(--text-sub);
}

.empty-state i {
    font-size: 80px;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: var(--text-main);
    margin: 15px 0 10px;
    font-size: 1.5rem;
}

.empty-state p {
    margin-bottom: 25px;
    font-size: 1rem;
}

.empty-state button {
    margin-top: 10px;
}

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 3% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s ease;
}

.modal-content.large {
    max-width: 1000px;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 25px 30px;
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--dark-orange) 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close {
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 25px;
    transition: opacity 0.3s ease;
    background: none;
    border: none;
    padding: 0;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

/* ========== DETALHES DO VEÍCULO (MODAL) ========== */
.details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f5f5f5;
}

.details-header h2 {
    margin: 0;
    color: var(--text-main);
}

.details-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.details-image {
    width: 100%;
}

.details-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.details-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: var(--light-orange);
    border-radius: 10px;
}

.info-item i {
    font-size: 20px;
    color: var(--primary-orange);
    margin-top: 3px;
}

.info-item label {
    font-size: 12px;
    color: var(--text-sub);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}

.info-item .value {
    font-size: 16px;
    color: var(--text-main);
    font-weight: 700;
}

.description-section {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
}

.description-section h3 {
    margin: 0 0 12px;
    color: var(--text-main);
    font-size: 1.1rem;
}

.description-section p {
    margin: 0;
    line-height: 1.6;
    color: var(--text-sub);
}

.details-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.details-actions button {
    flex: 1;
}

/* ========== FORMULÁRIO ========== */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-main);
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(243, 112, 33, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ========== PREVIEW DE IMAGEM ========== */
.image-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.preview-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
    background: #f5f5f5;
}

.preview-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    font-size: 14px;
}

.remove-image:hover {
    background: rgba(220, 53, 69, 1);
    transform: scale(1.1);
}

/* ========== BOTÕES ========== */
.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-orange);
    color: white;
}

.btn-primary:hover {
    background: var(--dark-orange);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* ========== ANIMAÇÕES ========== */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== SCROLLBAR CUSTOMIZADA ========== */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--primary-orange);
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--dark-orange);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
    .vehicles-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 992px) {
    .details-body {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 15px;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 10px;
    }

    .header-left h1 {
        font-size: 1.5rem;
    }

    .btn-add-vehicle,
    .btn-back {
        width: 100%;
        justify-content: center;
    }

    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        width: 100%;
    }

    .filters {
        width: 100%;
        justify-content: center;
    }

    .sort-options {
        width: 100%;
    }

    .sort-select {
        width: 100%;
    }

    .vehicles-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 10px auto;
    }

    .modal-body {
        padding: 20px;
        max-height: 60vh;
    }

    .modal-header {
        padding: 20px;
    }

    .modal-header h2 {
        font-size: 1.25rem;
    }

    .details-actions {
        flex-direction: column;
    }

    .details-actions button {
        width: 100%;
    }

    .vehicle-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn-icon {
        width: 100%;
    }

    .btn-primary,
    .btn-secondary,
    .btn-danger {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header-left h1 {
        font-size: 1.3rem;
    }

    .vehicle-title {
        font-size: 1.1rem;
    }

    .vehicle-price {
        font-size: 1.3rem;
    }

    .filter-btn {
        font-size: 12px;
        padding: 8px 14px;
    }

    .image-preview {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}