/* Legal Pages Styles (Privacy Policy, Terms of Service, Cookie Notice) */

/* Box sizing for all elements */
.legal-page * {
    box-sizing: border-box;
}

/* Reset and base styles for legal pages */
.legal-page {
    background-color: var(--black100);
    color: var(--white100);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Container */
.legal-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 96px;
    padding: 24px;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
}

/* Main Content Container */
.legal-main {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1392px;
    background-color: var(--black90);
    border-radius: 32px;
    padding: 24px;
    gap: 24px;
}

/* Header */
.legal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 0;
}

.logo-link {
    display: inline-block;
}

.header-logo {
    width: 64px;
    height: 64px;
    filter: drop-shadow(0px 4px 8px rgba(0, 0, 0, 0.25));
}

/* Main Body Layout */
.legal-body {
    display: flex;
    gap: 64px;
    width: 100%;
    align-self: stretch;
    min-height: 100vh;
    align-items: flex-start;
}

/* Sidebar Navigation */
.legal-nav {
    position: sticky;
    top: -140px;
    width: 320px;
    flex-shrink: 0;
    padding: 24px;
    padding-top: 180px;
    height: fit-content;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 10;
    /* Hide scrollbar for Chrome, Safari and Opera */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.legal-nav::-webkit-scrollbar {
    display: none;
}

.nav-title {
    color: var(--white100);
    margin: 0 0 16px 0;
}

.nav-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nav-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--white100);
    text-decoration: none;
    transition: color 0.2s ease;
    position: relative;
    padding-left: 16px;
}

.nav-item:hover {
    color: var(--violet20);
}

.nav-item.active {
    color: var(--violet20);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 8px;
    height: 8px;
    background-color: var(--violet20);
    border-radius: 50%;
    transform: translateY(-50%);
}

.nav-text {
    flex: 1;
}

/* Content Area */
.legal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 64px;
    max-width: 600px;
    min-width: 0;
    /* Prevents flex items from overflowing */
    overflow-x: visible;
}

.content-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.content-title {
    font-family: var(--font-h1);
    font-size: 64px;
    font-weight: 500;
    line-height: 72px;
    color: var(--white100);
    margin: 0;
}

.last-modified {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 28px;
    color: var(--white100);
    margin: 0;
    width: 100%;
}

/* Content Sections */
.content-sections {
    display: flex;
    flex-direction: column;
    gap: 40px;
    width: 100%;
    padding-bottom: 40px;
    /* Ensures last sections can be scrolled to */
    overflow-x: visible;
}

.content-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
    scroll-margin-top: 80px;
    width: 100%;
    min-height: 200px;
    overflow-x: visible;
}

/* Last section needs extra height to be scrollable */
.content-section:last-child {
    min-height: 200px;
}

.section-title {
    font-family: var(--font-h2);
    font-size: 48px;
    font-weight: 500;
    line-height: 56px;
    color: var(--white100);
    margin: 0;
    max-width: 600px;
    width: 100%;
    text-align: left;
}

.section-text {
    color: var(--white100);
    margin: 0;
    max-width: 600px;
    width: 100%;
}

.section-text a {
    color: var(--violet20);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.section-text a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Subsections */
.subsection {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 600px;
    width: 100%;
}

.subsection-title {
    font-family: var(--font-h4);
    font-size: 22px;
    font-weight: 600;
    line-height: 30px;
    color: var(--white100);
    margin: 0;
}

/* Lists */
.section-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 24px;
    margin: 0;
    max-width: 600px;
    width: 100%;
    list-style-type: disc;
}

/* Numbered lists */
ol.section-list {
    list-style-type: decimal;
}

.section-list li {
    color: var(--white100);
    list-style-type: inherit;
}

/* Lists without bullets */
.section-list-no-bullet {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 24px;
    margin: 0;
    max-width: 600px;
    width: 100%;
    list-style: none;
}

.section-list-no-bullet li {
    color: var(--white100);
}

/* Remove bullets from lists in legal content EXCEPT section-list */
.legal-content ul:not(.section-list),
.legal-content ol:not(.section-list) {
    list-style: none;
    padding-left: 16px;
    margin: 0;
}

.legal-content ul:not(.section-list) li,
.legal-content ol:not(.section-list) li {
    color: var(--white100);
    margin-bottom: 8px;
}

.legal-content ul:not(.section-list) li:last-child,
.legal-content ol:not(.section-list) li:last-child {
    margin-bottom: 0;
}

/* Contact Info */
.contact-info {
    max-width: 600px;
    width: 100%;
}

.contact-info p {
    font-family: var(--font-primary);
    font-size: 18px;
    font-weight: 500;
    line-height: 28px;
    color: var(--white100);
    margin: 0;
}

.contact-info a {
    color: var(--violet20);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.contact-info a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Tables */
.table-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 840px;
    max-width: none;
    margin-left: -120px;
    margin-right: -120px;
}

