/**
 * Interactive Features Styles
 * Provides styling for tabs, accordions, modals, and other interactive elements
 */

/* Tab Styles */
.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

[data-tab-button] {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: all 0.3s ease;
    position: relative;
    font-weight: 500;
}

[data-tab-button]:hover {
    color: #0066cc;
}

[data-tab-button].active {
    color: #0066cc;
    border-bottom: 3px solid #0066cc;
    margin-bottom: -2px;
}

[data-tab-content] {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

[data-tab-content].active {
    display: block;
}

/* Accordion Styles */
.accordion-item {
    border: 1px solid #e0e0e0;
    margin-bottom: 10px;
    border-radius: 4px;
    overflow: hidden;
}

[data-accordion-header] {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f8f9fa;
    cursor: pointer;
    border: none;
    width: 100%;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    transition: all 0.3s ease;
}

[data-accordion-header]:hover {
    background-color: #f0f0f0;
    color: #0066cc;
}

[data-accordion-header].active {
    background-color: #e8f0ff;
    color: #0066cc;
}

[data-accordion-header]::after {
    content: '›';
    font-size: 24px;
    transition: transform 0.3s ease;
}

[data-accordion-header].active::after {
    transform: rotate(90deg);
}

[data-accordion-body] {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #fff;
}

[data-accordion-body].active {
    padding: 15px 20px;
}

/* Modal Styles */
[data-modal] {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

[data-modal].active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

[data-modal-close] {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

[data-modal-close]:hover {
    color: #333;
}

/* Tooltip Styles */
.tooltip-popup {
    position: fixed;
    background-color: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    z-index: 3000;
    pointer-events: none;
    animation: fadeIn 0.2s ease-out;
}

.tooltip-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

/* Rating System */
[data-rating-container] {
    display: flex;
    gap: 5px;
}

[data-rating-star] {
    font-size: 24px;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
}

[data-rating-star]:hover,
[data-rating-star].active {
    color: #ffc107;
    transform: scale(1.1);
}

/* Product Comparison */
.product-compare-section {
    margin: 20px 0;
}

.compare-checkbox {
    margin-right: 10px;
}

[data-compare-button] {
    padding: 10px 20px;
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

[data-compare-button]:hover {
    background-color: #0052a3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

[data-compare-button]:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Search Highlight */
[data-searchable].search-highlight {
    background-color: #fff3cd;
    padding: 2px 4px;
    border-radius: 2px;
}

[data-search-input] {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    width: 100%;
    max-width: 400px;
}

[data-search-input]:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Animation Utilities */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .tab-buttons {
        flex-wrap: wrap;
    }
    
    [data-tab-button] {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .modal-content {
        padding: 20px;
        width: 95%;
    }
    
    [data-rating-star] {
        font-size: 20px;
    }
    
    [data-search-input] {
        max-width: 100%;
    }
}
