/* ==========================================
   LEGAL PAGES - Unique Terminal/Hacker Style
   ========================================== */

/* Legal Page Container */
.legal-page {
    min-height: 100vh;
    background: #0a0a0f;
    padding: 0;
    position: relative;
    overflow-x: hidden;
}

/* Animated grid background */
.legal-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(0, 255, 136, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 136, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

/* Scanline effect */
.legal-page::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
    pointer-events: none;
    z-index: 1;
}

/* Back Button - Terminal style */
.back-button {
    position: fixed;
    top: 30px;
    left: 30px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #00ff88;
    text-decoration: none;
    font-size: 0.9em;
    font-family: 'Consolas', 'Monaco', monospace;
    padding: 12px 20px;
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 0;
    transition: all 0.2s ease;
    z-index: 100;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.back-button::before {
    content: '>';
    color: #00ff88;
    animation: blink 1s infinite;
}

.back-button:hover {
    background: rgba(0, 255, 136, 0.15);
    border-color: #00ff88;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3),
                inset 0 0 20px rgba(0, 255, 136, 0.1);
    text-shadow: 0 0 10px #00ff88;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Legal Container - Terminal Window */
.legal-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 100px 40px 60px;
    position: relative;
    z-index: 2;
}

/* Legal Header - System Header */
.legal-header {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    border: 1px solid #30363d;
    border-bottom: none;
    padding: 0;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

/* Terminal window bar */
.legal-header::before {
    content: '';
    display: block;
    height: 35px;
    background: linear-gradient(180deg, #2d333b 0%, #22272e 100%);
    border-bottom: 1px solid #30363d;
    position: relative;
}

/* Terminal window buttons */
.legal-header::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 15px;
    width: 12px;
    height: 12px;
    background: #ff5f56;
    border-radius: 50%;
    box-shadow: 
        20px 0 0 #ffbd2e,
        40px 0 0 #27c93f;
}

.legal-header-content {
    padding: 50px 40px;
    text-align: left;
}

.legal-header i {
    font-size: 2.5em;
    color: #00ff88;
    margin-bottom: 20px;
    display: inline-block;
    text-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
}

.legal-header h1 {
    color: #e6edf3;
    font-size: 2em;
    font-weight: 600;
    margin: 0;
    font-family: 'Consolas', 'Monaco', monospace;
    display: flex;
    align-items: center;
    gap: 15px;
}

.legal-header h1::before {
    content: '$';
    color: #00ff88;
    font-weight: 400;
}

.legal-header .subtitle {
    color: #7d8590;
    font-family: 'Consolas', monospace;
    font-size: 0.9em;
    margin-top: 15px;
}

/* Legal Content */
.legal-content {
    background: #0d1117;
    border: 1px solid #30363d;
    border-top: none;
    padding: 50px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Table of Contents - Index */
.legal-toc {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.03) 0%, rgba(0, 255, 136, 0.01) 100%);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 0;
    padding: 30px;
    margin-bottom: 50px;
    position: relative;
}

.legal-toc::before {
    content: '// INDEX';
    position: absolute;
    top: -12px;
    left: 20px;
    background: #0d1117;
    color: #00ff88;
    font-family: 'Consolas', monospace;
    font-size: 0.75em;
    padding: 4px 12px;
    letter-spacing: 2px;
}

.legal-toc h3 {
    display: none;
}

.legal-toc ol {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 40px;
}

.legal-toc li {
    margin: 0;
    counter-increment: toc-counter;
    display: flex;
    align-items: center;
}

.legal-toc li::before {
    content: '[' counter(toc-counter, decimal-leading-zero) ']';
    color: #7d8590;
    font-family: 'Consolas', monospace;
    font-size: 0.85em;
    margin-right: 12px;
    min-width: 40px;
}

.legal-toc a {
    color: #e6edf3;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95em;
    position: relative;
}

.legal-toc a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #00ff88;
    transition: width 0.3s ease;
}

.legal-toc a:hover {
    color: #00ff88;
}

.legal-toc a:hover::after {
    width: 100%;
}

/* Legal Sections */
.legal-section {
    margin-bottom: 50px;
    padding: 35px;
    background: rgba(22, 27, 34, 0.5);
    border: 1px solid #21262d;
    border-left: 3px solid #00ff88;
    position: relative;
    transition: all 0.3s ease;
}

.legal-section:hover {
    border-left-color: #00ff88;
    background: rgba(22, 27, 34, 0.8);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.05);
}

