/**
 * Legal Pages V3 - Ultra Dark Mode & Modern UI
 * 
 * Shared styles for Terms, Privacy, Contracts, FAQ, and Commission Structure.
 * Features:
 * - Glassmorphism headers
 * - Premium typography
 * - Sticky table of contents
 * - Elegant section spacing
 * - Ultra Dark Mode support
 */

/* ============================================
   Page Layout
   ============================================ */
.legal-page {
    background: var(--color-background, #ffffff);
    min-height: 100vh;
    padding-bottom: 4rem;
    transition: background-color 0.3s ease;
}

[data-theme="dark"] .legal-page {
    background: #0a0f1a;
}

.legal-page__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2rem);
}

/* ============================================
   Hero Section
   ============================================ */
.legal-hero {
    padding: clamp(3rem, 6vw, 5rem) 0 3rem;
    text-align: center;
    position: relative;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 3rem;
}

[data-theme="dark"] .legal-hero {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.legal-hero__title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: #1a1d20;
    margin: 0 0 1rem;
    line-height: 1.1;
}

[data-theme="dark"] .legal-hero__title {
    color: #f1f5f9;
}

.legal-hero__subtitle {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    color: #64748b;
    max-width: 700px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

[data-theme="dark"] .legal-hero__subtitle {
    color: rgba(255, 255, 255, 0.7);
}

.legal-hero__meta {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    font-size: 0.9rem;
    color: #64748b;
}

[data-theme="dark"] .legal-hero__meta {
    color: rgba(255, 255, 255, 0.5);
}

.legal-hero__version,
.legal-hero__date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 999px;
}

[data-theme="dark"] .legal-hero__version,
[data-theme="dark"] .legal-hero__date {
    background: rgba(255, 255, 255, 0.05);
}

/* ============================================
   Table of Contents
   ============================================ */
.legal-toc {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    margin-bottom: 4rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .legal-toc {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

.legal-toc__container {
    padding: 1.5rem;
}

.legal-toc__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1d20;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

[data-theme="dark"] .legal-toc__title {
    color: #f1f5f9;
}

.legal-toc__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.legal-toc__link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .legal-toc__link {
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.03);
}

.legal-toc__link:hover {
    background: rgba(212, 175, 55, 0.1);
    color: #d4af37;
}

.legal-toc__link i {
    font-size: 0.5rem;
    color: #d4af37;
    opacity: 0.5;
}

.legal-toc__link:hover i {
    opacity: 1;
}

/* ============================================
   Content Layout
   ============================================ */
.legal-content {
    display: grid;
    gap: 3rem;
    margin-bottom: 4rem;
}

.legal-content__container {
    max-width: 900px;
    margin: 0 auto;
}

/* ============================================
   Typography & Sections
   ============================================ */
.legal-section {
    margin-bottom: 4rem;
    scroll-margin-top: 100px;
}

.legal-section__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1d20;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

[data-theme="dark"] .legal-section__title {
    color: #f1f5f9;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.legal-section__number {
    color: #d4af37;
    font-family: 'Playfair Display', serif;
}

.legal-section__content {
    font-size: 1.05rem;
    color: #4b5563;
    line-height: 1.8;
}

[data-theme="dark"] .legal-section__content {
    color: #cbd5e1;
}

.legal-section__content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1d20;
    margin: 2rem 0 1rem;
}

[data-theme="dark"] .legal-section__content h3 {
    color: #f1f5f9;
}

.legal-section__content ul,
.legal-section__content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.legal-section__content li {
    margin-bottom: 0.5rem;
}

/* ============================================
   Special Boxes
   ============================================ */
.legal-highlight {
    background: rgba(12, 35, 64, 0.03);
    border-left: 4px solid #0c2340;
    padding: 1.5rem;
    border-radius: 0 12px 12px 0;
    margin: 2rem 0;
}

[data-theme="dark"] .legal-highlight {
    background: rgba(59, 130, 246, 0.08);
    border-left-color: #60a5fa;
}

.legal-highlight h3 {
    margin-top: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #0c2340;
}

[data-theme="dark"] .legal-highlight h3 {
    color: #60a5fa;
}

.legal-warning {
    background: rgba(212, 175, 55, 0.08);
    border-left: 4px solid #d4af37;
    padding: 1.5rem;
    border-radius: 0 12px 12px 0;
    margin: 2rem 0;
}

[data-theme="dark"] .legal-warning {
    background: rgba(212, 175, 55, 0.1);
}

.legal-warning h3 {
    margin-top: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #b49225;
}

[data-theme="dark"] .legal-warning h3 {
    color: #d4af37;
}

/* ============================================
   Tables
   ============================================ */
.legal-table-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .legal-table-wrapper {
    border-color: rgba(255, 255, 255, 0.08);
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.legal-table th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #1a1d20;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .legal-table th {
    background: rgba(30, 41, 59, 0.5);
    color: #f1f5f9;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.legal-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    color: #4b5563;
}

[data-theme="dark"] .legal-table td {
    border-bottom-color: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
}

.legal-table tr:last-child td {
    border-bottom: none;
}

/* ============================================
   Definitions List
   ============================================ */
.legal-definitions dt {
    font-weight: 700;
    color: #1a1d20;
    margin-top: 1.5rem;
}

[data-theme="dark"] .legal-definitions dt {
    color: #f1f5f9;
}

.legal-definitions dd {
    margin-left: 0;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .legal-definitions dd {
    border-left-color: rgba(255, 255, 255, 0.1);
}

/* ============================================
   Contact Section
   ============================================ */
.legal-contact {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    margin-top: 4rem;
}

[data-theme="dark"] .legal-contact {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.legal-contact__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1d20;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

[data-theme="dark"] .legal-contact__title {
    color: #f1f5f9;
}

.legal-contact__text {
    color: #64748b;
    margin: 0 0 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.legal-contact__methods {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.legal-contact__method {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    color: #1a1d20;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .legal-contact__method {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}

.legal-contact__method:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: #d4af37;
    color: #d4af37;
}

/* ============================================
   CTA Section
   ============================================ */
.legal-cta {
    margin-top: 4rem;
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #0c2340 0%, #1a3a5a 100%);
    border-radius: 24px;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .legal-cta {
    background: linear-gradient(135deg, #0a0f1a 0%, #111827 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.legal-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 80% 20%, rgba(212, 175, 55, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.legal-cta__content {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
}

.legal-cta__title {
    font-family: 'Playfair Display', serif;
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: #ffffff;
}

.legal-cta__text {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 2.5rem;
}

.legal-cta__button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #d4af37 0%, #e9d38b 100%);
    color: #0c2340;
    text-decoration: none;
    font-weight: 700;
    border-radius: 999px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.legal-cta__button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.5);
}

/* ============================================
   Address Block
   ============================================ */
.legal-address {
    font-style: normal;
    background: rgba(0, 0, 0, 0.02);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
}

[data-theme="dark"] .legal-address {
    background: rgba(255, 255, 255, 0.03);
}

.legal-address a {
    color: #d4af37;
    text-decoration: none;
}

.legal-address a:hover {
    text-decoration: underline;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .legal-toc {
        display: none; /* Hide TOC on mobile or move to bottom */
    }
    
    .legal-table-wrapper {
        margin: 1.5rem -1rem;
        padding: 0 1rem;
        border: none;
    }
}
