* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a0d2e 0%, #2d1b4e 50%, #4a1a5e 100%);
    min-height: 100vh;
    padding: 20px;
    color: #e0d0f0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    background: rgba(45, 27, 78, 0.9);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border: 1px solid rgba(186, 85, 211, 0.3);
}

header h1 {
    background: linear-gradient(135deg, #ba55d3 0%, #ff69b4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5em;
    text-align: center;
    text-shadow: 0 0 20px rgba(186, 85, 211, 0.5);
    font-weight: bold;
}

.header-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.search-input {
    padding: 12px 20px;
    border: 2px solid rgba(186, 85, 211, 0.5);
    border-radius: 8px;
    font-size: 16px;
    flex: 1;
    min-width: 200px;
    transition: all 0.3s;
    background: rgba(26, 13, 46, 0.8);
    color: #e0d0f0;
}

.filter-select {
    padding: 12px 20px;
    padding-right: 45px;
    border: 2px solid rgba(186, 85, 211, 0.5);
    border-radius: 8px;
    font-size: 16px;
    flex: 1;
    min-width: 200px;
    transition: all 0.3s;
    background: rgba(26, 13, 46, 0.8);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%23ff69b4' d='M7 10L2 5h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 14px;
    color: #e0d0f0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
}

.search-input::placeholder {
    color: rgba(224, 208, 240, 0.6);
}

.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #ff69b4;
    box-shadow: 0 0 15px rgba(255, 105, 180, 0.4);
    background-color: rgba(26, 13, 46, 0.95);
}

.filter-select:hover {
    border-color: rgba(255, 105, 180, 0.7);
    background-color: rgba(26, 13, 46, 0.9);
}

.filter-select option {
    background: #2d1b4e;
    color: #e0d0f0;
    padding: 10px;
}

.filter-select option:checked {
    background: linear-gradient(135deg, #ba55d3 0%, #ff69b4 100%);
    color: white;
}

.btn-save, .btn-logs {
    padding: 12px 30px;
    background: linear-gradient(135deg, #ba55d3 0%, #ff69b4 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(186, 85, 211, 0.4);
    text-decoration: none;
    display: inline-block;
}

.btn-save:hover, .btn-logs:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 105, 180, 0.6);
    background: linear-gradient(135deg, #c969e0 0%, #ff7ac8 100%);
}

.btn-save:active, .btn-logs:active {
    transform: translateY(0);
}

.stats {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.stat-card {
    background: rgba(45, 27, 78, 0.9);
    padding: 20px;
    border-radius: 12px;
    flex: 1;
    min-width: 200px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(186, 85, 211, 0.3);
}

.stat-label {
    display: block;
    color: rgba(224, 208, 240, 0.7);
    font-size: 14px;
    margin-bottom: 10px;
}

.stat-value {
    display: block;
    background: linear-gradient(135deg, #ba55d3 0%, #ff69b4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2em;
    font-weight: bold;
}

.loading {
    text-align: center;
    padding: 50px;
    color: #e0d0f0;
    font-size: 18px;
}

.spinner {
    border: 4px solid rgba(186, 85, 211, 0.3);
    border-top: 4px solid #ff69b4;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.car-card {
    background: rgba(45, 27, 78, 0.9);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    transition: all 0.3s;
    position: relative;
    border: 1px solid rgba(186, 85, 211, 0.3);
}

.car-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(186, 85, 211, 0.3);
    border-color: rgba(255, 105, 180, 0.5);
}

.car-card.edited {
    border: 3px solid #ff69b4;
    box-shadow: 0 0 25px rgba(255, 105, 180, 0.6);
    background: rgba(45, 27, 78, 0.95);
}

.car-image-container {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #1a0d2e 0%, #2d1b4e 50%, #4a1a5e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.car-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.car-image-placeholder {
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a0d2e 0%, #2d1b4e 50%, #4a1a5e 100%);
    position: absolute;
    top: 0;
    left: 0;
    border: 2px dashed rgba(255, 105, 180, 0.3);
}

.car-image-placeholder .placeholder-text {
    color: rgba(255, 105, 180, 0.7);
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    padding: 10px;
}

.car-image-placeholder::before {
    content: '📷';
    font-size: 48px;
    opacity: 0.5;
    margin-bottom: 10px;
}

.car-badge {
    position: absolute;
    right: 10px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    z-index: 10;
}

.badge-banned {
    background: #e74c3c;
    color: white;
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.5);
    top: 10px;
}

.badge-vip {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(243, 156, 18, 0.5);
    top: 10px;
}

.badge-type {
    background: rgba(186, 85, 211, 0.8);
    color: white;
    box-shadow: 0 2px 10px rgba(186, 85, 211, 0.5);
    top: 10px;
}

/* Quando há badge banido, ajustar posição dos outros badges */
.badge-banned ~ .badge-vip,
.badge-banned ~ .badge-type {
    top: 45px;
}

/* Quando há badge VIP, ajustar posição do badge de tipo */
.badge-vip ~ .badge-type {
    top: 45px;
}

.car-info {
    padding: 20px;
}

.car-name {
    font-size: 1.5em;
    font-weight: bold;
    background: linear-gradient(135deg, #ba55d3 0%, #ff69b4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    text-align: center;
}

.car-model {
    color: rgba(224, 208, 240, 0.7);
    font-size: 14px;
    margin-bottom: 15px;
    text-align: center;
}

.car-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(186, 85, 211, 0.2);
}

.detail-label {
    font-weight: 600;
    color: rgba(224, 208, 240, 0.8);
}

.detail-value {
    background: linear-gradient(135deg, #ba55d3 0%, #ff69b4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.input-label {
    font-size: 14px;
    font-weight: 600;
    color: rgba(224, 208, 240, 0.9);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s;
    user-select: none;
}

.checkbox-label:hover {
    background: rgba(186, 85, 211, 0.1);
}

.checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(186, 85, 211, 0.5);
    border-radius: 4px;
    background: rgba(26, 13, 46, 0.8);
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:hover {
    border-color: rgba(255, 105, 180, 0.7);
    background: rgba(26, 13, 46, 0.9);
}

.checkbox-label input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #ba55d3 0%, #ff69b4 100%);
    border-color: #ff69b4;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.4);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.checkbox-label input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.3);
}

.checkbox-label input[type="checkbox"].edited {
    border-color: #ff69b4;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.3);
}

.checkbox-label span {
    color: rgba(224, 208, 240, 0.9);
    font-size: 14px;
    font-weight: 500;
}

.input-field {
    padding: 10px;
    border: 2px solid rgba(186, 85, 211, 0.3);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
    background: rgba(26, 13, 46, 0.8);
    color: #e0d0f0;
}

.input-field:focus {
    outline: none;
    border-color: #ff69b4;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.3);
    background: rgba(26, 13, 46, 0.95);
}

.input-field.edited {
    border-color: #ff69b4;
    background: rgba(74, 26, 94, 0.5);
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.2);
}

