/* ===== CSS VARIABLES ===== */
:root {
    /* Primary Colors */
    --neon-cyan: #00f5ff;
    --neon-blue: #0080ff;
    --neon-purple: #8000ff;
    --neon-pink: #ff00ff;
    --electric-blue: #0066ff;
    --matrix-green: #00ff41;
    
    /* Background Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #121218;
    --bg-tertiary: #1a1a24;
    --bg-card: #1e1e2e;
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #b8c5d6;
    --text-muted: #8892a6;
    --text-accent: var(--neon-cyan);
    --text-danger: #ff4757;
    --text-success: #2ed573;
    
    /* Border Colors */
    --border-primary: rgba(255, 255, 255, 0.1);
    --border-accent: var(--neon-cyan);
    --border-glow: rgba(0, 245, 255, 0.5);
    
    /* Shadows */
    --shadow-glow: 0 0 30px rgba(0, 245, 255, 0.3);
    --shadow-glow-strong: 0 0 50px rgba(0, 245, 255, 0.6);
    --shadow-box: 0 20px 60px rgba(0, 0, 0, 0.3);
    
    /* Animation Durations */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.7;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 245, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(128, 0, 255, 0.08) 0%, transparent 50%);
    z-index: -2;
    animation: backgroundPulse 10s ease-in-out infinite alternate;
}

@keyframes backgroundPulse {
    0% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

/* ===== PARTICLES BACKGROUND ===== */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3;
    pointer-events: none;
}

/* ===== CYBER GRID ===== */
.cyber-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 245, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 245, 255, 0.05) 1px, transparent 1px);
    background-size: 100px 100px;
    z-index: -1;
    animation: gridPulse 8s ease-in-out infinite alternate;
}

@keyframes gridPulse {
    0% { opacity: 0.1; }
    100% { opacity: 0.2; }
}

/* ===== MAIN CONTAINER ===== */
.legal-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ===== HEADER ===== */
.legal-header {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-primary);
    padding: var(--space-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.logo {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 0 15px rgba(0, 245, 255, 0.5));
    transition: all var(--transition-normal);
}

.logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 25px rgba(0, 245, 255, 0.8));
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.title-glow {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 245, 255, 0.3);
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

/* ===== MAIN CONTENT ===== */
.legal-content {
    flex: 1;
    padding: var(--space-xl);
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.document-wrapper {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    padding: var(--space-xl);
    box-shadow: var(--shadow-box);
    position: relative;
    overflow: hidden;
}

.document-wrapper::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--neon-cyan), var(--neon-purple), var(--neon-pink));
    border-radius: 22px;
    opacity: 0;
    z-index: -1;
    transition: opacity var(--transition-normal);
}

.document-wrapper:hover::before {
    opacity: 0.1;
}

/* ===== DOCUMENT HEADER ===== */
.document-header {
    text-align: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-primary);
}

.document-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: var(--space-md);
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(0, 245, 255, 0.3);
}

.effective-date {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: 12px;
    max-width: 400px;
    margin: 0 auto;
}

.date-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-value {
    color: var(--text-accent);
    font-size: 1rem;
    font-weight: 600;
}

/* ===== INTRODUCTION ===== */
.intro-section {
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--bg-card), var(--bg-tertiary));
    border-radius: 16px;
    border: 1px solid var(--border-primary);
    position: relative;
}

.intro-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--neon-cyan), var(--neon-purple));
    border-radius: 2px;
}

.intro-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin: 0;
    padding-left: var(--space-md);
}

/* ===== SECTIONS ===== */
.legal-section {
    margin-bottom: var(--space-xl);
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.legal-section:hover {
    border-color: rgba(0, 245, 255, 0.3);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.section-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    border-bottom: 1px solid var(--border-primary);
}

.section-number {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
    color: var(--bg-primary);
    font-size: 1.2rem;
    font-weight: 700;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
    flex-shrink: 0;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-accent);
    margin: 0;
}

.section-content {
    padding: var(--space-lg);
}

.section-text {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.section-text:last-child {
    margin-bottom: 0;
}

/* ===== HIGHLIGHTS ===== */
.highlight {
    color: var(--text-accent);
    font-weight: 600;
    text-shadow: 0 0 10px rgba(0, 245, 255, 0.3);
}

.emphasis {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-accent);
    text-align: center;
    padding: var(--space-lg);
    background: var(--bg-glass);
    border: 1px solid var(--border-accent);
    border-radius: 12px;
    box-shadow: var(--shadow-glow);
}

/* ===== DATA CATEGORIES ===== */
.data-category,
.usage-category {
    margin-bottom: var(--space-lg);
}

