/* Legal Pages Specific Styles */

.legal-page {
    padding: 40px 0 80px;
    background: var(--light-bg);
}

.legal-header {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    margin-bottom: 3rem;
    text-align: center;
}

.legal-header h1 {
    font-size: 3rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.last-updated {
    font-size: 1rem;
    color: var(--text-light);
    font-style: italic;
}

.legal-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 60px;
    align-items: start;
}

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

.legal-toc h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    border-bottom: 2px solid var(--light-bg);
    padding-bottom: 0.5rem;
}

.legal-toc ul {
    list-style: none;
    padding: 0;
}

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

.legal-toc a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.4;
    padding: 8px 12px;
    border-radius: 6px;
    display: block;
    transition: all 0.3s ease;
}

.legal-toc a:hover {
    background: var(--light-bg);
    color: var(--primary-color);
    transform: translateX(5px);
}

/* Legal Body Content */
.legal-body {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    line-height: 1.7;
}

.legal-body section {
    margin-bottom: 3rem;
    scroll-margin-top: 140px;
}

.legal-body section:last-child {
    margin-bottom: 0;
}

.legal-body h2 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 2rem;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.legal-body h3 {
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.legal-body h4 {
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.legal-body p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.legal-body ul,
.legal-body ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.legal-body li {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.legal-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Contact Box */
.contact-box {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    margin: 2rem 0;
}

.contact-box p {
    margin-bottom: 1rem;
}

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

/* Legal Tables */
.legal-table,
.cookies-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.legal-table th,
.legal-table td,
.cookies-table th,
.cookies-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.legal-table th,
.cookies-table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

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

.legal-table tr:nth-child(even),
.cookies-table tr:nth-child(even) {
    background: var(--light-bg);
}

/* Special Tables */
.regulations-table,
.tax-table,
.exclusion-table,
.budget-table,
.bonus-frequency,
.bankroll-table,
.security-checklist {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    font-size: 0.9rem;
}

.regulations-table th,
.tax-table th,
.exclusion-table th,
.budget-table th,
.bonus-frequency th,
.bankroll-table th,
.security-checklist th,
.regulations-table td,
.tax-table td,
.exclusion-table td,
.budget-table td,
.bonus-frequency td,
.bankroll-table td,
.security-checklist td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.regulations-table th,
.tax-table th,
.exclusion-table th,
.budget-table th,
.bonus-frequency th,
.bankroll-table th,
.security-checklist th {
    background: var(--secondary-color);
    color: white;
    font-weight: 600;
}

/* Game Stats Table (for articles) */
.games-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.games-table th,
.games-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.games-table th {
    background: var(--accent-color);
    color: white;
    font-weight: 600;
}

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

.games-table tr:nth-child(even) {
    background: var(--light-bg);
}

/* Definition Lists */
.definitions {
    margin: 2rem 0;
}

.definitions dt {
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.definitions dt:first-child {
    margin-top: 0;
}

.definitions dd {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Cookie Settings Button */
.cookie-settings-button {
    text-align: center;
    margin: 2rem 0;
}

/* Timeline for Legal Pages */
.timeline {
    position: relative;
    margin: 2rem 0;
    padding-left: 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 80px;
    background: white;
    padding: 1.5rem 1.5rem 1.5rem 80px;
    border-radius: 8px;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
}

.timeline-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -48px;
    top: 24px;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 0 0 3px var(--primary-color);
}

.timeline-date {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 1rem;
}

.timeline-content h4 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.timeline-content p {
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* Active Link Highlighting */
.legal-toc a.active {
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

/* Warning and Info Boxes */
.warning-box,
.info-box {
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 8px;
    border-left: 4px solid;
}

.warning-box {
    background: #fff3e0;
    border-color: var(--secondary-color);
}

.warning-box h4 {
    color: var(--secondary-dark);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-box {
    background: #e3f2fd;
    border-color: var(--primary-color);
}

.info-box h4 {
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.warning-box ul,
.info-box ul {
    margin-bottom: 0;
    padding-left: 1.5rem;
}

.warning-box li,
.info-box li {
    margin-bottom: 0.5rem;
}

/* Responsive Design for Legal Pages */
@media (max-width: 1024px) {
    .legal-content {
        grid-template-columns: 250px 1fr;
        gap: 40px;
    }

    .legal-toc {
        padding: 1.5rem;
    }

    .legal-body {
        padding: 2.5rem;
    }
}

@media (max-width: 768px) {
    .legal-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .legal-toc {
        position: static;
        max-height: none;
        order: 2;
        margin-top: 2rem;
    }

    .legal-body {
        order: 1;
        padding: 2rem;
    }

    .legal-header {
        padding: 2rem;
    }

    .legal-header h1 {
        font-size: 2rem;
    }

    .legal-body h2 {
        font-size: 1.5rem;
    }

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

    .timeline {
        margin-left: -20px;
    }

    .timeline::before {
        left: 15px;
    }

    .timeline-item {
        padding: 1rem 1rem 1rem 60px;
    }

    .timeline-item::before {
        left: -33px;
        width: 20px;
        height: 20px;
        top: 16px;
    }

    .legal-table,
    .cookies-table,
    .regulations-table,
    .tax-table,
    .exclusion-table,
    .budget-table,
    .bonus-frequency,
    .bankroll-table,
    .security-checklist,
    .games-table {
        font-size: 0.8rem;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .legal-table th,
    .legal-table td,
    .cookies-table th,
    .cookies-table td {
        padding: 12px 8px;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .legal-header {
        padding: 1.5rem;
    }

    .legal-header h1 {
        font-size: 1.75rem;
    }

    .legal-body {
        padding: 1.5rem;
    }

    .legal-toc {
        padding: 1rem;
    }

    .contact-box {
        padding: 1.5rem;
    }

    .warning-box,
    .info-box {
        padding: 1rem;
        margin: 1.5rem 0;
    }

    .timeline-item {
        padding: 1rem 1rem 1rem 50px;
    }

    .timeline-item::before {
        left: -28px;
        width: 16px;
        height: 16px;
    }

    .timeline::before {
        left: 10px;
        width: 2px;
    }

    .definitions dt {
        font-size: 1rem;
    }

    .definitions dd {
        margin-left: 1rem;
    }
}

/* Print Styles for Legal Pages */
@media print {
    .legal-page {
        background: white;
        padding: 0;
    }

    .legal-content {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .legal-toc {
        display: none;
    }

    .legal-header,
    .legal-body {
        box-shadow: none;
        padding: 1rem 0;
    }

    .legal-body section {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .legal-body h2 {
        page-break-after: avoid;
    }

    .timeline-item {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .contact-box {
        border: 1px solid #ddd;
    }

    a {
        color: black;
        text-decoration: underline;
    }
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility */
.legal-toc a:focus,
.legal-body a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .legal-body {
        border: 2px solid var(--text-primary);
    }

    .legal-toc {
        border: 2px solid var(--text-primary);
    }

    .contact-box {
        border: 2px solid var(--primary-color);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .timeline-item {
        transition: none;
    }

    .legal-toc a {
        transition: none;
    }

    html {
        scroll-behavior: auto;
    }
}
