/* ================================
   Legal Pages Specific Styles
   ================================ */

/* Page Hero Section */
.page-hero {
    position: relative;
    height: 40vh;
    min-height: 300px;
    max-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 60px;
}

.page-hero .hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-bg-alt) 100%);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.particle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.page-hero .hero-content {
    text-align: center;
    z-index: 10;
    padding: 0 2rem;
    position: relative;
}

/* Hero Content */
.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    text-align: center;
    z-index: 1;
    padding: 0 2rem;
}

.page-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.title-en {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

.title-ja {
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    font-weight: 700;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 1rem;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb .separator {
    color: var(--text-secondary);
    opacity: 0.5;
}

.breadcrumb .current {
    color: var(--primary-color);
    font-weight: 500;
}

/* Legal Content Layout */
.legal-content {
    background: var(--dark-bg) !important;
    padding: 5rem 0 !important;
    position: relative !important;
    z-index: 1 !important;
    min-height: 100vh !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.legal-wrapper {
    display: grid !important;
    grid-template-columns: 300px 1fr !important;
    gap: 4rem !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Table of Contents Sidebar */
.toc-sidebar {
    position: sticky !important;
    top: 100px !important;
    height: fit-content !important;
    background: var(--dark-bg-alt) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px !important;
    padding: 2rem !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.toc-title {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toc-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.toc-nav ul {
    list-style: none;
}

.toc-nav li {
    margin-bottom: 1rem;
}

.toc-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    display: block;
    padding: 0.5rem 1rem;
    border-left: 2px solid transparent;
    transition: var(--transition);
    font-size: 0.95rem;
}

.toc-nav a:hover {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.05);
    border-left-color: var(--primary-color);
}

.toc-nav a.active {
    color: var(--primary-color);
    background: rgba(139, 92, 246, 0.1);
    border-left-color: var(--primary-color);
}

/* Legal Main Content */
.legal-main {
    background: var(--dark-bg-alt) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 15px !important;
    padding: 3rem !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.legal-header {
    display: flex;
    justify-content: space-between;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.effective-date,
.last-updated {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.effective-date::before {
    content: '📅 ';
}

.last-updated::before {
    content: '🔄 ';
}

.legal-intro {
    background: rgba(139, 92, 246, 0.05);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    margin-bottom: 3rem;
    border-radius: 5px;
}

.legal-intro p {
    color: var(--text-primary);
    line-height: 1.8;
}

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

.section-number {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.section-content {
    color: var(--text-secondary);
    line-height: 1.8;
}

.section-content p {
    margin-bottom: 1.5rem;
}

.subsection-title {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin: 2rem 0 1rem;
}

/* Lists */
.numbered-list,
.bullet-list {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.numbered-list li,
.bullet-list li {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.numbered-list {
    counter-reset: item;
    list-style: none;
    padding-left: 0;
}

.numbered-list li {
    counter-increment: item;
    position: relative;
    padding-left: 3rem;
}

.numbered-list li::before {
    content: counter(item);
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--dark-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
}

.bullet-list {
    list-style: none;
}

.bullet-list li {
    position: relative;
    padding-left: 2rem;
}

.bullet-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* Info Boxes */
.info-box,
.warning-box,
.contact-box {
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 10px;
}

.info-box {
    background: rgba(30, 64, 175, 0.1);
    border: 1px solid rgba(30, 64, 175, 0.3);
}

.warning-box {
    background: rgba(255, 153, 0, 0.1);
    border: 1px solid rgba(255, 153, 0, 0.3);
}

.contact-box {
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid var(--primary-color);
}

.info-box i,
.warning-box i {
    font-size: 1.5rem;
    margin-right: 1rem;
    vertical-align: middle;
}

.info-box i {
    color: #1e40af;
}

.warning-box i {
    color: #ff9900;
}

.info-box p,
.warning-box p {
    display: inline;
}

/* Contact List */
.contact-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.contact-list dt {
    font-weight: 600;
    color: var(--primary-color);
}

.contact-list dd {
    color: var(--text-primary);
}

.contact-list a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.contact-list a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Cookie Table */
.cookie-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.cookie-table thead {
    background: rgba(139, 92, 246, 0.1);
}

.cookie-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
}

.cookie-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.cookie-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.05);
}

/* Legal Footer */
.legal-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

.company-info {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

/* Print Button */
.print-button {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--dark-bg-alt);
    border: 1px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 100;
}

.print-button:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.print-button i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.print-button:hover i {
    color: var(--dark-bg);
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 999;
}

.scroll-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: width 0.1s ease;
}

/* ================================
   Responsive Design for Legal Pages
   ================================ */

/* Tablet and Mobile (〜1024px) */
@media (max-width: 1024px) {
    .legal-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .toc-sidebar {
        position: static;
        margin-bottom: 2rem;
    }

    .toc-nav {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .toc-nav ul {
        display: contents;
    }
}

/* Mobile (〜480px) */
@media (max-width: 480px) {
    /* Hero Section */
    .page-hero {
        height: 30vh !important;
        min-height: 250px !important;
        margin-top: 70px !important;
    }

    .page-title .title-en {
        font-size: 1.8rem !important;
    }

    .page-title .title-ja {
        font-size: 1rem !important;
    }

    .breadcrumb {
        font-size: 0.8rem !important;
        gap: 0.5rem !important;
    }

    /* Legal Content */
    .legal-content {
        padding: 2rem 0 !important;
    }

    .legal-wrapper {
        gap: 1rem !important;
        padding: 0 1rem !important;
    }

    .legal-main {
        padding: 1.5rem !important;
        border-radius: 10px !important;
    }

    .legal-header {
        flex-direction: column !important;
        gap: 0.5rem !important;
        align-items: flex-start !important;
    }

    .section-title {
        font-size: 1.2rem !important;
    }

    .numbered-list li {
        padding-left: 2rem !important;
        font-size: 0.9rem !important;
    }

    .numbered-list li::before {
        width: 1.6rem !important;
        height: 1.6rem !important;
        font-size: 0.7rem !important;
    }

    .bullet-list li {
        font-size: 0.9rem !important;
        margin-bottom: 0.5rem !important;
    }

    .contact-list {
        grid-template-columns: 1fr !important;
    }

    .cookie-table {
        font-size: 0.8rem !important;
    }

    .cookie-table th,
    .cookie-table td {
        padding: 0.75rem 0.5rem !important;
    }

    .toc-nav {
        grid-template-columns: 1fr !important;
    }

    .toc-sidebar {
        padding: 1rem !important;
    }

    .toc-title {
        font-size: 1rem !important;
    }

    .toc-nav ul li a {
        font-size: 0.85rem !important;
        padding: 0.4rem 0 !important;
    }

    .info-box {
        padding: 1rem !important;
        margin: 1rem 0 !important;
    }

    .print-button {
        bottom: 80px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .navbar,
    .footer,
    .toc-sidebar,
    .back-to-top,
    .print-button,
    .scroll-progress,
    #loading-screen,
    .cursor,
    .cursor-follower {
        display: none !important;
    }

    .legal-wrapper {
        grid-template-columns: 1fr;
    }

    .legal-main {
        background: white;
        border: 1px solid #ccc;
        padding: 2rem;
    }

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

    .info-box,
    .warning-box,
    .contact-box {
        border: 1px solid #000;
        background: #f5f5f5;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .section-number,
    .section-title,
    .subsection-title {
        color: #000;
        -webkit-text-fill-color: initial;
    }
}

/* Smooth Scrolling for TOC */
html {
    scroll-behavior: smooth;
}

/* Highlight Animation */
@keyframes highlight {
    0% { background-color: transparent; }
    50% { background-color: rgba(139, 92, 246, 0.2); }
    100% { background-color: transparent; }
}

.legal-section:target {
    animation: highlight 2s ease;
}