/* Premium Legal Content Modal Styles */
.legal-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.legal-modal.active {
    display: flex;
}

.legal-modal-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(169, 20, 70, 0.9) 0%, rgba(138, 16, 56, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.legal-modal-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5), 0 0 120px rgba(169, 20, 70, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1;
}

.legal-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 30px 35px;
    background: linear-gradient(135deg, #a91446 0%, #8a1038 100%);
    color: #ffffff;
    border-bottom: none;
    position: relative;
    overflow: hidden;
}

.legal-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    opacity: 0.6;
}

.legal-modal-header h2 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 700;
    color: #ffffff;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.legal-modal-header h2::before {
    content: '📄';
    font-size: 0.9em;
}

.legal-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4em;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
}

.legal-modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: rotate(90deg) scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.legal-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    line-height: 1.8;
}

/* Premium Content Styling */
.legal-modal-body h1,
.legal-modal-body h2,
.legal-modal-body h3 {
    color: #a91446;
    margin-top: 30px;
    margin-bottom: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    position: relative;
    padding-left: 20px;
}

.legal-modal-body h1::before,
.legal-modal-body h2::before,
.legal-modal-body h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: linear-gradient(180deg, #a91446 0%, #8a1038 100%);
    border-radius: 2px;
}

.legal-modal-body h1 {
    font-size: 2em;
    border-bottom: 3px solid #a91446;
    padding-bottom: 12px;
    margin-top: 0;
    background: linear-gradient(to right, rgba(169, 20, 70, 0.05) 0%, transparent 100%);
    padding: 15px 15px 12px 20px;
    margin-left: -15px;
    margin-right: -15px;
    border-radius: 8px 8px 0 0;
}

.legal-modal-body h2 {
    font-size: 1.6em;
}

.legal-modal-body h3 {
    font-size: 1.3em;
    color: #8a1038;
}

.legal-modal-body p {
    margin-bottom: 18px;
    color: #2c3e50;
    line-height: 1.9;
    font-size: 15px;
}

.legal-modal-body p:first-of-type {
    font-size: 16px;
    color: #1a252f;
    font-weight: 500;
}

.legal-modal-body ul,
.legal-modal-body ol {
    margin: 20px 0;
    padding-left: 35px;
}

.legal-modal-body li {
    margin-bottom: 12px;
    color: #2c3e50;
    line-height: 1.8;
    position: relative;
}

.legal-modal-body ul li::marker {
    color: #a91446;
    font-size: 1.2em;
}

.legal-modal-body ol li::marker {
    color: #a91446;
    font-weight: 700;
}

.legal-modal-body strong {
    color: #a91446;
    font-weight: 700;
    background: linear-gradient(to bottom, transparent 50%, rgba(169, 20, 70, 0.1) 50%);
}

.legal-modal-body a {
    color: #a91446;
    text-decoration: none;
    border-bottom: 2px solid rgba(169, 20, 70, 0.3);
    transition: all 0.3s ease;
    font-weight: 600;
}

.legal-modal-body a:hover {
    color: #8a1038;
    border-bottom-color: #8a1038;
    background: rgba(169, 20, 70, 0.05);
}

.legal-modal-body table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 25px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.legal-modal-body table th,
.legal-modal-body table td {
    padding: 16px;
    border: 1px solid #e9ecef;
    text-align: left;
}

.legal-modal-body table th {
    background: linear-gradient(135deg, #a91446 0%, #8a1038 100%);
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.05em;
    border: none;
}

.legal-modal-body table tr:nth-child(even) {
    background: #f8f9fa;
}

.legal-modal-body table tr:hover {
    background: rgba(169, 20, 70, 0.04);
    transition: background 0.2s ease;
}

/* Premium Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: #a91446;
}

.loading-spinner i {
    font-size: 4em;
    margin-bottom: 20px;
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    font-size: 1.2em;
    color: #6c757d;
    font-weight: 500;
}

/* Premium Error Message */
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: #dc3545;
    text-align: center;
}

.error-message i {
    font-size: 4em;
    margin-bottom: 20px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.error-message p {
    font-size: 1.2em;
    color: #6c757d;
    margin-bottom: 25px;
    font-weight: 500;
}

.error-message .btn {
    background: linear-gradient(135deg, #a91446 0%, #8a1038 100%);
    color: #ffffff;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(169, 20, 70, 0.3);
}

.error-message .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(169, 20, 70, 0.4);
}

/* Premium Animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(20px);
    }
}

@keyframes modalSlideUp {
    from {
        transform: translateY(60px) scale(0.92);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Premium Scrollbar */
.legal-modal-body::-webkit-scrollbar {
    width: 12px;
}

.legal-modal-body::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 10px;
    border: 3px solid #ffffff;
}

.legal-modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #a91446 0%, #8a1038 100%);
    border-radius: 10px;
    border: 3px solid #f8f9fa;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.2);
}

.legal-modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #c11850 0%, #a91446 100%);
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
}

/* Premium Responsive Design */
@media (max-width: 1024px) {
    .legal-modal-container {
        max-width: 95%;
    }
    
    .legal-modal-body {
        padding: 25px;
    }
}

@media (max-width: 768px) {
    .legal-modal {
        padding: 0;
    }

    .legal-modal-container {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    .legal-modal-header {
        padding: 20px 25px;
    }
    
    .legal-modal-header h2 {
        font-size: 1.4em;
    }

    .legal-modal-header h2::before {
        font-size: 0.8em;
    }
    
    .legal-modal-close {
        width: 38px;
        height: 38px;
        font-size: 1.2em;
    }
    
    .legal-modal-body {
        padding: 20px;
    }

    .legal-modal-body h1 {
        font-size: 1.6em;
        padding: 12px 12px 10px 18px;
        margin-left: -10px;
        margin-right: -10px;
    }

    .legal-modal-body h2 {
        font-size: 1.4em;
    }

    .legal-modal-body h3 {
        font-size: 1.2em;
    }

    .legal-modal-body p {
        font-size: 14px;
    }

    .legal-modal-body table {
        font-size: 13px;
    }

    .legal-modal-body table th,
    .legal-modal-body table td {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .legal-modal-header {
        padding: 18px 20px;
    }

    .legal-modal-header h2 {
        font-size: 1.2em;
        gap: 8px;
    }

    .legal-modal-close {
        width: 36px;
        height: 36px;
    }

    .legal-modal-body {
        padding: 18px;
    }

    .legal-modal-body h1,
    .legal-modal-body h2,
    .legal-modal-body h3 {
        padding-left: 15px;
    }

    .legal-modal-body table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