.table-title {
    font-family: var(--font-h3);
    font-size: 22px;
    font-weight: 700;
    line-height: 30px;
    color: var(--white100);
    margin: 0;
    margin-left: 120px;
}

.legal-table {
    width: calc(100% - 120px);
    /* Subtract left margin from total width */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-left: 120px;
    /* Same as table-title to align with text content */
}

.legal-table table {
    width: 100%;
    border-collapse: collapse;
}

.legal-table th,
.legal-table td {
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    color: var(--white100);
    text-align: left;
    padding: 12px 16px;
    vertical-align: top;
}

.legal-table th {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
    font-weight: 600;
}

.legal-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.legal-table tr:last-child {
    border-bottom: none;
}

.legal-table th:first-child,
.legal-table td:first-child {
    padding-left: 0;
    width: 40%;
}

.legal-table th:nth-child(2),
.legal-table td:nth-child(2) {
    width: 25%;
}

.legal-table th:nth-child(3),
.legal-table td:nth-child(3) {
    width: 35%;
}

/* Bulleted lists within table cells */
.legal-content .legal-table ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc !important;
}

.legal-table ul li {
    margin-bottom: 8px;
    list-style-type: disc;
}

.legal-table ul li:last-child {
    margin-bottom: 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .legal-body {
        flex-direction: column;
        gap: 40px;
    }

    .legal-nav {
        /* Keep sticky positioning on smaller screens */
        width: 100%;
        padding-top: 24px;
        max-height: none;
    }

    .legal-content {
        max-width: 100%;
    }

    /* Responsive typography for section-text */
    .section-text {
        font-size: var(--body-regular-font-size-tablet);
        line-height: var(--body-regular-line-height-tablet);
    }

    /* Adjust table margins for medium screens */
    .table-section {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .legal-table {
        width: 100%;
        margin-left: 0;
        /* Remove left margin on medium screens */
    }

    .table-title {
        margin-left: 0;
    }
}

/* Medium screens - prevent horizontal overflow */
@media (min-width: 769px) and (max-width: 1200px) {
    .legal-nav {
        width: 280px;
        /* Slightly smaller nav on medium screens */
        position: sticky;
        top: -140px;
    }

    .legal-body {
        flex-direction: row;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    a {
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-all;
        white-space: normal;
    }

    .legal-container {
        padding: 16px;
        gap: 48px;
    }

    .legal-main {
        padding: 16px;
        gap: 16px;
    }

    .legal-header {
        padding: 0;
    }

    .header-logo {
        width: 48px;
        height: 48px;
    }

    .legal-body {
        gap: 32px;
    }

    .content-header,
    .section-title,
    .section-text,
    .subsection,
    .section-list,
    .contact-info {
        max-width: 100%;
    }

    .content-title {
        font-size: 40px;
        line-height: 48px;
    }

    .section-title {
        font-size: 32px;
        line-height: 40px;
    }

    .section-text {
        font-size: var(--body-regular-font-size-mobile);
        line-height: var(--body-regular-line-height-mobile);
    }

    .last-modified {
        font-size: 16px;
        line-height: 24px;
    }

    /* Adjust table styling for mobile */
    .table-section {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .legal-table {
        width: 100%;
        font-size: 14px;
        margin-left: 0;
        overflow-x: scroll;
        /* Changed from auto to scroll to always show scrollbar */
        -webkit-overflow-scrolling: touch;
    }

    /* Force scrollbar to always be visible on mobile webkit browsers */
    .legal-table::-webkit-scrollbar {
        height: 8px;
        -webkit-appearance: none;
    }

    .legal-table::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 4px;
    }

    .legal-table::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 4px;
    }

    .legal-table::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.5);
    }

    .legal-table table {
        min-width: 600px;
        /* Set minimum width to force horizontal scroll */
    }

    .table-title {
        margin-left: 0;
        font-size: 20px;
    }

    .legal-table th,
    .legal-table td {
        font-size: 14px;
        line-height: 20px;
        padding: 8px 12px;
    }

    /* Allow text wrapping in cells with lists */
    .legal-table td ul {
        white-space: normal;
    }

    /* Adjust column widths for mobile - using fixed widths for better control */
    .legal-table th:first-child,
    .legal-table td:first-child {
        width: 250px;
        min-width: 250px;
    }

    .legal-table th:nth-child(2),
    .legal-table td:nth-child(2) {
        width: 180px;
        min-width: 180px;
    }

    .legal-table th:nth-child(3),
    .legal-table td:nth-child(3) {
        width: 220px;
        min-width: 220px;
    }

    /* Adjust list styling in tables for mobile */
    .legal-table ul {
        padding-left: 16px;
    }

    .legal-table ul li {
        margin-bottom: 6px;
        font-size: 13px;
        line-height: 18px;
    }

    .legal-nav {
        display: none;
    }
}

body.legal-page {
    overflow-x: hidden !important;
}