/**
 * Frontend Vehicles Styles
 * Styles for vehicle management in My Account
 */

/* Container */
.av-my-vehicles-container {
    padding: 20px 0;
}

/* Header */
.av-vehicles-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.av-vehicles-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.av-add-vehicle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.av-add-vehicle-btn:hover {
    background: #005a87;
}

.av-add-vehicle-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* No Vehicles State */
.av-no-vehicles {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.av-no-vehicles p {
    font-size: 16px;
    color: #666;
    margin: 10px 0;
}

/* Vehicles Grid */
.av-vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Vehicle Card */
.av-vehicle-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.av-vehicle-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.av-vehicle-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.av-vehicle-card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.av-vehicle-actions {
    display: flex;
    gap: 5px;
}

.av-vehicle-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #666;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.av-vehicle-actions button:hover {
    color: #000;
}

.av-vehicle-actions button .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.av-delete-vehicle:hover {
    color: #dc3232 !important;
}

/* Vehicle Card Body */
.av-vehicle-card-body {
    padding: 15px;
}

.av-vehicle-photo {
    width: 100%;
    height: 180px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    border-radius: 4px;
    overflow: hidden;
}

.av-vehicle-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.av-vehicle-photo.av-no-photo {
    background: linear-gradient(135deg, #e0e0e0 0%, #f0f0f0 100%);
}

.av-vehicle-photo.av-no-photo .dashicons {
    font-size: 60px;
    width: 60px;
    height: 60px;
    color: #999;
}

.av-vehicle-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.av-vehicle-info-row:last-child {
    border-bottom: none;
}

.av-label {
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.av-value {
    color: #333;
    font-size: 14px;
}

/* Modal Styles */
.av-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
}

.av-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.av-modal-content {
    position: relative;
    max-width: 600px;
    margin: 50px auto;
    background: #fff;
    border-radius: 8px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.av-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ddd;
    background: #f9f9f9;
}

.av-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.av-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.av-modal-close:hover {
    color: #000;
}

/* Form Styles */
#av-vehicle-form {
    padding: 20px;
}

.av-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.av-form-group {
    flex: 1;
    margin-bottom: 15px;
}

.av-col-4 {
    flex: 0 0 calc(33.333% - 10px);
}

.av-col-6 {
    flex: 0 0 calc(50% - 7.5px);
}

.av-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.av-form-group input[type="text"],
.av-form-group input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.av-form-group input[type="text"]:focus,
.av-form-group input[type="number"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.av-form-group input[type="file"] {
    width: 100%;
    padding: 8px 0;
    font-size: 14px;
}

.required {
    color: #dc3232;
}

.av-help-text {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
    font-style: italic;
}

/* Modal Footer */
.av-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #ddd;
    background: #f9f9f9;
}

.av-btn-cancel {
    padding: 10px 20px;
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.av-btn-cancel:hover {
    background: #e0e0e0;
}

.av-btn-save {
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.av-btn-save:hover {
    background: #005a87;
}

.av-btn-save:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.av-btn-loading {
    display: none;
    align-items: center;
    gap: 8px;
}

.av-btn-loading .spinner {
    float: none;
    margin: 0;
}

/* Notices */
.woocommerce-message,
.woocommerce-error {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 4px;
}

.woocommerce-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.woocommerce-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Responsive Design */
@media (max-width: 768px) {
    .av-vehicles-grid {
        grid-template-columns: 1fr;
    }
    
    .av-vehicles-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .av-add-vehicle-btn {
        width: 100%;
        justify-content: center;
    }
    
    .av-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .av-col-4,
    .av-col-6 {
        flex: 1;
    }
    
    .av-modal-content {
        margin: 20px;
        max-height: calc(100vh - 40px);
    }
    
    .av-modal-footer {
        flex-direction: column;
    }
    
    .av-btn-cancel,
    .av-btn-save {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .av-vehicles-header h2 {
        font-size: 20px;
    }
    
    .av-vehicle-card-header h3 {
        font-size: 16px;
    }
    
    .av-vehicle-photo {
        height: 150px;
    }
}
