/* =========================================================================
   LEGAL PAGES STYLES
   ========================================================================= */

/* ========== Base Legal Page Styles ========== */
.legal-page {
    background: radial-gradient(ellipse at bottom, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 50%, var(--bg-gradient-end) 100%);
    background-size: 200% 200%;
    animation: background-pan 25s linear infinite;
    min-height: 100vh;
}

/* Ensure navbar works properly on legal pages */
.legal-page .site-header {
    position: sticky;
    top: 20px;
    z-index: 100;
    width: 100%;
}

.legal-content {
    padding: 30px 0;
    position: relative;
    z-index: 1;
    /* Ensure content doesn't interfere with navbar */
}

.legal-content .container {
    margin: 0 auto;
}

/* ========== Legal Header ========== */
.legal-header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--card-border);
    /* Remove opacity: 0 to ensure content is always visible */
    animation: fade-in-up 0.8s ease forwards;
}

.legal-header h1 {
    font-family: var(--special-heading-font);
    font-size: 48px;
    color: var(--title-color);
    margin-bottom: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.legal-header .last-updated {
    font-size: 16px;
    color: var(--paragraph-color);
    font-style: italic;
    margin: 0;
}

/* ========== Legal Body Content ========== */
.legal-body {
    color: var(--paragraph-color);
    line-height: 1.7;
    font-size: 16px;
    /* Remove opacity: 0 to ensure content is always visible */
    animation: fade-in-up 0.8s ease forwards;
    animation-delay: 0.3s;
}

.legal-section {
    margin-bottom: 40px;
    padding: 30px;
    background: var(--card-bg);
    border-radius: var(--radius-card, 6px);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.legal-section:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow);
}

/* ========== Headings ========== */
.legal-section h2 {
    font-family: var(--special-heading-font);
    font-size: 28px;
    color: var(--title-color);
    margin-bottom: 20px;
    margin-top: 0;
    font-weight: 600;
    position: relative;
}

.legal-section h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
}

.legal-section h3 {
    font-size: 20px;
    color: var(--title-color);
    margin: 25px 0 15px 0;
    font-weight: 600;
}

/* ========== Text Content ========== */
.legal-section p {
    margin-bottom: 15px;
    color: var(--paragraph-color);
}

.legal-section ul {
    margin: 15px 0;
    padding-left: 25px;
}

.legal-section li {
    margin-bottom: 8px;
    color: var(--paragraph-color);
    position: relative;
}

.legal-section li::marker {
    color: var(--accent-color);
}

.legal-section li strong {
    color: var(--title-color);
    font-weight: 600;
}

/* ========== Links ========== */
.legal-section a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.legal-section a:hover {
    border-bottom-color: var(--accent-color);
    opacity: 0.8;
}

/* ========== Contact Info Box ========== */
.contact-info {
    background: var(--bg-gradient-start);
    padding: 20px;
    border-radius: var(--radius-sm, 4px);
    border-left: 4px solid var(--accent-color);
    margin: 20px 0;
}

.contact-info p {
    margin-bottom: 8px;
    font-weight: 500;
}

.contact-info p:last-child {
    margin-bottom: 0;
}

.contact-info strong {
    color: var(--title-color);
}

/* ========== Animation Classes ========== */
.legal-content [data-animation="fade-in-up"] {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.legal-content [data-animation="fade-in-up"].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .legal-content {
        padding: 40px 0;
    }

    .legal-content .container {
        padding: 0 15px;
    }

    .legal-header h1 {
        font-size: 36px;
    }

    .legal-header {
        margin-bottom: 30px;
        padding-bottom: 20px;
    }

    .legal-section {
        padding: 20px;
        margin-bottom: 25px;
    }

    .legal-section h2 {
        font-size: 24px;
    }

    .legal-section h3 {
        font-size: 18px;
    }

    .legal-body {
        font-size: 15px;
    }

    .legal-section ul {
        padding-left: 20px;
    }
}

@media (max-width: 480px) {
    .legal-header h1 {
        font-size: 28px;
    }

    .legal-section {
        padding: 15px;
    }

    .legal-section h2 {
        font-size: 22px;
    }

    .legal-section h3 {
        font-size: 16px;
    }

    .legal-body {
        font-size: 14px;
        line-height: 1.6;
    }
}

@media (max-width: 360px) {
    .legal-header h1 {
        font-size: 22px !important;
    }

    .legal-section {
        padding: 12px 10px;
    }

    .legal-section h2 {
        font-size: 18px !important;
    }

    .legal-section h3 {
        font-size: 15px !important;
    }

    .legal-body {
        font-size: 13px;
    }

    .contact-info {
        padding: 12px 10px;
        font-size: 13px;
        word-break: break-all;
    }
}

/* ========== Dark Theme Adjustments ========== */
[data-theme="dark"] .legal-section {
    background: var(--card-bg);
    border-color: var(--card-border);
}

[data-theme="dark"] .contact-info {
    background: var(--bg-gradient-end);
}

/* ========== Print Styles ========== */
@media print {
    .legal-page {
        background: white;
        color: black;
    }

    .legal-section {
        background: white;
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }

    .legal-header h1 {
        color: black;
    }

    .legal-section h2,
    .legal-section h3 {
        color: black;
    }

    .legal-section a {
        color: #0066cc;
        text-decoration: underline;
    }
}

/* =========================================================================
   ANIMATIONS (base styles in animations.css)
   ========================================================================= */

/* Legal-specific animation overrides */
.legal-section {
    /* Remove opacity: 0 to ensure content is always visible */
    transition: all 0.6s ease;
    /* Add subtle animation on scroll if JavaScript adds .is-visible class */
}

.legal-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}