.legal-section:last-child {
    margin-bottom: 0;
}

/* Section number badge */
.legal-section::before {
    content: attr(data-section);
    position: absolute;
    top: -1px;
    right: -1px;
    background: #00ff88;
    color: #0d1117;
    font-family: 'Consolas', monospace;
    font-size: 0.7em;
    font-weight: 700;
    padding: 6px 14px;
    letter-spacing: 1px;
}

.legal-section h2 {
    color: #e6edf3;
    font-size: 1.3em;
    font-weight: 600;
    margin: 0 0 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #30363d;
}

.legal-section h2 i {
    color: #00ff88;
    font-size: 1em;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.legal-section h3 {
    color: #e6edf3;
    font-size: 1.05em;
    font-weight: 600;
    margin: 30px 0 15px;
    padding-left: 15px;
    border-left: 2px solid #30363d;
}

.legal-section p {
    color: #8b949e;
    line-height: 1.9;
    margin-bottom: 15px;
}

.legal-section ul {
    color: #8b949e;
    line-height: 1.9;
    padding-left: 0;
    margin-bottom: 15px;
    list-style: none;
}

.legal-section li {
    margin-bottom: 10px;
    padding-left: 25px;
    position: relative;
}

.legal-section li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #00ff88;
    font-family: 'Consolas', monospace;
}

.legal-section a {
    color: #58a6ff;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px dashed transparent;
}

.legal-section a:hover {
    color: #79c0ff;
    border-bottom-color: #79c0ff;
}

/* Info Box - Data Block */
.info-box {
    background: #161b22;
    border: 1px solid #30363d;
    border-left: 3px solid #58a6ff;
    padding: 25px;
    margin: 20px 0;
    position: relative;
}

.info-box::before {
    content: 'DATA';
    position: absolute;
    top: -10px;
    left: 20px;
    background: #0d1117;
    color: #58a6ff;
    font-family: 'Consolas', monospace;
    font-size: 0.65em;
    padding: 3px 10px;
    letter-spacing: 2px;
    border: 1px solid #30363d;
}

.info-box p {
    margin: 0 0 8px;
    color: #8b949e;
}

.info-box p:last-child {
    margin-bottom: 0;
}

.info-box ul {
    margin: 15px 0 0;
}

.info-box code {
    background: rgba(88, 166, 255, 0.1);
    padding: 3px 10px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    color: #79c0ff;
    border: 1px solid rgba(88, 166, 255, 0.2);
}

.info-box i {
    color: #58a6ff;
    margin-right: 10px;
}

/* Rights Grid - Access Cards */
.rights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.right-item {
    background: #161b22;
    border: 1px solid #30363d;
    padding: 25px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.right-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #00ff88 0%, #00d4ff 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.right-item:hover {
    border-color: #00ff88;
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 255, 136, 0.1);
}

.right-item:hover::before {
    transform: scaleX(1);
}

.right-item i {
    font-size: 2em;
    color: #00ff88;
    margin-bottom: 15px;
    display: block;
}

.right-item h4 {
    color: #e6edf3;
    font-size: 1em;
    font-weight: 600;
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9em;
}

.right-item p {
    color: #7d8590;
    font-size: 0.9em;
    line-height: 1.7;
    margin: 0;
}

/* Legal Footer */
.legal-footer {
    background: #161b22;
    padding: 25px 50px;
    text-align: left;
    border: 1px solid #30363d;
    border-top: none;
    font-family: 'Consolas', monospace;
}

.legal-footer p {
    color: #484f58;
    margin: 0;
    font-size: 0.85em;
}

.legal-footer p::before {
    content: '// ';
    color: #30363d;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .back-button {
        position: relative;
        top: 0;
        left: 0;
        margin: 20px;
    }

    .legal-container {
        padding: 0 20px 40px;
    }

    .legal-header-content {
        padding: 35px 25px;
    }

    .legal-header h1 {
        font-size: 1.4em;
    }

    .legal-content {
        padding: 30px 25px;
    }

    .legal-toc ol {
        grid-template-columns: 1fr;
    }

    .legal-section {
        padding: 25px;
    }

    .legal-section h2 {
        font-size: 1.1em;
        flex-wrap: wrap;
    }

    .legal-section::before {
        position: relative;
        top: 0;
        right: 0;
        display: inline-block;
        margin-bottom: 15px;
    }

    .rights-grid {
        grid-template-columns: 1fr;
    }

    .legal-footer {
        padding: 20px 25px;
    }
}
