﻿/* terms.css - 100% Width & Dark Sidebar Styling */
:root {
    /* Main Brand Colors */
    --primary: rgb(26, 54, 93);
    --primary-light: rgb(45, 74, 128);
    --secondary: rgb(184, 134, 11);
    --secondary-light: rgb(218, 165, 32);
    --accent: rgb(139, 69, 19);
    /* Text Colors */
    --text: rgb(45, 55, 72);
    --text-light: rgb(74, 85, 104);
    /* Backgrounds */
    --background: rgb(248, 249, 250);
    --white: rgb(255, 255, 255);
    --gray-light: rgb(241, 245, 249);
    --border: rgb(226, 232, 240);
    /* Sidebar Dark Theme Colors (Deep Green/Blue/Grey) */
    --sidebar-bg: rgb(30, 41, 59); /* Dark Slate / Petrol Blue */
    --sidebar-text: rgb(226, 232, 240);
    --sidebar-text-muted: rgb(148, 163, 184);
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    --sidebar-active-bg: rgba(184, 134, 11, 0.2);
    /* Effects */
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.08);
    --radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.7;
    color: var(--text);
    background-color: var(--background);
    background-image: linear-gradient(135deg, rgb(245, 247, 250) 0%, rgb(248, 249, 250) 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* 100% Width Layout Wrapper */
.page-container {
    width: 100%;
    padding: 20px;
}

.terms-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0;
    display: grid;
    /* Fixed Sidebar | Fluid Content */
    grid-template-columns: 320px 1fr;
    gap: 30px;
    position: relative;
}

/* --- MOBILE TOGGLE BUTTON (Hidden on Desktop) --- */
.mobile-toc-toggle {
    display: none; /* Hidden by default */
    width: 100%;
    padding: 15px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    margin-bottom: 15px;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
}

    .mobile-toc-toggle span {
        font-size: 1.2rem;
    }

/* Sidebar Navigation - Dark Theme */
.sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    border-radius: var(--radius);
    padding: 30px 20px;
    box-shadow: var(--shadow);
    border-left: 5px solid var(--secondary);
    scrollbar-width: thin;
    scrollbar-color: var(--sidebar-text-muted) var(--sidebar-bg);
    z-index: 100;
}

    .sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .sidebar::-webkit-scrollbar-track {
        background: var(--sidebar-bg);
    }

    .sidebar::-webkit-scrollbar-thumb {
        background-color: var(--sidebar-text-muted);
        border-radius: 20px;
    }

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 1200px) {
    .terms-wrapper {
        gap: 20px;
    }
}

/* TABLET & MOBILE */
@media (max-width: 992px) {
    .terms-wrapper {
        display: block; /* Switch to block to stack elements naturally */
    }

    /* Show the toggle button */
    .mobile-toc-toggle {
        display: flex;
    }

    /* Hide Sidebar by default on mobile */
    .sidebar {
        display: none;
        position: relative; /* Remove sticky */
        top: 0;
        width: 100%;
        max-height: none; /* Allow full expansion */
        margin-bottom: 20px;
        border-left: none;
        border-top: 5px solid var(--secondary);
    }

        /* Class added by JS to show it */
        .sidebar.active {
            display: block;
            animation: slideDown 0.3s ease-out;
        }
}

/* MOBILE ONLY - Hide sidebar navigation but keep main title */
@media (max-width: 768px) {
    .mobile-toc-toggle {
        display: none;
    }

    .sidebar {
        display: none !important;
    }

    .terms-container {
        padding: 20px 15px;
    }

    /* Keep the header section but adjust for mobile */
    .header-section {
        text-align: center;
        margin-bottom: 30px;
        padding-bottom: 20px;
        border-bottom: 1px solid var(--border);
    }

        .header-section h1 {
            font-size: 1.8rem;
            margin-bottom: 10px;
            line-height: 1.3;
        }

    .last-updated {
        font-size: 0.9rem;
        margin-bottom: 0;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sidebar-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--white);
    margin-bottom: 5px;
}

.sidebar-subtitle {
    font-size: 0.9rem;
    color: var(--sidebar-text-muted);
}

/* Progress Bar */
.progress-container {
    margin-bottom: 25px;
}

.progress-bar {
    height: 6px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--secondary-light));
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--sidebar-text-muted);
    text-align: right;
}

