/* Terms of Service Styles - Matrix Portal */
/* CSP Compliant - NO INLINE STYLES */

/* =========================================
   MAIN CONTENT CONTAINER
   ========================================= */
.terms-content {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(0, 20, 0, 0.9);
    border: 2px solid #00ff41;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
    animation: fadeIn 0.5s ease-in;
}

/* =========================================
   READING PROGRESS BAR
   Replaces JS style.cssText injection
   ========================================= */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--progress-width, 0%);
    height: 3px;
    background: linear-gradient(to right, #00ff41, #00aa2b);
    z-index: 9999;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
    pointer-events: none;
}

/* =========================================
   LAST UPDATED BANNER
   ========================================= */
.last-updated {
    background: rgba(0, 255, 65, 0.1);
    border-left: 4px solid #00ff41;
    padding: 1rem;
    margin-bottom: 2rem;
    border-radius: 4px;
}

.last-updated p {
    margin: 0;
    color: #00ff41;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* =========================================
   SECTION STYLING
   ========================================= */
.terms-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(0, 255, 65, 0.2);
}

.terms-section:last-of-type {
    border-bottom: none;
    margin-bottom: 2rem;
}

/* =========================================
   HEADINGS
   ========================================= */
.terms-content h2 {
    color: #00ff41;
    font-family: 'Courier New', monospace;
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
    border-bottom: 2px solid #00ff41;
    padding-bottom: 0.5rem;
}

.terms-content h3 {
    color: #00ff41;
    font-family: 'Courier New', monospace;
    font-size: 1.3rem;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.4);
}

/* Linkable heading - replaces JS heading.style.cursor */
.section-heading--linkable {
    cursor: pointer;
    transition: text-shadow 0.2s ease;
}

.section-heading--linkable:hover {
    text-shadow: 0 0 18px rgba(0, 255, 65, 0.9);
}

/* =========================================
   PARAGRAPHS AND TEXT
   ========================================= */
.terms-content p {
    color: #d0d0d0;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* =========================================
   LISTS
   ========================================= */
.terms-content ul {
    list-style: none;
    padding-left: 0;
    margin: 1rem 0 1.5rem 1rem;
}

.terms-content ul li {
    color: #d0d0d0;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 0.8rem;
    padding-left: 2rem;
    position: relative;
}

.terms-content ul li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: #00ff41;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.5);
}

.terms-content ul li strong {
    color: #00ff41;
}

/* =========================================
   CONTACT INFO BOX
   ========================================= */
.contact-info {
    background: rgba(0, 255, 65, 0.05);
    border: 1px solid #00ff41;
    border-radius: 4px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.contact-info p {
    margin: 0 0 0.5rem;
    color: #d0d0d0;
    line-height: 1.8;
}

.contact-info a {
    color: #00ff41;
    text-decoration: none;
    transition: all 0.3s ease;
}

.contact-info a:hover {
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.8);
    text-decoration: underline;
}

/* =========================================
   LINKS
   ========================================= */
.terms-content a {
    color: #00ff41;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.terms-content a:hover {
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.8);
    border-bottom-color: #00ff41;
}

/* =========================================
   BACK TO TOP
   Replaces JS style.opacity/visibility
   ========================================= */
.back-to-top {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(0, 255, 65, 0.3);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.back-to-top--hidden {
    opacity: 0;
    visibility: hidden;
}

.back-to-top--visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top a {
    display: inline-block;
    color: #00ff41;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    text-decoration: none;
    padding: 0.8rem 2rem;
    border: 2px solid #00ff41;
    border-radius: 4px;
    transition: all 0.3s ease;
    background: rgba(0, 255, 65, 0.05);
}

.back-to-top a:hover {
    background: rgba(0, 255, 65, 0.15);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.5);
    transform: translateY(-2px);
}

/* =========================================
   STRONG TEXT
   ========================================= */
.terms-content strong {
    color: #00ff41;
    font-weight: bold;
}

/* =========================================
   ACKNOWLEDGMENT SECTION
   ========================================= */
.acknowledgment-emphasis {
    text-align: center;
    font-size: 1.1rem;
    color: #00ff41;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.6);
    margin-top: 2rem;
    padding: 1rem;
    border: 1px solid #00ff41;
    border-radius: 4px;
    background: rgba(0, 255, 65, 0.05);
}

/* =========================================
   NOTIFICATION TOAST
   Replaces JS style.cssText injection in showNotification()
   ========================================= */
.terms-notification {
    position: fixed;
    bottom: 80px;
    right: 20px;
    padding: 12px 24px;
    background: rgba(0, 255, 65, 0.92);
    color: #001400;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    border-radius: 4px;
    z-index: 10000;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
    pointer-events: none;
    /* Hidden by default */
    opacity: 0;
    transform: translateX(120%);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.terms-notification--visible {
    opacity: 1;
    transform: translateX(0);
}

.terms-notification--exit {
    opacity: 0;
    transform: translateX(120%);
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */
@media (max-width: 768px) {
    .terms-content {
        padding: 1.5rem;
        margin: 1rem;
    }

    .terms-content h2 {
        font-size: 1.4rem;
    }

    .terms-content h3 {
        font-size: 1.1rem;
    }

    .terms-content p,
    .terms-content ul li {
        font-size: 0.9rem;
    }

    .terms-content ul {
        margin-left: 0.5rem;
    }

    .terms-content ul li {
        padding-left: 1.5rem;
    }

    .acknowledgment-emphasis {
        font-size: 1rem;
        padding: 0.8rem;
    }

    .terms-notification {
        bottom: 60px;
        right: 10px;
        left: 10px;
        right: 10px;
        transform: translateY(120%);
    }

    .terms-notification--visible {
        transform: translateY(0);
    }

    .terms-notification--exit {
        transform: translateY(120%);
    }
}

@media (max-width: 480px) {
    .terms-content {
        padding: 1rem;
        margin: 0.5rem;
    }

    .terms-content h2 {
        font-size: 1.2rem;
    }

    .terms-content h3 {
        font-size: 1rem;
    }

    .terms-content p,
    .terms-content ul li {
        font-size: 0.85rem;
        line-height: 1.6;
    }

    .last-updated {
        padding: 0.8rem;
    }

    .contact-info {
        padding: 1rem;
    }

    .acknowledgment-emphasis {
        font-size: 0.9rem;
        padding: 0.6rem;
    }
}

/* =========================================
   PRINT STYLES
   ========================================= */
@media print {
    .reading-progress,
    canvas#matrix,
    #matrix-controls,
    .back-to-top {
        display: none !important;
    }

    .terms-content {
        background: white;
        color: black;
        border: none;
        box-shadow: none;
    }

    .terms-content h2,
    .terms-content h3,
    .terms-content a,
    .terms-content strong,
    .terms-content ul li::before,
    .acknowledgment-emphasis {
        color: black !important;
        text-shadow: none !important;
    }

    .last-updated,
    .acknowledgment-emphasis {
        background: #f0f0f0;
        border-left-color: black;
    }
}

/* =========================================
   ACCESSIBILITY
   ========================================= */
.terms-content :focus {
    outline: 2px solid #00ff41;
    outline-offset: 2px;
}

@media (prefers-contrast: high) {
    .terms-content {
        border-width: 3px;
    }

    .terms-content h2 {
        border-bottom-width: 3px;
    }

    .terms-content a {
        border-bottom-width: 2px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .terms-content,
    .back-to-top a,
    .reading-progress,
    .terms-notification {
        animation: none;
        transition: none;
    }
}