.data-category h3,
.usage-category h4 {
    color: var(--text-accent);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.data-category h3::before,
.usage-category h4::before {
    content: '▶';
    color: var(--neon-cyan);
    font-size: 0.8rem;
}

.cyber-list {
    list-style: none;
    padding-left: var(--space-md);
}

.cyber-list li {
    position: relative;
    padding: var(--space-xs) 0;
    padding-left: var(--space-lg);
    color: var(--text-secondary);
    border-left: 2px solid rgba(0, 245, 255, 0.2);
    margin-bottom: var(--space-xs);
}

.cyber-list li::before {
    content: '◈';
    position: absolute;
    left: -8px;
    color: var(--neon-cyan);
    font-size: 0.8rem;
    background: var(--bg-card);
    width: 16px;
    text-align: center;
}

/* ===== PROHIBITION LIST ===== */
.prohibition-list {
    list-style: none;
    padding: 0;
}

.prohibition-list li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-sm);
    margin-bottom: var(--space-sm);
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.3);
    border-radius: 8px;
    color: var(--text-secondary);
}

.prohibition-icon {
    color: var(--text-danger);
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* ===== GRIDS ===== */
.protocol-grid,
.security-grid,
.rights-grid,
.liability-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.protocol-item,
.security-item,
.right-item,
.liability-item {
    background: var(--bg-glass);
    padding: var(--space-md);
    border-radius: 12px;
    border: 1px solid var(--border-primary);
    transition: all var(--transition-normal);
}

.protocol-item:hover,
.security-item:hover,
.right-item:hover,
.liability-item:hover {
    border-color: var(--border-accent);
    background: var(--bg-glass-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.protocol-item h4,
.security-item h4,
.right-item h4,
.liability-item h4 {
    color: var(--text-accent);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.protocol-item p,
.security-item p,
.right-item p,
.liability-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

/* ===== SPECIAL BOXES ===== */
.protocol-box,
.api-info-box,
.privacy-statement,
.cookie-info,
.policy-statement,
.termination-warning {
    background: var(--bg-glass);
    border: 1px solid var(--border-accent);
    border-radius: 12px;
    padding: var(--space-lg);
    margin: var(--space-md) 0;
    position: relative;
}

.protocol-box::before,
.api-info-box::before,
.privacy-statement::before,
.cookie-info::before,
.policy-statement::before,
.termination-warning::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
    border-radius: 3px 3px 0 0;
}

.protocol-box h4,
.api-info-box h4,
.privacy-statement h4,
.cookie-info h4 {
    color: var(--text-accent);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.usage-text {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

/* ===== CONTACT SECTION ===== */
.contact-section {
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    padding: var(--space-lg);
    border-radius: 16px;
    border: 1px solid var(--border-primary);
    margin: var(--space-xl) 0;
    text-align: center;
}

.contact-section h3 {
    color: var(--text-accent);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.contact-section p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
}

.contact-link {
    color: var(--text-accent);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-fast);
    position: relative;
}

.contact-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--text-accent);
    transition: width var(--transition-normal);
}

.contact-link:hover::after {
    width: 100%;
}

.contact-link:hover {
    text-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
}

/* ===== NAVIGATION ===== */
.navigation-section {
    margin-top: var(--space-xl);
    text-align: center;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
    color: var(--bg-primary);
    text-decoration: none;
    padding: var(--space-md) var(--space-lg);
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-glow);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-strong);
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-cyan));
}

.back-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .legal-content {
        padding: var(--space-lg) var(--space-md);
    }
    
    .document-wrapper {
        padding: var(--space-lg);
    }
    
    .header-content {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
    
    .document-title {
        font-size: 2rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .effective-date {
        flex-direction: column;
        gap: var(--space-xs);
    }
    
    .section-header {
        flex-direction: column;
        text-align: center;
        gap: var(--space-sm);
    }
    
    .section-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .protocol-grid,
    .security-grid,
    .rights-grid,
    .liability-grid {
        grid-template-columns: 1fr;
    }
    
    .intro-text {
        font-size: 1rem;
        padding-left: var(--space-sm);
    }
    
    .cyber-list li {
        padding-left: var(--space-md);
    }
}

@media (max-width: 480px) {
    .legal-content {
        padding: var(--space-md) var(--space-sm);
    }
    
    .document-wrapper {
        padding: var(--space-md);
        margin: var(--space-sm);
    }
    
    .document-title {
        font-size: 1.6rem;
    }
    
    .page-title {
        font-size: 1.3rem;
    }
    
    .logo {
        height: 40px;
    }
    
    .section-content {
        padding: var(--space-md);
    }
    
    .intro-section {
        padding: var(--space-md);
    }
    
    .back-button {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.9rem;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .cyber-grid {
        animation: none;
    }
    
    body::before {
        animation: none;
    }
}

/* Focus styles for keyboard navigation */
.back-button:focus-visible,
.contact-link:focus-visible {
    outline: 2px solid var(--neon-cyan);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --bg-glass: rgba(255, 255, 255, 0.1);
        --border-primary: rgba(255, 255, 255, 0.3);
        --text-muted: #ffffff;
    }
}