/* ===================================================================
   SPLITKUN LEGAL PAGES STYLES
   Privacy Policy & Terms and Conditions
   Mobile-first responsive design
   =================================================================== */

/* ===================================================================
   BASE STYLES - Uses centralized design tokens from layout.css
   =================================================================== */

/* ===================================================================
   LEGAL PAGE CONTAINER
   =================================================================== */

.legal-page {
    min-height: 100vh;
    background-color: #f0f0ea;
    font-family: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        sans-serif;
    color: #000;
    line-height: 1.6;
    position: relative; /* Required for absolute positioning of TOC */
}

.legal-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0; /* Remove horizontal padding on mobile */
}

/* ===================================================================
   HEADER SPACING
   =================================================================== */

.legal-header-spacing {
    height: 70px;
}

/* ===================================================================
   TITLE SECTION
   =================================================================== */

.legal-title-section {
    margin-bottom: var(--spacing-2xl);
    text-align: left;
    padding: 0 var(--spacing-sm); /* Add padding back for title section */
}

.legal-page-title {
    font-family: "Nippo", Georgia, serif;
    font-size: clamp(40px, 8vw, 64px); /* Fluid responsive sizing for mobile */
    font-weight: 400;
    line-height: 1.1;
    margin: 0 0 var(--spacing-xl) 0;
    color: #000;
}

.legal-page-date {
    font-size: 18px;
    font-weight: 400;
    color: #666;
    margin: 0;
}

/* ===================================================================
   CONTENT LAYOUT - MOBILE FIRST
   =================================================================== */

.legal-content-layout {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    padding: 0 var(--spacing-sm); /* Add padding for content area */
}

/* Desktop TOC - Hidden on mobile */
.legal-toc-desktop {
    display: none;
}

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

.legal-content {
    font-size: var(--font-size-base);
    line-height: 1.7;
}

/* ===================================================================
   CONTENT TYPOGRAPHY
   =================================================================== */

.legal-content h2 {
    font-family: "Nippo", Georgia, serif;
    font-size: 48px;
    font-weight: 400;
    line-height: 1.2;
    margin: 80px 0 32px 0;
    color: #000;
}

.legal-content h2:first-of-type {
    margin-top: 0;
}

.legal-content h3 {
    font-family: "Satoshi", sans-serif;
    font-size: var(--font-size-2xl);
    font-weight: 600;
    line-height: 1.3;
    margin: var(--spacing-lg) 0 var(--spacing-sm) 0;
    color: #000;
}

.legal-content h4 {
    font-family: "Satoshi", sans-serif;
    font-size: var(--font-size-xl);
    font-weight: 600;
    line-height: 1.3;
    margin: var(--spacing-md) 0 var(--spacing-sm) 0;
    color: #000;
}

.legal-content p {
    margin: 0 0 var(--spacing-md) 0;
    color: var(--color-gray-700);
}

.legal-content ul,
.legal-content ol {
    margin: 0 0 var(--spacing-md) 0;
    padding-left: var(--spacing-lg);
}

.legal-content li {
    margin-bottom: var(--spacing-xs);
    color: var(--color-gray-700);
}

