/**
 * Feature Explanations Modal Styles
 */

/* Modal Overlay */
.feature-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem;
}

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

/* Modal Container */
.feature-modal-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.feature-modal-overlay.active .feature-modal-container {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.feature-modal-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.feature-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: white;
}

.feature-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
}

.feature-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Modal Body */
.feature-modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.feature-modal-content {
    color: #374151;
    line-height: 1.6;
}

.feature-explanation-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-icon {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.feature-explanation-text {
    font-size: 1rem;
    margin: 0;
    text-align: left;
}

.feature-loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.feature-loading i {
    margin-right: 0.5rem;
}

/* Modal Footer */
.feature-modal-footer {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
    text-align: right;
}

.feature-modal-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.feature-modal-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.feature-modal-btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Feature Explanation Trigger Link */
.feature-explanation-trigger {
    color: #667eea;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    margin-left: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.feature-explanation-trigger:hover {
    color: #5a67d8;
    background-color: #eef2ff;
    border-color: #c7d2fe;
    text-decoration: none;
}

.feature-explanation-trigger::before {
    content: "?";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    background-color: #667eea;
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: bold;
    margin-right: 0.25rem;
}

/* Body scroll lock when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 640px) {
    .feature-modal-overlay {
        padding: 0.5rem;
    }
    
    .feature-modal-container {
        max-height: 95vh;
    }
    
    .feature-modal-header {
        padding: 1rem 1rem 0.75rem 1rem;
    }
    
    .feature-modal-title {
        font-size: 1.125rem;
    }
    
    .feature-modal-body {
        padding: 1rem;
        max-height: 70vh;
    }
    
    .feature-modal-footer {
        padding: 0.75rem 1rem 1rem 1rem;
    }
    
    .feature-explanation-trigger {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Animation for smooth transitions */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-explanation-content {
    animation: fadeInUp 0.3s ease;
}

/* Focus styles for accessibility */
.feature-modal-close:focus,
.feature-modal-btn:focus,
.feature-explanation-trigger:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .feature-modal-overlay {
        background-color: rgba(0, 0, 0, 0.8);
    }
    
    .feature-modal-container {
        border: 2px solid #000;
    }
    
    .feature-explanation-trigger {
        border: 2px solid #667eea;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .feature-modal-overlay,
    .feature-modal-container,
    .feature-modal-btn,
    .feature-explanation-trigger {
        transition: none;
    }
    
    .feature-explanation-content {
        animation: none;
    }
}
