/* Terms & Conditions Page Styles
   Zoho-inspired sticky sidebar with scroll-spy
   Deep Authority Blue (#004C97) theme
*/

/* ========================================
   PAGE STRUCTURE
   ======================================== */

/* Wrapper ensures content starts below fixed nav */
.terms-page-wrapper {
    margin-top: 80px;
}

/* Blue header banner */
.terms-header {
    background: linear-gradient(135deg, #004C97 0%, #003366 100%);
    padding: 3.5rem 6%;
    text-align: center;
    color: #fff;
}

.terms-header-content {
    max-width: 800px;
    margin: 0 auto;
}

.terms-header h1 {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
}

.terms-header p {
    font-size: 1.15rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: #fff;
}

.terms-header .terms-updated {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 1rem;
}

/* ========================================
   MOBILE DROPDOWN (hidden on desktop)
   ======================================== */
.mobile-section-nav {
    display: none;
}

/* ========================================
   TWO-COLUMN LAYOUT
   ======================================== */
.terms-container {
    display: flex;
    flex-direction: row;
    max-width: 1400px;
    margin: 0 auto;
    align-items: flex-start;
}

/* Left Sidebar - Sticky TOC */
aside.terms-sidebar {
    flex: 0 0 280px;
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    padding: 2rem 1.5rem;
    background: #f8fafc;
    border-right: 1px solid #e5e7eb;
    box-sizing: border-box;
}

/* Override global nav styles for sidebar nav */
.terms-sidebar .sidebar-nav {
    display: block;
    position: static;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
    top: auto;
    left: auto;
    right: auto;
    z-index: auto;
}

.terms-sidebar .sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.terms-sidebar .sidebar-nav li {
    margin-bottom: 4px;
}

.terms-sidebar .sidebar-link {
    display: block;
    padding: 0.6rem 0.875rem;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    line-height: 1.4;
}

.terms-sidebar .sidebar-link:hover {
    color: #004C97;
    background: rgba(0, 76, 151, 0.06);
}

.terms-sidebar .sidebar-link.active {
    color: #004C97;
    background: rgba(0, 76, 151, 0.1);
    border-left-color: #004C97;
    font-weight: 600;
}

/* Scrollbar styling */
aside.terms-sidebar::-webkit-scrollbar {
    width: 4px;
}
aside.terms-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

/* Right Content Panel */
.terms-content {
    flex: 1;
    min-width: 0;
    padding: 2.5rem 4rem 4rem 3rem;
    background: #fff;
    box-sizing: border-box;
}

/* ========================================
   CONTENT SECTIONS
   ======================================== */
.terms-section {
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    scroll-margin-top: 100px;
}

.terms-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #004C97;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #829CD0;
}

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

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

.terms-section ul {
    margin: 1rem 0 1.5rem 1.5rem;
    padding: 0;
}

.terms-section ul li {
    margin-bottom: 0.6rem;
    color: #4b5563;
    line-height: 1.7;
}

.terms-section ul li strong {
    color: #1f2937;
}

.terms-section a {
    color: #004C97;
    text-decoration: underline;
    text-underline-offset: 2px;
}

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

/* ========================================
   SPECIAL BOXES
   ======================================== */
.disclaimer-box {
    background: #f8fafc;
    border-left: 4px solid #004C97;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

.disclaimer-box p {
    margin: 0;
    font-size: 0.95rem;
    color: #374151;
}

.disclaimer-box.critical {
    background: #fef3c7;
    border-left-color: #f59e0b;
}

.disclaimer-box.critical h3 {
    color: #92400e;
    font-size: 1.05rem;
    margin: 0 0 0.75rem 0;
}

.disclaimer-box.critical p {
    color: #78350f;
}

.contact-info {
    background: #f0f7ff;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border: 1px solid #d4e5f7;
}

.contact-info p {
    margin-bottom: 0.5rem;
}

.contact-info p:last-child {
    margin-bottom: 0;
}

/* Back to top button */
.terms-footer-actions {
    text-align: center;
    padding: 2rem 0;
    margin-top: 1.5rem;
}

.back-to-top {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #004C97;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.back-to-top:hover {
    background: #003366;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 76, 151, 0.25);
}

/* ========================================
   RESPONSIVE - TABLET (1024px)
   ======================================== */
@media (max-width: 1024px) {
    .terms-page-wrapper {
        margin-top: 72px;
    }

    .terms-header {
        padding: 2.5rem 5%;
    }

    .terms-header h1 {
        font-size: 2.25rem;
    }

    aside.terms-sidebar {
        flex: 0 0 220px;
        width: 220px;
        min-width: 220px;
        max-width: 220px;
        top: 72px;
        max-height: calc(100vh - 72px);
        padding: 1.5rem 1rem;
    }

    .terms-sidebar .sidebar-link {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }

    .terms-content {
        padding: 2rem 3rem 3rem 2rem;
    }
}

/* ========================================
   RESPONSIVE - MOBILE (768px)
   ======================================== */
@media (max-width: 768px) {
    .terms-page-wrapper {
        margin-top: 68px;
    }

    .terms-header {
        padding: 2rem 4%;
    }

    .terms-header h1 {
        font-size: 1.875rem;
    }

    .terms-header p {
        font-size: 1rem;
    }

    /* Switch to single column */
    .terms-container {
        display: block;
    }

    /* Hide sidebar */
    aside.terms-sidebar {
        display: none;
    }

    /* Show mobile dropdown */
    .mobile-section-nav {
        display: block;
        position: sticky;
        top: 68px;
        z-index: 100;
        background: #fff;
        padding: 1rem 4%;
        border-bottom: 1px solid #e5e7eb;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    .mobile-section-nav select {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        font-weight: 500;
        color: #004C97;
        background: #f8fafc;
        border: 2px solid #004C97;
        border-radius: 8px;
        cursor: pointer;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23004C97' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6,9 12,15 18,9'%3E%3C/polyline%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 1rem center;
        padding-right: 2.5rem;
    }

    .mobile-section-nav select:focus {
        outline: none;
        border-color: #003366;
        box-shadow: 0 0 0 3px rgba(0, 76, 151, 0.15);
    }

    /* Full width content */
    .terms-content {
        padding: 1.5rem 5% 3rem;
    }

    .terms-section {
        scroll-margin-top: 140px;
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }

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

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

    .disclaimer-box {
        padding: 1rem;
    }
}

/* ========================================
   RESPONSIVE - SMALL MOBILE (480px)
   ======================================== */
@media (max-width: 480px) {
    .terms-page-wrapper {
        margin-top: 64px;
    }

    .terms-header {
        padding: 1.5rem 4%;
    }

    .terms-header h1 {
        font-size: 1.5rem;
    }

    .mobile-section-nav {
        top: 64px;
        padding: 0.75rem 4%;
    }

    .terms-content {
        padding: 1.25rem 4% 2rem;
    }

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

    .terms-section ul {
        margin-left: 1rem;
    }

    .contact-info {
        padding: 1rem;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .terms-sidebar,
    .mobile-section-nav,
    nav,
    footer,
    .back-to-top {
        display: none !important;
    }

    .terms-page-wrapper {
        margin-top: 0;
    }

    .terms-container {
        display: block;
    }

    .terms-content {
        padding: 0;
    }

    .terms-header {
        background: none;
        color: #000;
        padding: 1rem 0;
    }

    .terms-header h1 {
        color: #000;
    }
}