.legal-content li ul,
.legal-content li ol {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.legal-content a {
    color: #000;
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.legal-content a:hover {
    opacity: 0.7;
}

/* ===================================================================
   SPECIAL CONTENT SECTIONS
   =================================================================== */

.dev-info {
    background-color: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.dev-info h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 20px;
}

.contact-info {
    background-color: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.contact-info h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 32px;
}

.legal-divider {
    border: none;
    border-top: 1px solid #ccc;
    margin: 3rem 0;
}

.legal-compliance-note {
    font-style: italic;
    text-align: center;
    color: #666;
    font-size: 14px;
    margin: 2rem 0 1rem 0;
}

.mobile-toc-spacer {
    height: 120px; /* Space for mobile TOC */
}

/* ===================================================================
   MOBILE TOC - FLOATING CAPSULE
   =================================================================== */

.legal-toc-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: var(--spacing-sm);
}

.toc-mobile-toggle {
    width: 100%;
    background-color: #1e1e1e;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 1rem 1.5rem;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.toc-mobile-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.toc-mobile-toggle i {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.toc-mobile-toggle.active i {
    transform: rotate(180deg);
}

/* Mobile TOC Overlay */
.toc-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.toc-mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.toc-mobile-container {
    position: absolute;
    bottom: 0;
    left: var(--spacing-sm);
    right: var(--spacing-sm);
    background-color: #1e1e1e;
    border-radius: 25px 25px var(--border-radius-sm) var(--border-radius-sm);
    max-height: 70vh;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.toc-mobile-overlay.active .toc-mobile-container {
    transform: translateY(0);
}

.toc-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #333;
}

.toc-mobile-header h3 {
    color: white;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.toc-mobile-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.toc-mobile-close:hover {
    background-color: #333;
}

.toc-mobile-close i {
    width: 20px;
    height: 20px;
}

.toc-mobile-nav {
    max-height: calc(70vh - 80px);
    overflow-y: auto;
    padding: 1rem 1.5rem 1.5rem;
}

.toc-mobile-nav ol {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: toc-counter;
}

.toc-mobile-nav li {
    counter-increment: toc-counter;
    margin-bottom: 0.75rem;
}

.toc-mobile-nav a {
    color: #ccc;
    text-decoration: none;
    font-size: 16px;
    line-height: 1.4;
    display: block;
    padding: 0.5rem 0;
    transition: color 0.2s ease;
    position: relative;
}

.toc-mobile-nav a::before {
    content: counter(toc-counter) ".";
    margin-right: 0.75rem;
    font-weight: 600;
    color: white;
}

.toc-mobile-nav a:hover {
    color: white;
}

/* ===================================================================
   TABLET BREAKPOINT - 768px and up
   =================================================================== */

@media (min-width: 768px) {
    .legal-title-section {
        padding: 0 var(--spacing-lg);
    }

    .legal-content-layout {
        padding: 0 var(--spacing-lg);
    }

    .legal-header-spacing {
        height: 80px;
    }

    .legal-page-title {
        font-size: 96px; /* Restored larger size for tablet and up */
    }

    .legal-content h2 {
        font-size: 56px;
    }

    .legal-toc-mobile {
        padding: var(--spacing-lg);
    }
}

/* ===================================================================
   DESKTOP BREAKPOINT - 1024px and up
   =================================================================== */

@media (min-width: 1024px) {
    /* Hide mobile TOC */
    .legal-toc-mobile {
        display: none;
    }

    /* Hide mobile TOC spacer on desktop */
    .mobile-toc-spacer {
        display: none;
    }

    /* Show and configure desktop TOC */
    .legal-toc-desktop {
        display: block;
        width: 300px;
        flex-shrink: 0;
    }

    .legal-content-layout {
        flex-direction: row;
        gap: 86px;
    }

    .legal-content-main {
        flex: 1;
        min-width: 0; /* Prevents flex overflow */
    }

    /* Desktop TOC Styling */
    .toc-container {
        position: sticky;
        top: calc(80px + var(--spacing-lg));
        background-color: #f0f0ea;
        padding: var(--spacing-md);
        border-radius: var(--border-radius-sm);
        z-index: 10; /* Ensure proper layering above content */
    }

    .toc-title {
        font-size: 18px;
        font-weight: 600;
        margin: 0 0 1rem 0;
        color: #000;
    }

    .toc-nav ol {
        list-style: none;
        padding: 0;
        margin: 0;
        counter-reset: toc-counter;
    }

    .toc-nav li {
        counter-increment: toc-counter;
        margin-bottom: 0.5rem;
    }

    .toc-nav a {
        color: #666;
        text-decoration: none;
        font-size: 14px;
        line-height: 1.4;
        display: block;
        padding: 0.25rem 0;
        transition: color 0.2s ease;
        position: relative;
    }

    .toc-nav a::before {
        content: counter(toc-counter) ".";
        margin-right: 0.5rem;
        font-weight: 600;
        color: #000;
    }

    .toc-nav a:hover,
    .toc-nav a.active {
        color: #000;
    }
}

/* ===================================================================
   LARGE DESKTOP BREAKPOINT - 1200px and up
   =================================================================== */

@media (min-width: 1200px) {
    .legal-container {
        padding: 0 3rem;
    }

    .legal-content {
        font-size: 18px;
    }

    .toc-nav a {
        font-size: 15px;
    }
}

/* ===================================================================
   ACCESSIBILITY AND FOCUS STATES
   =================================================================== */

.toc-mobile-toggle:focus,
.toc-mobile-close:focus,
.toc-nav a:focus,
.toc-mobile-nav a:focus {
    outline: 2px solid #000;
    outline-offset: 2px;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .toc-mobile-toggle,
    .toc-mobile-overlay,
    .toc-mobile-container,
    .toc-nav a,
    .toc-mobile-nav a {
        transition: none;
    }
}
