/**
 * VMCompare Styles
 * @package     com_vmcompare
 * @copyright   Copyright (C) 2024. All rights reserved.
 */
 

/* Compare & Wishlist Buttons */
.vmcompare-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.vmcompare-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.vmcompare-btn:hover {
    background: #f8f9fa;
    border-color: #999;
    color: #000;
}

.vmcompare-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.vmcompare-btn.active,
.vmcompare-btn.in-compare,
.vmcompare-btn.in-wishlist {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.vmcompare-btn.active:hover {
    background: #218838;
    border-color: #1e7e34;
}

/* Icons */
.vmcompare-icon {
    width: 16px;
    height: 16px;
}

.vmcompare-icon-compare::before {
    content: "⚖️";
}

.vmcompare-icon-wishlist::before {
    content: "❤️";
}

.vmcompare-icon-remove::before {
    content: "✕";
}

/* Compare Page */
.vmcompare-container {
    padding: 20px;
}

.vmcompare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.vmcompare-product {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background: #fff;
}

.vmcompare-product-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    margin-bottom: 15px;
}

.vmcompare-product-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.vmcompare-product-name a {
    color: #333;
    text-decoration: none;
}

.vmcompare-product-name a:hover {
    color: #007bff;
}

.vmcompare-product-price {
    font-size: 20px;
    color: #28a745;
    font-weight: bold;
    margin-bottom: 10px;
}

.vmcompare-product-details {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.vmcompare-product-details div {
    margin-bottom: 5px;
}

.vmcompare-product-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Wishlist Page */
.vmcompare-wishlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

/* Compare Table */
.vmcompare-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.vmcompare-table th,
.vmcompare-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.vmcompare-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.vmcompare-table tr:hover {
    background: #f8f9fa;
}

/* Empty State */
.vmcompare-empty {
    text-align: center;
    padding: 60px 20px;
}

.vmcompare-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.vmcompare-empty-title {
    font-size: 24px;
    margin-bottom: 10px;
    color: #333;
}

.vmcompare-empty-text {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

/* Badge Counter */
.vmcompare-count-badge {
    display: inline-block;
    min-width: 20px;
    padding: 3px 7px;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    background-color: #dc3545;
    border-radius: 10px;
    margin-left: 5px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
}

.page-header h1 {
    margin: 0;
    font-size: 28px;
}

/* Responsive */
@media (max-width: 768px) {
    .vmcompare-grid,
    .vmcompare-wishlist-grid {
        grid-template-columns: 1fr;
    }
    
    .vmcompare-buttons {
        flex-direction: column;
    }
    
    .vmcompare-btn {
        width: 100%;
        justify-content: center;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .vmcompare-product-actions {
        flex-direction: column;
    }

    .vmcompare-product-actions .btn {
        width: 100%;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Loading State */
.vmcompare-loading {
    opacity: 0.5;
    pointer-events: none;
}

.vmcompare-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0,0,0,0.1);
    border-left-color: #333;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Button variants */
.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #004085;
}

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

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

.btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
    border-color: #d39e00;
}

/* Alert */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}