/* Legal Pages Styles */

/* Header Link Styles */
.site-header .logo a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
}

/* Legal Page Layout */
.legal-page {
    padding: 8rem 0 4rem;
    min-height: 100vh;
}

.legal-header {
    margin-bottom: 4rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #000;
}

.legal-header h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.legal-intro {
    font-size: 1.1rem;
    color: var(--text-sub);
    line-height: 1.8;
    max-width: 800px;
}

/* Legal Content */
.legal-content {
    max-width: 900px;
}

/* Legal Table (for Tokushoho) */
.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

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

.legal-table th,
.legal-table td {
    padding: 1.5rem;
    text-align: left;
    vertical-align: top;
}

.legal-table th {
    width: 200px;
    font-weight: 600;
    background: #fafafa;
    border-right: 2px solid var(--accent-color);
}

.legal-table td {
    line-height: 1.8;
}

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

.legal-table li {
    padding: 0.3rem 0;
    padding-left: 1.2rem;
    position: relative;
}

.legal-table li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.7rem;
    width: 6px;
    height: 6px;
    background: var(--accent-color);
    border-radius: 50%;
}

.legal-table .price-list li {
    padding: 0.5rem 0 0.5rem 1.5rem;
}

.legal-table .note {
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-top: 0.5rem;
}

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

/* Legal Sections (for Privacy & Terms) */
.legal-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.legal-section:last-child {
    border-bottom: none;
}

.legal-section h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
}

.legal-section p {
    line-height: 1.9;
    margin-bottom: 1rem;
}

.legal-section ul,
.legal-section ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.legal-section li {
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

.legal-section ul li {
    list-style-type: disc;
}

.legal-section ol li {
    list-style-type: decimal;
}

.legal-section ul ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.legal-section strong {
    color: var(--text-main);
}

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

/* Contact Box */
.contact-box {
    background: #f9f9f9;
    border: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    margin-top: 1rem;
}

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

.contact-box a {
    color: var(--accent-color);
}

/* Legal Footer */
.legal-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px solid #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.update-date {
    font-size: 0.9rem;
    color: var(--text-sub);
    line-height: 1.6;
}

.btn-back {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: #000;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-smooth);
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
}

.btn-back:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .legal-page {
        padding: 6rem 0 3rem;
    }

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

    .legal-intro {
        font-size: 1rem;
    }

    .legal-table th,
    .legal-table td {
        display: block;
        width: 100%;
        padding: 1rem;
    }

    .legal-table th {
        border-right: none;
        border-bottom: 2px solid var(--accent-color);
    }

    .legal-section h2 {
        font-size: 1.2rem;
    }

    .legal-footer {
        flex-direction: column;
        text-align: center;
    }

    .btn-back {
        width: 100%;
        text-align: center;
    }
}

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

    .legal-table th,
    .legal-table td {
        padding: 0.8rem;
    }

    .contact-box {
        padding: 1rem;
    }
}

/* ============================================
   LEGAL PAGE ANIMATIONS
   ============================================ */

/* Page Load Animation */
.legal-page {
    opacity: 0;
    animation: legalPageFadeIn 0.8s ease-out forwards;
}

@keyframes legalPageFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Animation */
.legal-header {
    opacity: 0;
    animation: legalHeaderSlide 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

@keyframes legalHeaderSlide {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.legal-header h1 {
    position: relative;
    display: inline-block;
}

.legal-header h1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--accent-color);
    animation: titleUnderline 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

@keyframes titleUnderline {
    to {
        width: 100%;
    }
}

/* Legal Sections Stagger Animation */
.legal-section {
    opacity: 0;
    transform: translateY(30px);
    animation: sectionFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.legal-section:nth-child(1) { animation-delay: 0.3s; }
.legal-section:nth-child(2) { animation-delay: 0.4s; }
.legal-section:nth-child(3) { animation-delay: 0.5s; }
.legal-section:nth-child(4) { animation-delay: 0.6s; }
.legal-section:nth-child(5) { animation-delay: 0.7s; }
.legal-section:nth-child(6) { animation-delay: 0.8s; }
.legal-section:nth-child(7) { animation-delay: 0.9s; }
.legal-section:nth-child(8) { animation-delay: 1.0s; }
.legal-section:nth-child(9) { animation-delay: 1.1s; }
.legal-section:nth-child(10) { animation-delay: 1.2s; }
.legal-section:nth-child(11) { animation-delay: 1.3s; }
.legal-section:nth-child(12) { animation-delay: 1.4s; }
.legal-section:nth-child(13) { animation-delay: 1.5s; }
.legal-section:nth-child(14) { animation-delay: 1.6s; }

@keyframes sectionFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Heading Hover Effect */
.legal-section h2 {
    transition: transform 0.3s ease, color 0.3s ease;
}

.legal-section h2:hover {
    transform: translateX(5px);
}

/* Table Row Animation */
.legal-table tr {
    opacity: 0;
    animation: tableRowSlide 0.5s ease forwards;
}

.legal-table tr:nth-child(1) { animation-delay: 0.3s; }
.legal-table tr:nth-child(2) { animation-delay: 0.35s; }
.legal-table tr:nth-child(3) { animation-delay: 0.4s; }
.legal-table tr:nth-child(4) { animation-delay: 0.45s; }
.legal-table tr:nth-child(5) { animation-delay: 0.5s; }
.legal-table tr:nth-child(6) { animation-delay: 0.55s; }
.legal-table tr:nth-child(7) { animation-delay: 0.6s; }
.legal-table tr:nth-child(8) { animation-delay: 0.65s; }
.legal-table tr:nth-child(9) { animation-delay: 0.7s; }
.legal-table tr:nth-child(10) { animation-delay: 0.75s; }
.legal-table tr:nth-child(11) { animation-delay: 0.8s; }
.legal-table tr:nth-child(12) { animation-delay: 0.85s; }
.legal-table tr:nth-child(13) { animation-delay: 0.9s; }

@keyframes tableRowSlide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Table Row Hover */
.legal-table tr {
    transition: background-color 0.3s ease;
}

.legal-table tr:hover {
    background-color: rgba(0, 51, 255, 0.02);
}

.legal-table tr:hover th {
    background: rgba(0, 51, 255, 0.08);
}

/* Contact Box Animation */
.contact-box {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Back Button Enhanced */
.btn-back {
    position: relative;
    overflow: hidden;
}

.btn-back::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-back:hover::before {
    left: 100%;
}

/* Legal Footer Animation */
.legal-footer {
    opacity: 0;
    animation: footerFadeIn 0.6s ease 1s forwards;
}

@keyframes footerFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* List Item Bullet Animation */
.legal-section li::marker {
    transition: color 0.3s ease;
}

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

/* Link Hover Animation */
.legal-section a,
.legal-table a,
.contact-box a {
    position: relative;
    transition: color 0.3s ease;
}

.legal-section a::after,
.legal-table a::after,
.contact-box a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--accent-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.legal-section a:hover::after,
.legal-table a:hover::after,
.contact-box a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .legal-page,
    .legal-header,
    .legal-section,
    .legal-table tr,
    .legal-footer {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
