/* Legal Pages Styles */

.legal-wrapper {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 100px 20px 60px;
    gap: 40px;
    position: relative;
}

/* Table of Contents */
.toc {
    position: sticky;
    top: 100px;
    width: 280px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background: rgba(30, 31, 34, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 25px;
    flex-shrink: 0;
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--glass-border);
}

.toc-header h3 {
    color: #fff;
    font-size: 1.3rem;
    margin: 0;
}

.toc-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list>li {
    margin-bottom: 12px;
}

.toc-list a {
    color: #b9bbbe;
    text-decoration: none;
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    line-height: 1.4;
}

.toc-list a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(5px);
}

.toc-list a.active {
    background: var(--primary-gradient);
    color: #fff;
    font-weight: 600;
}

.toc-list ul {
    list-style: none;
    padding-left: 20px;
    margin-top: 8px;
}

.toc-list ul li {
    margin-bottom: 8px;
}

.toc-list ul a {
    font-size: 0.9rem;
    padding: 6px 10px;
}

/* Custom scrollbar for TOC */
.toc::-webkit-scrollbar {
    width: 4px;
}

.toc::-webkit-scrollbar-track {
    background: transparent;
}

.toc::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.toc:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

/* Policy Container */
.policy-container {
    flex: 1;
    min-width: 0;
}

.policy-header {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 50px;
}

.policy-header h1 {
    font-size: 2.8rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
    font-weight: 800;
}

.last-updated {
    color: #b9bbbe;
    font-size: 1.1rem;
    margin-bottom: 25px;
}

.policy-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 25px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: #fff;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.search-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.search-container input {
    padding: 10px 40px 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    width: 250px;
    transition: all 0.3s ease;
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 0, 127, 0.1);
    width: 300px;
}

.search-container i {
    position: absolute;
    right: 15px;
    color: #b9bbbe;
    pointer-events: none;
}

/* Important Notice */
.important-notice {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: rgba(88, 101, 242, 0.1);
    border: 1px solid rgba(88, 101, 242, 0.3);
    border-radius: 12px;
    margin-bottom: 40px;
}

.important-notice i {
    font-size: 1.5rem;
    color: #5865F2;
    flex-shrink: 0;
}

.important-notice strong {
    color: #fff;
    display: block;
    margin-bottom: 5px;
}

.important-notice p {
    color: #b9bbbe;
    margin: 0;
    line-height: 1.6;
}

/* Policy Sections */
.policy-section {
    background: rgba(30, 31, 34, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 35px;
    margin-bottom: 25px;
    scroll-margin-top: 100px;
    transition: all 0.3s ease;
}

.policy-section:target {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(255, 0, 127, 0.2);
}

.section-header-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--glass-border);
}

.section-icon {
    font-size: 1.8rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.policy-section h2 {
    color: #fff;
    font-size: 1.6rem;
    margin: 0;
    flex: 1;
}

.section-content {
    color: #b9bbbe;
    line-height: 1.8;
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.subsection {
    margin: 25px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--primary-color);
    border-radius: 8px;
    scroll-margin-top: 100px;
}

.subsection:target {
    background: rgba(255, 0, 127, 0.05);
}

.subsection h3 {
    color: #fff;
    font-size: 1.25rem;
    margin: 0 0 15px 0;
}

.subsection-content {
    color: #b9bbbe;
    line-height: 1.8;
}

.policy-section ul,
.subsection-content ul {
    margin: 15px 0;
    padding-left: 25px;
}

.policy-section li,
.subsection-content li {
    color: #b9bbbe;
    line-height: 1.8;
    margin-bottom: 10px;
}

.policy-section strong,
.subsection-content strong {
    color: #fff;
    font-weight: 600;
}

.policy-section a,
.subsection-content a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.policy-section a:hover,
.subsection-content a:hover {
    text-decoration: underline;
    color: #FF69B4;
}

/* Search Highlight */
.highlight {
    background: rgba(255, 255, 0, 0.3);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* Mobile Menu Toggle & Overlay */
.legal-menu-toggle {
    display: none;
    position: fixed;
    bottom: 25px;
    right: 20px;
    z-index: 1000;
    background: var(--primary-gradient);
    border: none;
    border-radius: 50px;
    height: 48px;
    padding: 0 20px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(255, 0, 127, 0.4);
    color: white;
    font-size: 1rem;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.legal-menu-toggle.hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.legal-menu-toggle span {
    font-weight: 700;
}

.toc-close {
    display: none;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.toc-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.legal-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.legal-sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Policy Footer */
.policy-footer {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--glass-border);
    text-align: center;
}

.footer-links {
    margin-bottom: 30px;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #FF69B4;
}

.btn-home {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: #fff;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-home:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Print Styles */
@media print {

    .toc,
    .policy-actions,
    .btn-home,
    header,
    footer {
        display: none !important;
    }

    .legal-wrapper {
        padding: 20px;
    }

    .policy-section {
        page-break-inside: avoid;
        border: 1px solid #ddd;
        background: #fff;
        color: #000;
    }

    .policy-section h2,
    .subsection h3 {
        color: #000;
    }

    .section-content,
    .subsection-content,
    .policy-section li {
        color: #333;
    }
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .legal-wrapper {
        flex-direction: column;
        padding-top: 100px;
    }

    .toc {
        position: fixed;
        top: 0;
        left: -100%;
        width: 290px;
        max-width: 85vw;
        height: 100vh;
        max-height: 100vh;
        z-index: 1002;
        background: #111214 !important;
        backdrop-filter: blur(20px) !important;
        border: none;
        border-right: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: 0;
        transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
        padding: 30px 20px;
    }

    .toc.expanded {
        left: 0;
    }

    .toc-header {
        margin-bottom: 25px;
        padding-bottom: 12px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .toc-close {
        display: flex;
    }

    .legal-menu-toggle {
        display: flex;
    }

    .policy-header h1 {
        font-size: 2rem;
    }

    .policy-actions {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }

    .search-container {
        width: 100%;
    }

    .search-container input {
        width: 100% !important;
    }
}

@media (max-width: 768px) {
    .legal-wrapper {
        padding: 60px 15px 40px;
    }

    .policy-section {
        padding: 25px 20px;
    }

    .policy-header h1 {
        font-size: 1.8rem;
    }

    .section-header-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .policy-section h2 {
        font-size: 1.3rem;
    }

    .subsection h3 {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .legal-wrapper {
        padding: 60px 10px 30px;
    }

    .toc {
        padding: 20px 15px;
    }

    .policy-header h1 {
        font-size: 1.5rem;
    }

    .last-updated {
        font-size: 0.95rem;
    }

    .policy-actions {
        gap: 10px;
    }

    .action-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .search-container input {
        padding: 8px 35px 8px 12px;
        font-size: 0.9rem;
    }

    .important-notice {
        padding: 15px;
        gap: 12px;
    }

    .important-notice i {
        font-size: 1.2rem;
    }

    .policy-section {
        padding: 20px 15px;
    }

    .policy-section h2 {
        font-size: 1.2rem;
    }

    .subsection h3 {
        font-size: 1rem;
    }

    .section-content,
    .subsection-content {
        font-size: 0.95rem;
    }

    .policy-section ul,
    .subsection-content ul {
        padding-left: 20px;
    }

    .subsection {
        padding: 15px;
    }

    .btn-home {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .policy-footer {
        margin-top: 40px;
        padding-top: 30px;
    }

    .footer-links a {
        font-size: 1rem;
    }
}