/* Estilização customizada para select */
.input-field[type="number"] {
    -moz-appearance: textfield;
}

.input-field[type="number"]::-webkit-outer-spin-button,
.input-field[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Estilização do select */
select.input-field {
    appearance: none;
    -webkit-appearance: none;
    -moz-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='%23ff69b4' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 35px;
    cursor: pointer;
}

select.input-field:hover {
    border-color: rgba(255, 105, 180, 0.6);
    background-color: rgba(26, 13, 46, 0.9);
}

select.input-field:focus {
    border-color: #ff69b4;
    box-shadow: 0 0 15px rgba(255, 105, 180, 0.4);
    background-color: rgba(26, 13, 46, 0.95);
}

select.input-field option {
    background: #2d1b4e;
    color: #e0d0f0;
    padding: 10px;
    border: none;
}

select.input-field option:hover {
    background: rgba(186, 85, 211, 0.3);
}

select.input-field option:checked {
    background: linear-gradient(135deg, #ba55d3 0%, #ff69b4 100%);
    color: white;
}

.btn-edit {
    margin-top: 15px;
    padding: 10px;
    background: linear-gradient(135deg, #ba55d3 0%, #ff69b4 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    box-shadow: 0 4px 10px rgba(186, 85, 211, 0.3);
}

.btn-edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 105, 180, 0.5);
    background: linear-gradient(135deg, #c969e0 0%, #ff7ac8 100%);
}

.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    transform: translateX(400px);
    transition: transform 0.3s;
    z-index: 1000;
}

.message.show {
    transform: translateX(0);
}

.message.success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border: 1px solid rgba(46, 204, 113, 0.5);
}

.message.error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: 1px solid rgba(231, 76, 60, 0.5);
}

.message.info {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: 1px solid rgba(52, 152, 219, 0.5);
}

/* Seção de Logs */
.logs-section {
    margin-top: 30px;
    background: rgba(26, 13, 46, 0.95);
    border: 2px solid rgba(186, 85, 211, 0.3);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 105, 180, 0.3);
    padding-bottom: 15px;
}

.logs-header h2 {
    background: linear-gradient(135deg, #ba55d3 0%, #ff69b4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    font-size: 1.8em;
}

.logs-controls {
    display: flex;
    gap: 10px;
}

.btn-refresh, .btn-clear, .btn-close {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-refresh {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.btn-clear {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.btn-close {
    background: rgba(224, 208, 240, 0.2);
    color: #e0d0f0;
    border: 1px solid rgba(186, 85, 211, 0.3);
}

.btn-refresh:hover, .btn-clear:hover, .btn-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.logs-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(186, 85, 211, 0.2);
}

.log-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: rgba(224, 208, 240, 0.7);
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.log-tab:hover {
    color: #ff69b4;
}

.log-tab.active {
    color: #ff69b4;
    border-bottom-color: #ff69b4;
}

.logs-content {
    position: relative;
}

.log-panel {
    display: none;
}

.log-panel.active {
    display: block;
}

.log-container {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(186, 85, 211, 0.2);
    border-radius: 8px;
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #e0d0f0;
    line-height: 1.6;
}

.log-container::-webkit-scrollbar {
    width: 10px;
}

.log-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

.log-container::-webkit-scrollbar-thumb {
    background: rgba(255, 105, 180, 0.5);
    border-radius: 5px;
}

.log-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 105, 180, 0.7);
}

/* Lazy Loading Sentinel */
#lazyLoadSentinel {
    height: 60px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 20px 0;
}

#lazyLoadSentinel::before {
    content: '⏳ Carregando mais carros...';
    color: rgba(255, 105, 180, 0.8);
    font-size: 14px;
    font-weight: bold;
    animation: pulse 1.5s ease-in-out infinite;
    background: rgba(26, 13, 46, 0.8);
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 105, 180, 0.3);
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .cars-grid {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .header-controls {
        flex-direction: column;
    }
}
