/**
 * Legal Modal Styles
 * Z-Index set higher than Show Us / Contact Us modals (10000)
 */

/* Modal Overlay */
.legal-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.90);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 11000;
    /* Higher than other modals */
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.legal-modal-overlay.active {
    display: flex;
}

/* Modal Container */
.legal-modal {
    background: #1a1a1a;
    border-radius: 12px;
    width: 100%;
    max-width: 800px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    border: 1px solid #333;
}

/* Header */
.legal-modal-header {
    padding: 24px 30px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

.legal-modal-title {
    font-family: 'Sui Generis', Georgia, serif;
    font-size: 24px;
    color: #ffffff;
    letter-spacing: 1px;
    margin: 0;
}

.legal-modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.legal-modal-close::before,
.legal-modal-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 2px;
    background: #888;
    transform-origin: center;
    transition: background 0.2s;
}

.legal-modal-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.legal-modal-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.legal-modal-close:hover::before,
.legal-modal-close:hover::after {
    background: #ffffff;
}

/* Tabs */
.legal-modal-tabs {
    display: flex;
    background: #111;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

.legal-modal-tab {
    flex: 1;
    padding: 16px;
    background: none;
    border: none;
    color: #888;
    font-family: 'Sui Generis', Georgia, serif;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.legal-modal-tab:hover {
    color: #fff;
    background: #161616;
}

.legal-modal-tab.active {
    color: #fff;
    border-bottom-color: #EF405C;
    background: #1a1a1a;
}

/* Body */
.legal-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    background: #1a1a1a;
}

.legal-tab-content {
    display: none;
}

.legal-tab-content.active {
    display: block;
}

/* Content Styling - Dense Layout */
.legal-text h2 {
    font-family: 'Sui Generis', Georgia, serif;
    font-size: 18px;
    color: #fff;
    margin-top: 12px;
    margin-bottom: 2px;
}

.legal-text h2:first-child {
    margin-top: 0;
}

.legal-text h3 {
    font-family: 'Sui Generis', Georgia, serif;
    font-size: 15px;
    color: #ddd;
    margin-top: 8px;
    margin-bottom: 2px;
}

.legal-text p,
.legal-text li {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #ccc;
    line-height: 1.4;
    margin-bottom: 2px;
    margin-top: 0;
}

.legal-text ul {
    padding-left: 20px;
    margin-top: 2px;
    margin-bottom: 2px;
}

.legal-text li {
    margin-bottom: 0;
    padding-bottom: 0;
}

.legal-section-divider {
    border: 0;
    height: 1px;
    background: #333;
    margin: 10px 0;
}

/* Hyperlinks in legal text */
.legal-text a {
    color: #FD724C;
    text-decoration: none;
    transition: color 0.2s;
}

.legal-text a:hover {
    color: #EF405C;
}

/* Footer */
.legal-modal-footer {
    padding: 16px 30px;
    background: #111;
    border-top: 1px solid #333;
    text-align: center;
    flex-shrink: 0;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.legal-modal-footer-text {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: #666;
    margin: 0;
}

.legal-modal-footer-text a {
    color: #888;
    text-decoration: underline;
}

/* Scrollbar */
.legal-modal-body::-webkit-scrollbar {
    width: 8px;
}

.legal-modal-body::-webkit-scrollbar-track {
    background: #111;
}

.legal-modal-body::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.legal-modal-body::-webkit-scrollbar-thumb:hover {
    background: #444;
}

@media (max-width: 600px) {
    .legal-modal-overlay {
        padding: 0 24px !important;
        overflow: hidden !important;
        overscroll-behavior: none;
        touch-action: none;
    }

    .legal-modal {
        max-height: 90dvh;
        height: auto;
        width: 100% !important;
        max-width: 500px;
        min-width: 0;
        margin: auto !important;
        left: auto;
        right: auto;
        border-radius: 12px;
        border: 1px solid #333;
        box-sizing: border-box;
        overscroll-behavior: contain;
        touch-action: auto;
        overflow-x: hidden;
    }

    .legal-modal-body {
        padding-bottom: 80px;
        overscroll-behavior: contain;
    }
}