/* 
   car-management.css - Tyson Autogarage
   CSS for car management admin pages 
*/

/* ===== ADMIN CONTAINER ===== */
.admin-container {
    padding: 2rem 0;
    background-color: #f8f9fa;
    min-height: calc(100vh - 200px);
}

.admin-container .content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ===== ADMIN HEADER ===== */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eaecef;
}

.admin-title {
    margin: 0;
    color: #333;
    font-size: 2rem;
    font-weight: 700;
    position: relative;
}

.admin-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: #cd2122;
}

.add-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background-color: #cd2122;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.add-button:hover {
    background-color: #b01d1d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.add-button i {
    font-size: 1rem;
}

/* ===== ALERT MESSAGES ===== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.alert.success {
    background-color: #e6f7e8;
    color: #1e7e34;
    border-left: 4px solid #28a745;
}

.alert.error {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* ===== CAR MANAGEMENT GRID ===== */
.cars-grid.admin-cars {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.car-item {
    display: flex;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

.car-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.car-image {
    width: 120px;
    height: 140px;
    overflow: hidden;
    position: relative;
}

.car-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.car-item:hover .car-image img {
    transform: scale(1.1);
}

.car-image .no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    background-color: #f5f5f5;
    color: #aaa;
    font-size: 0.8rem;
    text-align: center;
    padding: 0.5rem;
}

.car-image .no-image i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #ddd;
}

.car-info {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.car-info h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.car-details {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: auto;
}

.car-price {
    font-weight: 700;
    color: #cd2122;
    font-size: 1.1rem;
}

.car-mileage {
    color: #666;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.car-mileage::before {
    content: '\f3fd';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 0.85rem;
}

/* ===== CAR ACTIONS ===== */
.car-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.action-btn:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.edit-btn {
    background-color: #3498db;
}

.delete-btn {
    background-color: #e74c3c;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0 1rem;
}

.pagination-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.75rem;
    background-color: white;
    border-radius: 4px;
    color: #555;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.pagination-item:hover {
    background-color: #f8f9fa;
    color: #cd2122;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pagination-item.active {
    background-color: #cd2122;
    color: white;
}

/* ===== NO RESULTS MESSAGE ===== */
.no-results {
    text-align: center;
    padding: 3rem 2rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    color: #666;
    font-size: 1.1rem;
    margin: 2rem 0;
}

.no-results a {
    color: #cd2122;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.no-results a:hover {
    text-decoration: underline;
    color: #b01d1d;
}

/* ===== BUTTON STYLES ===== */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.button.primary {
    background-color: #cd2122;
    color: white;
}

.button.primary:hover {
    background-color: #b01d1d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.button.secondary {
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid #eaecef;
}

.button.secondary:hover {
    background-color: #eaecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .add-button {
        width: 100%;
        justify-content: center;
    }
    
    .cars-grid.admin-cars {
        grid-template-columns: 1fr;
    }
    
    .car-item {
        flex-direction: row;
    }
    
    .car-image {
        width: 100px;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .car-item {
        flex-direction: column;
    }
    
    .car-image {
        width: 100%;
        height: 180px;
    }
    
    .car-actions {
        position: relative;
        top: auto;
        right: auto;
        justify-content: flex-end;
        margin-top: 1rem;
    }
}