/**
 * Features Modal CSS
 * Modern responsive modal for displaying additional product features
 * Supports both hover (desktop) and click (mobile) interactions
 */

/* Modal Overlay */
.ta-features-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ta-features-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.ta-features-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ta-features-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Modal Header */
.ta-features-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    flex-shrink: 0;
}

.ta-features-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ta-features-modal-title-icon {
    color: #E94141;
    font-size: 22px;
}

.ta-features-modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ta-features-modal-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.ta-features-modal-close:active {
    transform: scale(0.95);
}

/* Modal Body */
.ta-features-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

/* Custom Scrollbar */
.ta-features-modal-body::-webkit-scrollbar {
    width: 8px;
}

.ta-features-modal-body::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

.ta-features-modal-body::-webkit-scrollbar-thumb {
    background: #E94141;
    border-radius: 4px;
}

.ta-features-modal-body::-webkit-scrollbar-thumb:hover {
    background: #c93636;
}

/* Firefox Scrollbar */
.ta-features-modal-body {
    scrollbar-width: thin;
    scrollbar-color: #E94141 #f3f4f6;
}

/* Feature Items */
.ta-feature-item {
    padding: 14px 16px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.2s ease;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.ta-feature-item:last-child {
    margin-bottom: 0;
}

.ta-feature-item:hover {
    background: linear-gradient(135deg, #fff5f5, #ffffff);
    border-color: #E94141;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(233, 65, 65, 0.1);
}

.ta-feature-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #E94141, #c93636);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: 600;
}

.ta-feature-content {
    flex: 1;
    min-width: 0;
}

.ta-feature-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    font-size: 15px;
    word-wrap: break-word;
}

.ta-feature-value {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Empty State */
.ta-features-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.ta-features-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.ta-features-empty-text {
    font-size: 16px;
    color: #6b7280;
}

/* More Chip Enhancement */
.ta-chip.ta-more {
    background: linear-gradient(135deg, #E94141, #c93636);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.ta-chip.ta-more::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.ta-chip.ta-more:hover {
    background: linear-gradient(135deg, #c93636, #b53030);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 65, 65, 0.3);
    color: white;
}

.ta-chip.ta-more:hover::before {
    width: 100%;
    height: 100%;
}

.ta-chip.ta-more:active {
    transform: translateY(0);
}

/* Tooltip for Desktop Hover */
.ta-features-tooltip {
    position: absolute;
    background: #1f2937;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    max-width: 400px;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.ta-features-tooltip.active {
    opacity: 1;
    visibility: visible;
}

.ta-features-tooltip::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #1f2937;
}

.ta-features-tooltip-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ta-features-tooltip-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.ta-features-tooltip-name {
    font-weight: 600;
    color: #E94141;
    min-width: 80px;
}

.ta-features-tooltip-value {
    color: #e5e7eb;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .ta-features-modal {
        max-width: 95%;
        width: 95%;
        max-height: 85vh;
        border-radius: 12px;
    }
    
    .ta-features-modal-header {
        padding: 16px 20px;
    }
    
    .ta-features-modal-title {
        font-size: 18px;
    }
    
    .ta-features-modal-body {
        padding: 20px;
    }
    
    .ta-feature-item {
        padding: 12px 14px;
        margin-bottom: 8px;
    }
    
    .ta-feature-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .ta-feature-name {
        font-size: 14px;
    }
    
    .ta-feature-value {
        font-size: 13px;
    }
    
    /* Disable hover tooltip on mobile */
    .ta-features-tooltip {
        display: none;
    }
}

@media (max-width: 480px) {
    .ta-features-modal {
        max-width: 100%;
        width: 100%;
        max-height: 90vh;
        border-radius: 12px 12px 0 0;
        top: auto;
        bottom: 0;
        transform: translate(-50%, 100%);
    }
    
    .ta-features-modal.active {
        transform: translate(-50%, 0);
    }
    
    .ta-features-modal-header {
        padding: 14px 16px;
    }
    
    .ta-features-modal-title {
        font-size: 16px;
    }
    
    .ta-features-modal-close {
        font-size: 24px;
    }
    
    .ta-features-modal-body {
        padding: 16px;
    }
    
    .ta-feature-item {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .ta-feature-icon {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
}

/* Animations */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes modalSlideUp {
    from {
        transform: translate(-50%, 100%);
    }
    to {
        transform: translate(-50%, 0);
    }
}

/* Accessibility */
.ta-features-modal:focus {
    outline: 2px solid #E94141;
    outline-offset: 2px;
}

.ta-chip.ta-more:focus {
    outline: 2px solid #E94141;
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .ta-features-modal,
    .ta-features-modal-overlay,
    .ta-feature-item,
    .ta-chip.ta-more,
    .ta-features-tooltip {
        transition: none !important;
        animation: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .ta-features-modal {
        border: 2px solid #000;
    }
    
    .ta-feature-item {
        border: 2px solid #000;
    }
    
    .ta-chip.ta-more {
        border: 2px solid #000;
    }
}

/* Print Styles */
@media print {
    .ta-features-modal-overlay,
    .ta-features-modal {
        display: none !important;
    }
}

/* Loading State */
.ta-features-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.ta-features-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top-color: #E94141;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Success Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ta-feature-item {
    animation: fadeInUp 0.3s ease forwards;
}

.ta-feature-item:nth-child(1) { animation-delay: 0.05s; }
.ta-feature-item:nth-child(2) { animation-delay: 0.1s; }
.ta-feature-item:nth-child(3) { animation-delay: 0.15s; }
.ta-feature-item:nth-child(4) { animation-delay: 0.2s; }
.ta-feature-item:nth-child(5) { animation-delay: 0.25s; }
.ta-feature-item:nth-child(n+6) { animation-delay: 0.3s; }