/* Table of Contents */
.toc {
    list-style: none;
    margin-bottom: 30px;
}

    .toc li {
        margin-bottom: 8px;
        position: relative;
    }

    .toc a {
        display: block;
        padding: 10px 14px;
        color: var(--sidebar-text-muted);
        text-decoration: none;
        border-radius: 4px;
        transition: var(--transition);
        font-size: 0.95rem;
        position: relative;
        border-left: 3px solid transparent;
    }

        .toc a:hover {
            color: var(--white);
            background-color: var(--sidebar-hover);
        }

        .toc a.active {
            color: var(--secondary-light);
            font-weight: 600;
            background-color: var(--sidebar-active-bg);
            border-left-color: var(--secondary);
        }

/* Search Box */
.search-box {
    margin-bottom: 25px;
    position: relative;
}

    .search-box input {
        width: 100%;
        padding: 10px 15px 10px 40px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: var(--radius);
        font-size: 0.9rem;
        background-color: rgba(255, 255, 255, 0.05);
        color: var(--white);
        transition: var(--transition);
    }

        .search-box input:focus {
            outline: none;
            border-color: var(--secondary);
            background-color: rgba(0, 0, 0, 0.2);
        }

        .search-box input::placeholder {
            color: rgba(255, 255, 255, 0.5);
        }

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sidebar-text-muted);
}

/* Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn-primary {
    background-color: var(--secondary);
    color: var(--white);
}

    .btn-primary:hover {
        background-color: var(--secondary-light);
        transform: translateY(-2px);
    }

.btn-secondary {
    background-color: transparent;
    color: var(--sidebar-text);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

    .btn-secondary:hover {
        background-color: var(--sidebar-hover);
        border-color: var(--white);
        color: var(--white);
    }

/* Main Content Area */
.terms-container {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 50px 60px;
    position: relative;
    overflow: hidden;
    min-height: 80vh;
}

@media (max-width: 768px) {
    .terms-container {
        padding: 30px 20px;
    }

        .terms-container h1 {
            font-size: 2rem;
        }
}

.terms-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--secondary), var(--secondary-light), var(--secondary));
}

.header-section {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.terms-container h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    color: var(--primary);
    margin-bottom: 15px;
    line-height: 1.2;
}

.last-updated {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

.intro-text {
    font-size: 1.1rem;
    color: var(--text);
    max-width: 900px;
    margin: 0 auto;
}

.terms-container h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--primary);
    margin: 50px 0 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

    .terms-container h2::after {
        content: "";
        position: absolute;
        bottom: -1px;
        left: 0;
        width: 80px;
        height: 3px;
        background-color: var(--secondary);
    }

.terms-container p {
    margin-bottom: 25px;
    font-size: 1.05rem;
    color: var(--text);
    line-height: 1.7;
    max-width: 1400px;
}

.terms-container a {
    color: var(--primary-light);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

    .terms-container a:hover {
        color: var(--primary);
        border-bottom-color: var(--primary-light);
    }

.highlight-box {
    background-color: rgba(184, 134, 11, 0.05);
    border-left: 4px solid var(--secondary);
    padding: 25px;
    margin: 30px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
}

    .highlight-box p:last-child {
        margin-bottom: 0;
    }

.numbered-list {
    list-style-type: none;
    counter-reset: item;
    margin: 25px 0;
}

    .numbered-list li {
        counter-increment: item;
        margin-bottom: 20px;
        padding-left: 45px;
        position: relative;
        max-width: 1400px;
    }

        .numbered-list li::before {
            content: counter(item);
            position: absolute;
            left: 0;
            top: 0;
            width: 32px;
            height: 32px;
            background-color: var(--secondary);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.9rem;
            font-weight: 600;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }

.footer-note {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-light);
    font-size: 0.95rem;
}

.section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

    .section.visible {
        opacity: 1;
        transform: translateY(0);
    }

@media print {
    body {
        background: white;
        padding: 0;
    }

    .page-container {
        padding: 0;
        width: 100%;
    }

    .sidebar, .btn, .mobile-toc-toggle {
        display: none !important;
    }

    .terms-wrapper {
        display: block;
    }

    .terms-container {
        box-shadow: none;
        padding: 0;
        width: 100%;
    }

        .terms-container p, .numbered-list li {
            max-width: none;
        }
}
