/* ========================================================================
   TNAADO Terms of Service Page Styles
   100% Standalone - No External Dependencies
   ======================================================================== */

/* ===== BASE RESET ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1a1a1a;
    background-color: #f8fafc;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ===== CSS VARIABLES ===== */
:root {
    --primary-red: #A01D26;
    --primary-red-dark: #8b1920;
    --dark-text: #1a1a1a;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --sidebar-bg: #f7f8f8;
    --sidebar-border: #e7e7e7;
    --sidebar-hover: #eaeded;
    --sidebar-active: #fff3cd;
    --header-height: 100px;
}

/* ===== MAIN LAYOUT ===== */
.terms-page-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding-top: var(--header-height);
}

/* ===== LEFT SIDEBAR NAVIGATION ===== */
.terms-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    position: fixed;
    top: var(--header-height);
    left: 0;
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 0;
    z-index: 50;
    flex-shrink: 0;
}

.terms-sidebar-header {
    padding: 15px 20px 25px;
    border-bottom: 1px solid var(--sidebar-border);
    margin-bottom: 10px;
}

.terms-sidebar-header h2 {
    font-size: 1.3rem;
    color: var(--primary-red);
    margin: 0 0 8px 0;
    font-weight: 700;
}

.terms-sidebar-header p {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

/* ===== DOCUMENT SELECTOR ===== */
.terms-doc-selector {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--sidebar-border);
}

.terms-doc-selector label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.terms-doc-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--sidebar-border);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--white);
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.terms-doc-select:focus {
    border-color: var(--primary-red);
}

/* ===== MOBILE TOGGLE ===== */
.terms-mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: var(--sidebar-hover);
    cursor: pointer;
    font-weight: 500;
    color: var(--primary-red);
    gap: 8px;
    margin: 10px 0;
}

.terms-mobile-toggle:hover {
    background: var(--sidebar-border);
}

/* ===== SIDEBAR NAVIGATION ===== */
.terms-nav {
    padding: 10px 0;
}

.terms-nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    color: #444;
    font-size: 0.9rem;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    text-decoration: none;
    gap: 10px;
}

.terms-nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--primary-red);
}

.terms-nav-item.active {
    background: var(--sidebar-active);
    color: var(--primary-red);
    border-left-color: var(--primary-red);
    font-weight: 600;
}

.terms-nav-item i {
    width: 16px;
    text-align: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ===== QUICK LINKS ===== */
.terms-quick-links {
    padding: 20px;
    border-top: 1px solid var(--sidebar-border);
    margin-top: 10px;
}

.terms-quick-links h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #666;
    margin: 0 0 12px 0;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.terms-quick-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    color: var(--primary-red);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.15s;
}

.terms-quick-link:hover {
    color: var(--primary-red-dark);
    text-decoration: underline;
}

.terms-quick-link i {
    font-size: 0.85rem;
    width: 18px;
    flex-shrink: 0;
}

/* ===== MAIN CONTENT AREA ===== */
.terms-content {
    flex: 1;
    margin-left: 280px;
    padding: 30px 40px 60px;
    max-width: 100%;
    min-width: 0;
    width: calc(100% - 280px);
}

.terms-content-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--primary-red);
}

.terms-content-header h1 {
    font-size: 2rem;
    color: var(--primary-red);
    font-weight: 700;
    margin: 0 0 8px 0;
}

.terms-content-header .last-updated {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    margin: 0;
}

