/* ===================================
   Legal Pages Styles (Privacy, Terms, Cookies)
   =================================== */

/* Legal Content Layout */
.legal-content {
    padding: var(--space-2xl) 0;
}

.legal-content .container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: var(--space-2xl);
    max-width: 1200px;
}

/* Legal Navigation (Table of Contents) */
.legal-nav {
    position: sticky;
    top: calc(var(--header-height, 70px) + var(--space-md));
    height: fit-content;
    background: var(--bg-secondary);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-color);
}

.legal-nav h3 {
    margin-bottom: var(--space-md);
    font-size: 1.125rem;
    color: var(--text-primary);
}

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

.legal-nav ul li {
    margin-bottom: var(--space-sm);
}

.legal-nav ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color var(--transition-base);
    display: block;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
}

.legal-nav ul li a:hover {
    color: var(--primary-color);
    background: rgba(107, 70, 193, 0.1);
}

/* Legal Text Content */
.legal-text {
    background: white;
    padding: var(--space-2xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.legal-text section {
    margin-bottom: var(--space-2xl);
    scroll-margin-top: calc(var(--header-height, 70px) + var(--space-md));
}

.legal-text h2 {
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 3px solid var(--primary-color);
    font-size: 1.75rem;
}

.legal-text h3 {
    color: var(--text-primary);
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
    font-size: 1.25rem;
}

.legal-text h4 {
    color: var(--text-primary);
    margin-top: var(--space-md);
    margin-bottom: var(--space-sm);
    font-size: 1.125rem;
}

.legal-text p {
    margin-bottom: var(--space-md);
    line-height: 1.7;
    color: var(--text-secondary);
}

.legal-text ul {
    margin-bottom: var(--space-md);
    padding-left: var(--space-lg);
}

.legal-text ul li {
    margin-bottom: var(--space-sm);
    line-height: 1.7;
    color: var(--text-secondary);
}

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

.legal-text a {
    color: var(--primary-color);
    text-decoration: underline;
}

.legal-text a:hover {
    text-decoration: none;
}

/* Contact Info Box */
.contact-info {
    background: var(--bg-secondary);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    margin: var(--space-lg) 0;
}

.contact-info p {
    margin-bottom: var(--space-xs);
}

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

/* Cookie Tables */
.cookie-table {
    margin: var(--space-lg) 0;
    overflow-x: auto;
}

.cookie-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.cookie-table thead {
    background: var(--primary-color);
    color: white;
}

.cookie-table thead th {
    padding: var(--space-md);
    text-align: left;
    font-weight: 600;
    font-size: 0.9375rem;
}

.cookie-table tbody tr {
    border-bottom: 1px solid var(--border-color);
}

.cookie-table tbody tr:last-child {
    border-bottom: none;
}

.cookie-table tbody tr:hover {
    background: var(--bg-secondary);
}

.cookie-table tbody td {
    padding: var(--space-md);
    color: var(--text-secondary);
}

.cookie-table tbody td:first-child {
    font-weight: 600;
    color: var(--text-primary);
}

/* Cookie Preferences Section */
.cookie-preferences {
    background: var(--bg-secondary);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    margin: var(--space-xl) 0;
}

.cookie-preferences h3 {
    margin-top: 0;
    margin-bottom: var(--space-lg);
}

.preference-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.preference-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: white;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
}

.preference-item strong {
    display: block;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.preference-item p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

input:disabled + .slider {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--text-primary);
    color: white;
    padding: var(--space-lg);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

.cookie-content p {
    margin: 0;
    flex: 1;
}

.cookie-actions {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .legal-content .container {
        grid-template-columns: 200px 1fr;
        gap: var(--space-lg);
    }

    .legal-nav {
        font-size: 0.875rem;
    }
}

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

    .legal-nav {
        position: static;
        margin-bottom: var(--space-lg);
    }

    .legal-text {
        padding: var(--space-lg);
    }

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

    .cookie-content {
        flex-direction: column;
        text-align: center;
    }

    .cookie-actions {
        flex-direction: column;
        width: 100%;
    }

    .cookie-actions .btn {
        width: 100%;
    }

    .cookie-table {
        font-size: 0.875rem;
    }

    .cookie-table thead th,
    .cookie-table tbody td {
        padding: var(--space-sm);
    }
}

@media (max-width: 480px) {
    .preference-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .switch {
        align-self: flex-end;
    }
}
