/* ===================================
   Legal Pages Stylesheet
   Custom styles for Privacy & Terms pages
   ================================== */

/* Hero Section */
.legal-hero {
    background: var(--gradient-cta);
    padding: 140px 0 80px;
    position: relative;
    overflow: hidden;
}

.legal-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent);
    border-radius: 50%;
}

.legal-hero::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent);
    border-radius: 50%;
}

.legal-hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.legal-hero-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.legal-hero-icon svg {
    width: 48px;
    height: 48px;
    color: var(--white);
}

.legal-hero-title {
    font-size: 3rem;
    font-weight: var(--font-weight-extrabold);
    color: var(--white);
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.legal-hero-date {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: var(--font-weight-medium);
}

/* Main Layout */
.legal-main {
    padding: 80px 0;
    background: var(--light);
}

.legal-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Table of Contents Sidebar */
.legal-toc {
    position: sticky;
    top: 100px;
    align-self: start;
    background: var(--white);
    border-radius: var(--border-radius-large);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.legal-toc-title {
    font-size: 0.875rem;
    font-weight: var(--font-weight-bold);
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
}

.legal-toc-list {
    list-style: none;
}

.legal-toc-list li {
    margin-bottom: 0.75rem;
}

.legal-toc-list a {
    display: block;
    font-size: 0.9375rem;
    color: var(--gray-700);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: all var(--transition-base);
    border-left: 3px solid transparent;
}

.legal-toc-list a:hover {
    background: var(--light);
    color: var(--accent);
    border-left-color: var(--accent);
    transform: translateX(4px);
}

.legal-toc-list a.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    font-weight: var(--font-weight-semibold);
    border-left-color: var(--accent);
}

/* Content Area */
.legal-content {
    background: var(--white);
    border-radius: var(--border-radius-large);
    padding: 4rem;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.legal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-accent);
    border-radius: var(--border-radius-large) var(--border-radius-large) 0 0;
}

/* Typography */
.legal-content h2 {
    font-size: 2rem;
    color: var(--dark);
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
    padding-top: 2rem;
    border-top: 2px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 1rem;
    letter-spacing: -0.02em;
}

.legal-content h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.legal-content h2::before {
    content: '';
    width: 6px;
    height: 32px;
    background: var(--gradient-accent);
    border-radius: 3px;
    flex-shrink: 0;
}

.legal-content h3 {
    font-size: 1.375rem;
    color: var(--gray-800);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: var(--font-weight-semibold);
}

.legal-content p {
    color: var(--gray-700);
    line-height: 1.8;
    margin-bottom: 1.25rem;
    font-size: 1.0625rem;
}

.legal-content ul,
.legal-content ol {
    color: var(--gray-700);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.legal-content li {
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.legal-content ul li {
    position: relative;
}

.legal-content ul li::marker {
    color: var(--accent);
    font-weight: var(--font-weight-bold);
}

.legal-content a {
    color: var(--accent);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    transition: color var(--transition-base);
    border-bottom: 1px solid transparent;
}

.legal-content a:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Highlight Boxes */
.highlight-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08));
    border-left: 4px solid var(--accent);
    padding: 2rem;
    margin: 2rem 0;
    border-radius: var(--border-radius-base);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.highlight-box::before {
    content: '💡';
    position: absolute;
    top: -12px;
    left: 20px;
    font-size: 1.5rem;
    background: var(--white);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
}

.highlight-box p {
    margin-bottom: 0;
    color: var(--gray-800);
    font-weight: var(--font-weight-medium);
}

.highlight-box p strong {
    color: var(--dark);
    font-weight: var(--font-weight-bold);
}

.highlight-box ul {
    margin-top: 1rem;
    margin-bottom: 0;
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--white);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
    margin-bottom: 2rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all var(--transition-base);
    position: relative;
    z-index: 2;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(-4px);
}

/* Progress Bar */
.legal-progress {
    position: fixed;
    top: 80px;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gradient-accent);
    z-index: 1001;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* Responsive Design */
@media (max-width: 992px) {
    .legal-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .legal-toc {
        position: static;
        max-height: none;
    }

    .legal-hero-title {
        font-size: 2.5rem;
    }

    .legal-content {
        padding: 2.5rem;
    }

    .legal-content h2 {
        font-size: 1.75rem;
    }
}

@media (max-width: 768px) {
    .legal-hero {
        padding: 120px 0 60px;
    }

    .legal-hero-title {
        font-size: 2rem;
    }

    .legal-hero-date {
        font-size: 1rem;
    }

    .legal-main {
        padding: 60px 0;
    }

    .legal-content {
        padding: 2rem;
    }

    .legal-content h2 {
        font-size: 1.5rem;
        margin-top: 2.5rem;
        padding-top: 1.5rem;
    }

    .legal-content h2::before {
        width: 4px;
        height: 24px;
    }

    .legal-content h3 {
        font-size: 1.25rem;
    }

    .legal-toc {
        padding: 1.5rem;
    }

    .highlight-box {
        padding: 1.5rem;
    }
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Section Anchors (invisible but clickable) */
.legal-content h2[id],
.legal-content h3[id] {
    scroll-margin-top: 100px;
}

/* Print Styles */
@media print {
    .legal-hero,
    .legal-toc,
    .back-link,
    .navbar,
    .footer {
        display: none;
    }

    .legal-layout {
        grid-template-columns: 1fr;
    }

    .legal-content {
        box-shadow: none;
        padding: 0;
    }

    .legal-content::before {
        display: none;
    }
}
