/**
 * Terms of Service Page - Stripe-inspired styling
 * Clean, modern design with sticky sidebar navigation
 * Matches privacy.css styling for consistency
 */

/* Override base template container */
main.container-fluid:has(.terms-container) {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}

/* Container Layout */
.terms-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

.terms-layout {
    display: flex;
    gap: 4rem;
    padding-top: 3rem;
    padding-bottom: 5rem;
    width: 100%;
}

/* Sidebar Navigation */
.terms-sidebar {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 2rem;
    align-self: flex-start;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    display: block;
    visibility: visible;
}

.terms-sidebar-inner {
    padding-right: 1rem;
}

/* Hide scrollbar but keep functionality */
.terms-sidebar::-webkit-scrollbar {
    width: 4px;
}

.terms-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.terms-sidebar::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 2px;
}

.terms-sidebar::-webkit-scrollbar-thumb:hover {
    background: #c0c0c0;
}

/* Sidebar Navigation List */
.terms-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.terms-nav li {
    margin-bottom: 0.25rem;
}

.terms-nav a {
    display: block;
    padding: 0.5rem 0;
    padding-left: 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #6b7280;
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: all 0.15s ease;
}

.terms-nav a:hover {
    color: #111827;
    border-left-color: #e0e0e0;
}

.terms-nav a.active {
    color: #635bff;
    border-left-color: #635bff;
    font-weight: 500;
}

/* Main Content */
.terms-content {
    flex: 1;
    min-width: 0;
    max-width: 720px;
    display: block;
    visibility: visible;
}

/* Header */
.terms-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.terms-header h1 {
    font-size: 3rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #0a2540;
    letter-spacing: -0.025em;
}

.terms-last-updated {
    font-size: 0.9375rem;
    color: #6b7280;
    margin: 0;
}

/* Content Sections */
.terms-section {
    margin-bottom: 3rem;
    scroll-margin-top: 2rem;
}

.terms-section h2 {
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.3;
    color: #0a2540;
    margin-bottom: 1.5rem;
    margin-top: 0;
    letter-spacing: -0.02em;
}

.terms-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    color: #0a2540;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

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

.terms-section p.lead {
    font-size: 1.125rem;
    line-height: 1.75;
    color: #425466;
    margin-bottom: 1.5rem;
}

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

.terms-section li {
    margin-bottom: 0.75rem;
    line-height: 1.75;
}

.terms-section li strong {
    color: #0a2540;
    font-weight: 600;
}

/* Alert Boxes */
.terms-section .alert {
    border-radius: 8px;
    border: 1px solid;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.terms-section .alert-info {
    background-color: #f0f9ff;
    border-color: #bae6fd;
    color: #075985;
}

.terms-section .alert-warning {
    background-color: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.terms-section .alert-danger {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.terms-section .alert p:last-child,
.terms-section .alert ul:last-child {
    margin-bottom: 0;
}

/* Cards */
.terms-section .card {
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background-color: #f9fafb;
    transition: all 0.2s ease;
}

.terms-section .card:hover {
    border-color: #d1d5db;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.terms-section .card-body {
    padding: 1.25rem;
}

.terms-section .card-body p {
    margin-bottom: 0.5rem;
}

.terms-section .card-body p:last-child {
    margin-bottom: 0;
}

/* Links */
.terms-section a {
    color: #635bff;
    text-decoration: none;
    transition: color 0.15s ease;
}

.terms-section a:hover {
    color: #0a2540;
    text-decoration: underline;
}

/* Footer Navigation */
.terms-footer-nav {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terms-footer-nav .btn {
    font-size: 0.9375rem;
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.terms-footer-nav .btn-outline-secondary {
    color: #6b7280;
    border-color: #d1d5db;
}

.terms-footer-nav .btn-outline-secondary:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

.terms-footer-nav .btn-link {
    color: #635bff;
}

.terms-footer-nav .btn-link:hover {
    color: #0a2540;
}

/* Responsive Design */
@media (max-width: 992px) {
    .terms-layout {
        flex-direction: column;
        gap: 2rem;
    }

    .terms-sidebar {
        width: 100%;
        position: relative;
        top: 0;
        max-height: none;
        overflow-y: visible;
    }

    .terms-sidebar-inner {
        padding-right: 0;
    }

    /* Mobile navigation - collapsible */
    .terms-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .terms-nav li {
        margin-bottom: 0;
    }

    .terms-nav a {
        padding: 0.5rem 1rem;
        border-left: none;
        border-radius: 6px;
        background-color: #f9fafb;
        border: 1px solid #e5e7eb;
    }

    .terms-nav a:hover {
        background-color: #f3f4f6;
        border-color: #d1d5db;
    }

    .terms-nav a.active {
        background-color: #ede9fe;
        border-color: #c4b5fd;
        color: #635bff;
    }

    .terms-content {
        max-width: 100%;
    }

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

@media (max-width: 768px) {
    .terms-layout {
        padding-top: 2rem;
        padding-bottom: 3rem;
    }

    .terms-header {
        margin-bottom: 2rem;
    }

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

    .terms-section {
        margin-bottom: 2rem;
    }

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

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

    .terms-footer-nav {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .terms-footer-nav .btn {
        width: 100%;
        text-align: center;
    }
}

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

/* Improved readability */
.terms-content {
    font-feature-settings: "kern" 1, "liga" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Print styles */
@media print {
    .terms-sidebar {
        display: none;
    }

    .terms-content {
        max-width: 100%;
    }

    .terms-footer-nav {
        display: none;
    }
}