/* ===== BRAND NOTICE ===== */
.terms-brand-notice {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #0284c7;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.terms-brand-notice h3 {
    color: #0369a1;
    font-size: 1rem;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.terms-brand-notice p {
    color: #0c4a6e;
    font-size: 0.9rem;
    margin: 0 0 10px 0;
}

.terms-brand-notice ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.terms-brand-notice li {
    background: white;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #0369a1;
}

/* ===== TERMS SECTIONS ===== */
.terms-section {
    margin-bottom: 40px;
}

.terms-section-title {
    font-size: 1.4rem;
    color: var(--primary-red);
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.terms-section-title i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.terms-subsection {
    margin-bottom: 25px;
}

.terms-subsection h3 {
    font-size: 1.1rem;
    color: var(--dark-text);
    margin: 0 0 12px 0;
    padding-bottom: 5px;
    border-bottom: 1px dashed #e0e0e0;
}

.terms-subsection h4 {
    font-size: 0.95rem;
    color: var(--dark-text);
    margin: 15px 0 10px 0;
    font-weight: 600;
}

.terms-section p {
    margin: 0 0 15px 0;
    color: #444;
    font-size: 0.95rem;
    line-height: 1.7;
}

.terms-section ul,
.terms-section ol {
    margin: 15px 0 15px 25px;
    padding: 0;
}

.terms-section li {
    margin-bottom: 10px;
    color: #444;
    font-size: 0.95rem;
    line-height: 1.6;
}

.terms-section li strong {
    color: var(--dark-text);
}

.terms-section a {
    color: var(--primary-red);
    text-decoration: none;
}

.terms-section a:hover {
    text-decoration: underline;
}

/* ===== HIGHLIGHT BOXES ===== */
.terms-highlight {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
}

.terms-highlight.important {
    background: #fee2e2;
    border-left-color: var(--primary-red);
}

.terms-highlight h4 {
    color: #92400e;
    font-size: 0.9rem;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.terms-highlight.important h4 {
    color: var(--primary-red);
}

.terms-highlight p {
    color: #78350f;
    font-size: 0.95rem;
    margin: 0;
}

.terms-highlight.important p {
    color: #7f1d1d;
}

/* ===== CONTACT BOX ===== */
.terms-contact-box {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
    color: white;
    padding: 35px;
    border-radius: 12px;
    text-align: center;
    margin-top: 40px;
    box-shadow: 0 4px 12px rgba(160, 29, 38, 0.3);
}

.terms-contact-box h2 {
    margin: 0 0 12px 0;
    font-size: 1.5rem;
}

.terms-contact-box p {
    margin: 0 0 20px 0;
    font-size: 1rem;
    opacity: 0.95;
}

.terms-contact-button {
    display: inline-block;
    background: white;
    color: var(--primary-red);
    padding: 14px 35px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s;
}

.terms-contact-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

/* ===== BACK TO TOP BUTTON ===== */
.terms-toc-jump {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-red);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 100;
    transition: transform 0.2s, background-color 0.2s;
}

.terms-toc-jump:hover {
    transform: scale(1.1);
    background: var(--primary-red-dark);
}

.terms-toc-jump.visible {
    display: flex;
}

.terms-toc-jump i {
    font-size: 1.2rem;
}

/* ===== SCROLLBAR STYLING ===== */
.terms-sidebar::-webkit-scrollbar {
    width: 6px;
}

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

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

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

/* ===== PRINT STYLES ===== */
@media print {
    .terms-sidebar,
    .terms-toc-jump {
        display: none !important;
    }

    .terms-content {
        max-width: 100%;
        margin-left: 0;
        width: 100%;
        padding: 0;
    }

    .terms-page-wrapper {
        display: block;
        padding-top: 0;
    }

    body {
        background: white;
    }
}

/* ===== TABLET RESPONSIVE (768px - 992px) ===== */
@media (max-width: 992px) {
    :root {
        --header-height: 80px;
    }

    .terms-page-wrapper {
        flex-direction: column;
        padding-top: var(--header-height);
    }

    .terms-sidebar {
        width: 100%;
        min-width: 100%;
        position: relative;
        top: 0;
        left: 0;
        height: auto;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--sidebar-border);
        padding: 10px 0;
        z-index: 10;
    }

    .terms-mobile-toggle {
        display: flex;
    }

    .terms-nav {
        display: none;
        max-height: 400px;
        overflow-y: auto;
    }

    .terms-sidebar.mobile-expanded .terms-nav {
        display: block;
    }

    .terms-quick-links {
        display: none;
    }

    .terms-content {
        margin-left: 0;
        width: 100%;
        padding: 25px 20px 40px;
    }

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

    .terms-section-title {
        font-size: 1.3rem;
    }

    .terms-toc-jump {
        bottom: 20px;
        right: 20px;
        width: 46px;
        height: 46px;
    }
}

/* ===== MOBILE RESPONSIVE (< 768px) ===== */
@media (max-width: 767px) {
    .terms-content {
        padding: 20px 15px 30px;
    }

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

    .terms-section-title {
        font-size: 1.2rem;
    }

    .terms-contact-box {
        padding: 25px 20px;
    }

    .terms-contact-box h2 {
        font-size: 1.3rem;
    }

    .terms-brand-notice ul {
        flex-direction: column;
    }

    .terms-brand-notice li {
        width: 100%;
        text-align: center;
    }

    .terms-toc-jump {
        bottom: 15px;
        right: 15px;
        width: 44px;
        height: 44px;
    }

    .terms-subsection h3 {
        font-size: 1rem;
    }

    .terms-section p,
    .terms-section li {
        font-size: 0.9rem;
    }
}

/* ===== SMALL MOBILE (< 480px) ===== */
@media (max-width: 480px) {
    .terms-sidebar-header h2 {
        font-size: 1.1rem;
    }

    .terms-nav-item {
        font-size: 0.85rem;
        padding: 10px 15px;
    }

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

    .terms-section-title {
        font-size: 1.1rem;
    }

    .terms-contact-box h2 {
        font-size: 1.2rem;
    }

    .terms-contact-button {
        width: 100%;
        padding: 12px 20px;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ===== FOCUS STYLES FOR KEYBOARD NAVIGATION ===== */
.terms-nav-item:focus,
.terms-quick-link:focus,
.terms-doc-select:focus,
.terms-contact-button:focus,
.terms-toc-jump:focus {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    .terms-sidebar {
        border-right-width: 2px;
    }

    .terms-nav-item.active {
        border-left-width: 5px;
    }

    .terms-content-header {
        border-bottom-width: 3px;
    }
}
