/* ===== Terms & Conditions Styling ===== */
/* File: public/assets/css/terms.css */

:root {
    --terms-bg: #0b073a;
    --terms-glass: rgba(255, 255, 255, 0.08);
    --terms-stroke: rgba(167, 139, 250, 0.2);
    --terms-primary: #7c5cff;
    --terms-primary-hover: #6a4be6;
    --terms-text: #e5e7eb;
    --terms-muted: #a8b0c2;
    --terms-radius: 16px;
    --terms-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --terms-max-width: 1200px;
}

/* ===== Container ===== */
.terms-page-wrapper {
    background: var(--terms-bg);
    min-height: 100vh;
    padding-bottom: 60px;
}

.terms-container {
    max-width: var(--terms-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Hero Section ===== */
.terms-hero {
    padding-top: clamp(80px, 10vh, 120px);
    padding-bottom: clamp(30px, 5vh, 50px);
}

.terms-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--terms-muted);
}

.terms-breadcrumb a {
    color: var(--terms-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.terms-breadcrumb a:hover {
    color: #fff;
}

.terms-breadcrumb .separator {
    opacity: 0.5;
}

.terms-hero-content {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

@media (min-width: 992px) {
    .terms-hero-content {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
        align-items: center;
    }
}

.terms-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

.terms-subtitle {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--terms-text);
    opacity: 0.9;
    margin: 12px 0 0;
    line-height: 1.6;
}

.terms-divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #7c5cff, #a588ff);
    border: none;
    border-radius: 4px;
    margin: 16px 0 0;
}

/* ===== Main Card ===== */
.terms-main-card {
    background: var(--terms-glass);
    border: 1px solid var(--terms-stroke);
    border-radius: var(--terms-radius);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--terms-shadow);
    overflow: hidden;
    margin-bottom: 40px;
}

.terms-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--terms-stroke);
    background: rgba(42, 25, 98, 0.3);
}

.terms-meta {
    font-size: 0.875rem;
    color: var(--terms-muted);
}

.terms-version {
    font-size: 0.875rem;
    color: var(--terms-muted);
}

/* ===== Layout Grid (TOC + Content) ===== */
.terms-layout {
    display: grid;
    gap: 24px;
    padding: 24px 20px;
}

@media (min-width: 1024px) {
    .terms-layout {
        grid-template-columns: 280px 1fr;
        gap: 32px;
        align-items: start;
    }
}

/* ===== Table of Contents (TOC) ===== */
.terms-toc {
    background: rgba(42, 25, 98, 0.4);
    border: 1px solid var(--terms-stroke);
    border-radius: 14px;
    padding: 20px;
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

/* Custom scrollbar untuk TOC */
.terms-toc::-webkit-scrollbar {
    width: 6px;
}

.terms-toc::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.terms-toc::-webkit-scrollbar-thumb {
    background: rgba(124, 92, 255, 0.5);
    border-radius: 3px;
}

.terms-toc::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 92, 255, 0.7);
}

.terms-toc h3 {
    margin: 0 0 16px;
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
}

.terms-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: toc-counter;
}

.terms-toc-list li {
    counter-increment: toc-counter;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.terms-toc-list li::before {
    content: counter(toc-counter) ".";
    color: var(--terms-primary);
    font-weight: 600;
    flex-shrink: 0;
    min-width: 24px;
    padding-top: 1px;
}

.terms-toc-list a {
    color: var(--terms-text);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: all 0.2s;
    flex: 1;
    line-height: 1.5;
    word-wrap: break-word;
}

.terms-toc-list a:hover {
    color: #fff;
}

.terms-toc-list li:hover::before {
    color: #fff;
}

.terms-toc-list a.active {
    color: var(--terms-primary);
    font-weight: 600;
}

/* ===== Content Sections ===== */
.terms-content {
    display: grid;
    gap: 20px;
}

.terms-section {
    background: rgba(42, 25, 98, 0.3);
    border: 1px solid var(--terms-stroke);
    border-radius: 14px;
    padding: 24px;
    scroll-margin-top: 100px;
}

.terms-section h2 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.terms-section h2::before {
    content: "";
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, #7c5cff, #a588ff);
    border-radius: 2px;
}

.terms-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    margin: 20px 0 12px;
}

.terms-section p {
    color: var(--terms-text);
    line-height: 1.7;
    margin: 0 0 12px;
}

.terms-section ul,
.terms-section ol {
    color: var(--terms-text);
    line-height: 1.7;
    margin: 12px 0;
    padding-left: 24px;
}

.terms-section li {
    margin-bottom: 8px;
}

.terms-section strong {
    color: #fff;
    font-weight: 600;
}

/* ===== Note/Info Box ===== */
.terms-note {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    background: rgba(124, 92, 255, 0.1);
    border: 1px solid rgba(124, 92, 255, 0.3);
    border-radius: 10px;
    margin: 16px 0;
}

.terms-note-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--terms-primary);
}

.terms-note-content {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--terms-text);
    line-height: 1.6;
}

/* ===== Action Buttons ===== */
.terms-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 32px 20px;
}

.terms-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 999px;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
}

.terms-btn-primary {
    background: linear-gradient(135deg, #7c5cff, #a588ff);
    color: #fff;
    box-shadow: 0 4px 16px rgba(124, 92, 255, 0.3);
}

.terms-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 92, 255, 0.4);
    color: #fff;
}

.terms-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--terms-text);
    border: 1px solid var(--terms-stroke);
}

.terms-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* ===== Back to Top Button ===== */
.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #7c5cff, #a588ff);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s;
    box-shadow: 0 8px 24px rgba(124, 92, 255, 0.4);
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(124, 92, 255, 0.5);
}

/* ===== Mobile Optimizations ===== */
@media (max-width: 767px) {
    .terms-container {
        padding: 0 16px;
    }

    .terms-hero {
        padding-top: 60px;
        padding-bottom: 24px;
    }

    .terms-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .terms-layout {
        padding: 16px;
    }

    .terms-toc {
        position: static;
        max-height: none;
        margin-bottom: 20px;
    }

    .terms-section {
        padding: 16px;
    }

    .terms-section h2 {
        font-size: 1.25rem;
    }

    .terms-actions {
        padding: 24px 16px;
    }

    .back-to-top {
        right: 16px;
        bottom: 16px;
        width: 44px;
        height: 44px;
    }
}

/* ===== Tablet Optimizations ===== */
@media (min-width: 768px) and (max-width: 1023px) {
    .terms-layout {
        grid-template-columns: 1fr;
    }

    .terms-toc {
        position: static;
        max-height: none;
    }
}

/* ===== Print Styles ===== */
@media print {
    .terms-toc,
    .terms-actions,
    .back-to-top,
    .terms-breadcrumb {
        display: none !important;
    }

    .terms-main-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .terms-section {
        page-break-inside: avoid;
    }
}
