/**
 * Terms of Use Page Styles
 * 
 * Custom CSS for Terms of Use / Terms & Conditions page
 * Clean, minimal, modern design
 * 
 * @package Horizon
 */

/* ============================================
   Container & Layout
   ============================================ */

.terms-container {
    position: relative;
}

.terms-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
}

.terms-sidebar {
    position: sticky;
    top: 120px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.terms-main {
    min-width: 0; /* Prevents grid overflow */
}

.terms-content {
    color: #374151;
    line-height: 1.8;
}

.terms-content p {
    margin-bottom: 1.25rem;
}

.terms-content ul,
.terms-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

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

/* ============================================
   Table of Contents
   ============================================ */

.terms-toc {
    position: relative;
    max-height: none;
    overflow-y: auto;
    z-index: 10;
}

.terms-toc h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

.terms-toc ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.terms-toc li {
    margin-bottom: 0.5rem;
}

.terms-toc a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    text-decoration: none;
    color: #4f46e5;
    font-size: 0.9375rem;
}

.terms-toc a:hover {
    background-color: #f9e6e6;
    color: #4338ca;
    padding-left: 1rem;
}

/* ============================================
   Sections
   ============================================ */

.terms-section {
    scroll-margin-top: 120px;
    padding-top: 1rem;
}

.terms-section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
    margin-top: 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.terms-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.terms-section p {
    color: #374151;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.terms-section a {
    color: #4f46e5;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.terms-section a:hover {
    color: #4338ca;
}

.terms-section ul,
.terms-section ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.terms-section li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

/* ============================================
   Back to Top Button
   ============================================ */

.terms-back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    background-color: #4f46e5;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
}

.terms-back-to-top.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.terms-back-to-top:hover {
    background-color: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.terms-back-to-top:active {
    transform: translateY(0);
}

.terms-back-to-top svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* ============================================
   Smooth Scroll Behavior
   ============================================ */

html {
    scroll-behavior: smooth;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
    .terms-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .terms-sidebar {
        position: relative;
        top: 0;
        max-height: none;
    }

    .terms-toc {
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .terms-section {
        scroll-margin-top: 80px;
    }

    .terms-section h2 {
        font-size: 1.75rem;
    }

    .terms-section h3 {
        font-size: 1.25rem;
    }

    .terms-back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 3rem;
        height: 3rem;
    }

    .terms-back-to-top svg {
        width: 1.25rem;
        height: 1.25rem;
    }
}

@media (max-width: 640px) {
    .terms-toc {
        padding: 1rem;
    }

    .terms-toc h2 {
        font-size: 1.125rem;
    }

    .terms-toc a {
        font-size: 0.875rem;
        padding: 0.375rem 0.5rem;
    }

    .terms-section h2 {
        font-size: 1.5rem;
    }

    .terms-section h3 {
        font-size: 1.125rem;
    }

    .terms-content {
        font-size: 0.9375rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .terms-toc {
        position: relative;
        page-break-after: always;
    }

    .terms-back-to-top {
        display: none !important;
    }

    .terms-section {
        page-break-inside: avoid;
    }
}

