/* ==========================================
   MODAL STYLES - García's Group S.A.S
   Premium Legal Services Modal System
   ========================================== */

/* Base Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: overlayFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 20px;
}

.modal-container {
    background: #ffffff;
    border-radius: 32px;
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 
        0 40px 100px rgba(0, 0, 0, 0.15),
        0 20px 60px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    transform-origin: center bottom;
}

/* Modern Glass Header */
.modal-header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #6366f1 100%);
    padding: 32px 40px;
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255,255,255,0.05) 0%, transparent 50%);
    animation: headerShine 4s ease-in-out infinite;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255,255,255,0.3) 20%, 
        rgba(255,255,255,0.6) 50%, 
        rgba(255,255,255,0.3) 80%, 
        transparent 100%);
}

.modal-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.modal-title {
    margin: 0;
    font-size: 2.25rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 4px 12px rgba(0,0,0,0.3);
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    padding: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 300;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* Content Area */
.modal-content {
    padding: 48px;
    overflow-y: auto;
    max-height: calc(90vh - 200px);
    background: #ffffff;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}

.modal-content::-webkit-scrollbar {
    width: 12px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.02);
    border-radius: 6px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #d1d5db, #9ca3af);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #9ca3af, #6b7280);
}

/* Premium Description Card */
.modal-description {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0f9ff 100%);
    padding: 32px;
    border-radius: 24px;
    margin-bottom: 40px;
    border: 1px solid #bae6fd;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.08);
}

.modal-description::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(59, 130, 246, 0.03), transparent, rgba(59, 130, 246, 0.02), transparent);
    animation: descriptionRotate 20s linear infinite;
}

.modal-description p {
    margin: 0;
    font-size: 1.25rem;
    color: #1e40af;
    font-weight: 600;
    position: relative;
    z-index: 1;
    line-height: 1.7;
    text-align: center;
}

/* Advanced Grid System */
.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-bottom: 40px;
}

/* Section Headers with Icons */
.modal-section-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 3px solid transparent;
    position: relative;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 20px 24px;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.03);
}

.modal-section-header.green {
    border-image: linear-gradient(90deg, #10b981, #059669) 1;
    border-bottom: 3px solid #10b981;
}

.modal-section-header.blue {
    border-image: linear-gradient(90deg, #3b82f6, #2563eb) 1;
    border-bottom: 3px solid #3b82f6;
}

.modal-section-header::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 24px;
    width: 80px;
    height: 3px;
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-section-header.green::after {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.modal-section-header.blue::after {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.modal-section-header:hover::after {
    width: 120px;
}

/* Premium Icon Design */
.modal-section-icon {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.modal-section-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-100%);
}

.modal-section-icon:hover::before {
    transform: translateX(100%);
}

.modal-section-icon.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.modal-section-icon.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.modal-section-title {
    color: #0f172a;
    margin: 0;
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Interactive List Items */
.modal-item {
    display: flex;
    align-items: flex-start;
    padding: 16px 20px;
    border-radius: 16px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 2px solid transparent;
    background: #ffffff;
}

.modal-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.8), transparent);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-100%);
    z-index: 1;
}

.modal-item:hover::before {
    transform: translateX(100%);
}

.modal-item.green {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(5, 150, 105, 0.02) 100%);
    border-left: 4px solid #10b981;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.08);
}

.modal-item.green:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.05) 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.15);
    border-color: #059669;
}

.modal-item.blue {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(37, 99, 235, 0.02) 100%);
    border-left: 4px solid #3b82f6;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.08);
}

.modal-item.blue:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.05) 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.15);
    border-color: #2563eb;
}

/* Premium Dots */
.modal-item-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-top: 8px;
    margin-right: 16px;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.modal-item-dot::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: dotPulse 2s infinite;
}

.modal-item:hover .modal-item-dot::after {
    opacity: 0.6;
}

.modal-item-dot.green {
    background: linear-gradient(135deg, #10b981, #059669);
}

.modal-item-dot.green::after {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.4), transparent 70%);
}

.modal-item-dot.blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.modal-item-dot.blue::after {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.4), transparent 70%);
}

.modal-item-text {
    color: #374151;
    font-size: 1rem;
    line-height: 1.6;
    font-weight: 500;
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
}

.modal-item:hover .modal-item-text {
    color: #1f2937;
}

/* Premium Alert Design */
.modal-alert {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 50%, #fbbf24 100%);
    padding: 24px 28px;
    border-radius: 20px;
    margin-bottom: 32px;
    border: 2px solid #f59e0b;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(245, 158, 11, 0.15);
}

.modal-alert::before {
    content: '';
    position: absolute;
    top: -100%;
    right: -20px;
    width: 40px;
    height: 300%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.6), transparent);
    animation: alertShimmer 3s ease-in-out infinite;
}

.modal-alert-content {
    margin: 0;
    color: #92400e;
    font-weight: 700;
    font-size: 1.2rem;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    text-shadow: 0 1px 2px rgba(146, 64, 14, 0.1);
}

.modal-alert-icon {
    display: inline-flex;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: 50%;
    color: white;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 1rem;
    font-weight: 900;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
    animation: iconBounce 2s ease-in-out infinite;
}

/* Ultimate CTA Button */
.modal-cta-button {
    width: 100%;
    padding: 20px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    border: none;
    border-radius: 24px;
    font-weight: 800;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 16px 40px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.modal-cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-cta-button:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 24px 60px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a67d8 0%, #667eea 50%, #764ba2 100%);
}

.modal-cta-button:hover::before {
    left: 100%;
}

.modal-cta-button:active {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.3);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .modal-container {
        max-width: 95%;
    }
    
    .modal-grid {
        gap: 32px;
    }
    
    .modal-content {
        padding: 32px;
    }
}

@media (max-width: 900px) {
    .modal-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .modal-title {
        font-size: 1.875rem;
    }
    
    .modal-content {
        padding: 24px;
    }
    
    .modal-header {
        padding: 24px 32px;
    }
}

@media (max-width: 600px) {
    .modal-overlay {
        padding: 10px;
    }
    
    .modal-container {
        max-height: 95vh;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .modal-header {
        padding: 20px 24px;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .modal-grid {
        gap: 20px;
    }
    
    .modal-cta-button {
        font-size: 1.125rem;
        padding: 16px 24px;
    }
}

/* Advanced Animations */
@keyframes overlayFadeIn {
    from { 
        opacity: 0; 
    }
    to { 
        opacity: 1; 
    }
}

@keyframes modalSlideUp {
    from { 
        opacity: 0; 
        transform: scale(0.9) translateY(60px); 
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
}

@keyframes headerShine {
    0%, 100% { 
        opacity: 0.3; 
    }
    50% { 
        opacity: 0.6; 
    }
}

@keyframes descriptionRotate {
    from { 
        transform: rotate(0deg); 
    }
    to { 
        transform: rotate(360deg); 
    }
}

@keyframes dotPulse {
    0%, 100% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.2); 
    }
}

@keyframes alertShimmer {
    0% { 
        transform: translateX(-40px); 
    }
    50% { 
        transform: translateX(calc(100vw + 40px)); 
    }
    100% { 
        transform: translateX(calc(100vw + 40px)); 
    }
}

@keyframes iconBounce {
    0%, 100% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.1); 
    }
}

/* Focus and Accessibility */
.modal-close:focus,
.modal-cta-button:focus {
    outline: 3px solid rgba(102, 126, 234, 0.6);
    outline-offset: 3px;
}

.modal-item:focus {
    outline: 2px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

@keyframes overlayFadeOut {
    from { 
        opacity: 1; 
    }
    to { 
        opacity: 0; 
    }
}