/* General Styling */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

.terms-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Table of Contents */
#toc {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
}

#toc h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #212529;
}

#toc ul {
    list-style: none;
    padding-left: 0;
}

#toc ul ul {
    padding-left: 1rem;
    margin-top: 0.25rem;
}

#toc li {
    margin-bottom: 0.5rem;
}

#toc a {
    color: #495057;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

#toc a:hover {
    color: #007bff;
}

#toc .toc-h2 {
    font-weight: 600;
    font-size: 0.95rem;
}

#toc .toc-h3 {
    font-size: 0.875rem;
}

#toc .toc-h4 {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Main Content */
.content-area {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.content-area h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #212529;
}

.content-area h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: #212529;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 0.5rem;
}

.content-area h2:first-of-type {
    margin-top: 1rem;
}

.content-area h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: #343a40;
}

.content-area h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: #495057;
}

.content-area p {
    margin-bottom: 1rem;
    text-align: justify;
}

.content-area ul, .content-area ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.content-area li {
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.75rem;
    font-weight: 300;
    color: #6c757d;
    margin-bottom: 1rem;
}

.meta-info {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Print Styles */
@media print {
    body {
        font-size: 11pt;
        line-height: 1.5;
    }

    /* Hide navigation elements */
    #header,
    header,
    .header,
    .header-inner-pages,
    .fixed-top,
    .sticky-top,
    #secondary-navbar,
    .breadcrumbs,
    #footer,
    footer,
    .back-to-top,
    #preloader {
        display: none !important;
    }

    .terms-container {
        max-width: 100%;
        padding: 0;
        margin-top: 0;
    }

    #toc {
        display: none;
    }

    .col-lg-3 {
        display: none;
    }

    .col-lg-9 {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }

    .content-area {
        box-shadow: none;
        padding: 0;
    }

    h1 {
        font-size: 24pt;
        page-break-after: avoid;
    }

    h2 {
        font-size: 18pt;
        page-break-after: avoid;
        margin-top: 20pt;
    }

    h3 {
        font-size: 14pt;
        page-break-after: avoid;
        margin-top: 15pt;
    }

    h4 {
        font-size: 12pt;
        page-break-after: avoid;
        margin-top: 12pt;
    }

    p, li {
        orphans: 3;
        widows: 3;
    }

    h1, h2, h3, h4 {
        page-break-after: avoid;
    }

    ul, ol, p {
        page-break-inside: avoid;
    }

    @page {
        margin: 2cm;
        @bottom-right {
            content: counter(page) " of " counter(pages);
        }
    }
}

/* Mobile Responsiveness */
@media (max-width: 991px) {
    #toc {
        position: relative;
        top: 0;
        margin-bottom: 2rem;
        max-height: 400px;
    }

    .content-area h1 {
        font-size: 2rem;
    }

    .content-area h2 {
        font-size: 1.5rem;
    }

    .content-area h3 {
        font-size: 1.25rem;
    }

    .content-area h4 {
        font-size: 1.1rem;
    }
}
