/* Advanced Admin Panel Enhancements */

/* ===== ENHANCED ADMIN HERO ===== */
.admin-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 255, 136, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(34, 211, 238, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(217, 70, 239, 0.05) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(1deg); }
    66% { transform: translateY(5px) rotate(-1deg); }
}

/* ===== ENHANCED STATS CARDS ===== */
.stat-item {
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #00ff88, #22d3ee, #d946ef);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.stat-item:hover::before {
    transform: translateX(0);
}

.stat-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* ===== ENHANCED ACTION CARDS ===== */
.action-card {
    position: relative;
    overflow: hidden;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, 
        rgba(255, 255, 255, 0.05) 0%, 
        transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.action-card:hover::before {
    opacity: 1;
}

.action-card::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: conic-gradient(from 0deg, 
        transparent, 
        rgba(0, 255, 136, 0.3), 
        transparent, 
        rgba(34, 211, 238, 0.3), 
        transparent);
    opacity: 0;
    animation: rotate 4s linear infinite;
    border-radius: 22px;
    z-index: -1;
}

.action-card:hover::after {
    opacity: 1;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.action-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.action-icon {
    margin-bottom: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.action-card:hover .action-icon {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.action-icon svg {
    width: 28px;
    height: 28px;
    color: #00ff88;
}

/* ===== ENHANCED SEARCH AND FILTERS ===== */
.search-filters {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.search-input {
    width: 100%;
    padding: 14px 50px 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: white;
    font-size: 16px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #00ff88;
    box-shadow: 0 0 0 4px rgba(0, 255, 136, 0.1);
    outline: none;
}

.search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.6);
}

.filter-buttons {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.filter-btn {
    padding: 8px 16px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn.active,
.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.filter-btn.active {
    background: #00ff88;
    color: #0f172a;
}

/* ===== ENHANCED TABLE ===== */
.cars-table-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.cars-table {
    width: 100%;
    border-collapse: collapse;
}

.cars-table th {
    background: rgba(255, 255, 255, 0.05);
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cars-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.cars-table tbody tr {
    transition: all 0.3s ease;
}

.cars-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
    transform: scale(1.01);
}

.car-image-cell {
    width: 80px;
}

.car-image-thumb {
    width: 60px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.car-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.car-brand-model {
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
}

.car-details-small,
.car-specs-small {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2px;
}

.price-cell {
    text-align: right;
}

.price-amount {
    font-weight: 700;
    color: #00ff88;
    font-size: 16px;
}

.featured-badge {
    display: inline-block;
    margin-left: 8px;
    font-size: 14px;
}

.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
}

.status-badge.draft {
    background: rgba(255, 165, 2, 0.2);
    color: #ffa502;
}

.status-badge.archived {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
}

.actions-cell {
    width: 120px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin: 0 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.action-btn svg {
    width: 16px;
    height: 16px;
}

.action-btn.view {
    background: rgba(34, 211, 238, 0.2);
    color: #22d3ee;
}

.action-btn.view:hover {
    background: rgba(34, 211, 238, 0.3);
    transform: scale(1.1);
}

.action-btn.edit {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
}

.action-btn.edit:hover {
    background: rgba(0, 255, 136, 0.3);
    transform: scale(1.1);
}

.action-btn.delete {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
}

.action-btn.delete:hover {
    background: rgba(255, 71, 87, 0.3);
    transform: scale(1.1);
}

/* ===== ENHANCED MODALS ===== */
.modal-overlay.glass {
    backdrop-filter: blur(20px);
    background: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    color: white;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* ===== ENHANCED FORMS ===== */
.add-car-form {
    padding: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row.full-width {
    grid-template-columns: 1fr;
}

.form-group {
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-size: 16px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: #00ff88;
    box-shadow: 0 0 0 4px rgba(0, 255, 136, 0.1);
    outline: none;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-checkbox {
    width: 20px;
    height: 20px;
    accent-color: #00ff88;
}

.checkbox-label {
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-button {
    padding: 12px 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.glass-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.glass-button.primary {
    background: linear-gradient(135deg, #00ff88, #22d3ee);
    color: #0f172a;
    border: none;
}

.glass-button.primary:hover {
    box-shadow: 0 8px 25px rgba(0, 255, 136, 0.3);
}

.glass-button.secondary {
    background: rgba(255, 255, 255, 0.1);
}

.glass-button .icon {
    width: 16px;
    height: 16px;
}

/* ===== NO CARS MESSAGE ===== */
.no-cars-message {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.no-cars-content {
    max-width: 400px;
    margin: 0 auto;
}

.no-cars-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.no-cars-content h3 {
    color: white;
    margin-bottom: 8px;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 20px;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 400px;
    min-width: 300px;
}

.toast.show {
    transform: translateX(0);
}

.toast.toast-success {
    border-left: 4px solid #00ff88;
}

.toast.toast-error {
    border-left: 4px solid #ff4757;
}

.toast.toast-warning {
    border-left: 4px solid #ffa502;
}

.toast.toast-info {
    border-left: 4px solid #22d3ee;
}

.toast-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.toast-message {
    flex: 1;
    color: white;
    font-size: 14px;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.toast-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .nav-container {
        padding: 1rem;
        flex-direction: column;
        gap: 16px;
    }
    
    .nav-menu {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .search-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: auto;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .cars-table-container {
        overflow-x: auto;
    }
    
    .toast-container {
        left: 20px;
        right: 20px;
    }
    
    .toast {
        transform: translateY(-100%);
        max-width: none;
    }
    
    .toast.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .admin-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-item {
        padding: 16px;
    }
    
    .action-card {
        padding: 24px 16px;
    }
    
    .modal-content {
        margin: 20px;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators for accessibility */
.glass-button:focus-visible,
.form-input:focus-visible,
.action-btn:focus-visible,
.filter-btn:focus-visible {
    outline: 2px solid #00ff88;
    outline-offset: 2px;
}
