/* CSS Custom Properties - Matching Landing Page Theme */
:root {
    --bg-light: #FAFAF5;
    --accent-beige: #F4EDDD;
    --text-dark: #26262B;
    --font-family: Georgia, 'Times New Roman', serif;
    --transition-speed: 0.3s;
    --sidebar-width: 280px;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header */
.header {
    background-color: var(--bg-light);
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(38, 38, 43, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: opacity var(--transition-speed);
}

.header-logo:hover {
    opacity: 0.7;
}

.logo-img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.back-link {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 1rem;
    transition: all var(--transition-speed);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
}

.back-link:hover {
    background-color: var(--accent-beige);
    border-color: rgba(38, 38, 43, 0.1);
}

/* Main Legal Container */
.legal-container {
    min-height: calc(100vh - 200px);
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.legal-main-title {
    font-size: clamp(2rem, 5vw, 3rem);
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-dark);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    width: 60px;
    height: 60px;
    background: var(--text-dark);
    border: none;
    border-radius: 50%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-speed);
}

.mobile-menu-toggle span {
    width: 24px;
    height: 3px;
    background-color: var(--bg-light);
    transition: all var(--transition-speed);
}

.mobile-menu-toggle:hover {
    transform: scale(1.1);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Legal Wrapper - Flex Container */
.legal-wrapper {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* Vertical Sidebar (Left) */
.tabs-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: 120px;
}

.tabs-nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background-color: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.tab-button {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 500;
    color: rgba(38, 38, 43, 0.7);
    cursor: pointer;
    transition: all var(--transition-speed);
    text-align: left;
    position: relative;
}

.tab-button:hover {
    background-color: var(--accent-beige);
    color: var(--text-dark);
    transform: translateX(4px);
}

.tab-button.active {
    background-color: var(--accent-beige);
    color: var(--text-dark);
    border-left-color: var(--text-dark);
    font-weight: 600;
}

.tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-light);
    border-radius: 8px;
    flex-shrink: 0;
    transition: all var(--transition-speed);
}

.tab-button.active .tab-icon {
    background: var(--text-dark);
    color: var(--bg-light);
}

.tab-button:hover .tab-icon {
    transform: scale(1.1);
}

.tab-text {
    flex: 1;
}

/* Tab Content Area (Right) */
.tabs-content {
    flex: 1;
    min-width: 0;
}

.tab-content {
    display: none;
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    animation: fadeInContent 0.4s ease-in-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Content Loader */
.content-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: rgba(38, 38, 43, 0.5);
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--accent-beige);
    border-top-color: var(--text-dark);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Legal Content Styling */
.legal-content {
    max-width: 100%;
}

.legal-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.legal-updated {
    font-size: 0.95rem;
    color: rgba(38, 38, 43, 0.6);
    font-style: italic;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--accent-beige);
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    margin-top: 2.5rem;
    color: var(--text-dark);
    font-weight: 600;
}

.section-intro {
    font-size: 1.125rem;
    line-height: 1.8;
    color: rgba(38, 38, 43, 0.85);
    margin-bottom: 1.5rem;
}

.section-body {
    font-size: 1rem;
    line-height: 1.8;
    color: rgba(38, 38, 43, 0.8);
    margin-bottom: 1rem;
}

.section-list {
    list-style: none;
    padding-left: 0;
    margin: 1rem 0 1.5rem 0;
}

.section-list li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(38, 38, 43, 0.8);
}

.section-list li::before {
    content: "•";
    position: absolute;
    left: 0.75rem;
    color: var(--text-dark);
    font-weight: bold;
    font-size: 1.2rem;
}

.contact-info {
    background-color: var(--accent-beige);
    padding: 1.75rem;
    border-radius: 12px;
    margin-top: 2.5rem;
    border-left: 4px solid var(--text-dark);
}

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

.contact-info a {
    color: var(--text-dark);
    font-weight: 600;
    text-decoration: underline;
    transition: opacity var(--transition-speed);
}

.contact-info a:hover {
    opacity: 0.7;
}

/* Error Message Styling */
.error-message {
    text-align: center;
    padding: 3rem;
    color: rgba(38, 38, 43, 0.6);
}

.error-message h2 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.error-message button {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--text-dark);
    color: var(--bg-light);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 1rem;
    transition: all var(--transition-speed);
}

.error-message button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Footer */
.footer {
    background-color: var(--text-dark);
    color: var(--bg-light);
    padding: 3rem 2rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-logo .logo-text {
    color: var(--bg-light);
}

.footer-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.footer-links a {
    color: var(--bg-light);
    text-decoration: none;
    transition: opacity var(--transition-speed);
}

.footer-links a:hover {
    opacity: 0.7;
}

.separator {
    opacity: 0.5;
}

/* Tablet Responsive Design */
@media (max-width: 1024px) {
    .tabs-sidebar {
        width: 240px;
    }

    .tab-button {
        font-size: 0.95rem;
        padding: 0.875rem 1rem;
    }

    .tab-content {
        padding: 2.5rem;
    }
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .header-container {
        padding: 0 1.5rem;
    }

    .back-link {
        font-size: 0.9rem;
        padding: 0.4rem 0.75rem;
    }

    .legal-container {
        padding: 2rem 1.5rem;
    }

    .legal-main-title {
        margin-bottom: 2rem;
    }

    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Stack layout vertically */
    .legal-wrapper {
        flex-direction: column;
    }

    /* Sidebar becomes slide-out menu */
    .tabs-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: white;
        z-index: 999;
        transition: left var(--transition-speed);
        padding: 2rem;
        overflow-y: auto;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    }

    .tabs-sidebar.active {
        left: 0;
    }

    .tabs-nav {
        padding: 0;
        box-shadow: none;
    }

    .tab-button {
        padding: 1rem;
    }

    .tabs-content {
        width: 100%;
    }

    .tab-content {
        padding: 2rem 1.5rem;
    }

    .footer-container {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 1.25rem;
    }

    .tab-content {
        padding: 1.5rem 1rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .section-list li {
        padding-left: 1.5rem;
    }

    .section-list li::before {
        left: 0.5rem;
    }

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

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

/* Focus Styles */
a:focus,
button:focus {
    outline: 2px solid var(--text-dark);
    outline-offset: 4px;
}

/* Print Styles */
@media print {
    .header,
    .tabs-sidebar,
    .mobile-menu-toggle,
    .footer {
        display: none;
    }

    .tab-content {
        display: block !important;
        page-break-inside: avoid;
    }

    body {
        background: white;
    }
}
