/* Legal Pages Styles - Matching Main Site Design */

/* Body background */
body {
    background: linear-gradient(90deg, #DBDFFF 0%, #FFFFFF 100%);
    min-height: 100vh;
}

/* Navigation override for legal pages */
.navbar {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.navbar .back-link {
    font-family: 'DM Serif Text', serif;
    color: #1F2022;
    text-decoration: none;
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.navbar .back-link::before {
    content: '← ';
    font-weight: 300;
}

.navbar .back-link:hover {
    color: var(--primary-purple, #7c3aed);
}

/* Mobile - show only arrow */
@media (max-width: 768px) {
    .navbar .back-link {
        font-size: 0;
        padding: 8px;
    }
    
    .navbar .back-link::before {
        font-size: 24px;
        display: inline-block;
    }
}

.navbar .logo img {
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Legal Container */
.legal-container {
    display: flex;
    max-width: 1200px;
    margin: 85px auto 0; /* 80px navbar + 5px razmak */
    padding: 30px 20px;
    gap: 30px;
    min-height: calc(100vh - 85px);
}

@media (max-width: 1024px) {
    .legal-container {
        flex-direction: column;
        margin-top: 65px; /* 60px navbar + 5px razmak */
    }
}

/* Sidebar */
.legal-sidebar {
    flex: 0 0 280px;
    position: sticky;
    top: 85px; /* 80px navbar + 5px razmak */
    height: fit-content;
    padding: 30px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 1024px) {
    .legal-sidebar {
        position: relative;
        top: 0;
        flex: 1;
    }
}

.legal-sidebar h3 {
    font-family: 'DM Serif Text', serif;
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
    transition: opacity 0.3s ease;
}

.legal-sidebar h4 {
    font-family: 'Noto Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: opacity 0.3s ease;
}

.legal-nav {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}

.legal-nav li {
    margin-bottom: 8px;
}

.legal-nav a {
    display: block;
    padding: 10px 15px;
    color: #666;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    will-change: background-color, color, transform;
    transform: translateZ(0); /* Force GPU acceleration */
}

.legal-nav a:hover {
    background: white;
    color: var(--primary-purple, #7c3aed);
    transform: translateX(2px) translateZ(0);
}

.legal-nav a.active {
    background: var(--primary-purple, #7c3aed);
    color: white;
    transform: translateZ(0);
}

/* Version Info */
.version-info {
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.current-version {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 15px;
}

.version-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #4CAF50;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    width: fit-content;
}

.version-date {
    font-size: 13px;
    color: #666;
}

.version-link {
    display: inline-block;
    color: var(--primary-purple, #7c3aed);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.version-link:hover {
    color: #5b21b6;
    text-decoration: underline;
}

/* Legal Content */
.legal-content {
    flex: 1;
    max-width: 900px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 50px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .legal-content {
        padding: 30px 20px;
    }
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

/* Terms Document Styles */
.terms-document {
    font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.7;
    color: var(--gray-900, #111827);
}

.document-header {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 3px solid var(--primary-purple, #7c3aed);
}

.document-header h1 {
    font-family: 'DM Serif Text', serif;
    font-size: 36px;
    color: #222;
    margin-bottom: 20px;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .document-header h1 {
        font-size: 28px;
    }
}

.document-meta {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #666;
}

.document-meta p {
    margin: 0;
}

.document-meta strong {
    color: #333;
}

/* Intro Section */
.intro {
    background: rgba(248, 249, 250, 0.6);
    backdrop-filter: blur(5px);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 40px;
    border-left: 4px solid var(--primary-purple, #7c3aed);
}

.intro p {
    margin-bottom: 12px;
}

.intro p:last-child {
    margin-bottom: 0;
}

/* Table of Contents */
.table-of-contents {
    background: rgba(255, 248, 245, 0.8);
    backdrop-filter: blur(5px);
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 40px;
    border: 1px solid rgba(126, 58, 237, 0.2);
}

.table-of-contents h2 {
    font-family: 'DM Serif Text', serif;
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

.table-of-contents ol {
    margin: 0;
    padding-left: 25px;
    line-height: 2;
}

.table-of-contents ol li {
    margin-bottom: 8px;
}

.table-of-contents a {
    color: var(--primary-purple, #7c3aed);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.table-of-contents a:hover {
    color: #5b21b6;
    text-decoration: underline;
}

/* Main Sections */
.terms-document section {
    margin-bottom: 35px;
}

.terms-document section:last-child {
    margin-bottom: 0;
}

.terms-document h2 {
    font-family: 'DM Serif Text', serif;
    font-size: 26px;
    color: var(--gray-900, #111827);
    margin-top: 30px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gray-200, #e5e7eb);
}

.terms-document h3 {
    font-family: 'Noto Sans', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-top: 30px;
    margin-bottom: 15px;
}

.terms-document h4 {
    font-family: 'Noto Sans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #444;
    margin-top: 20px;
    margin-bottom: 10px;
}

.terms-document p {
    margin-bottom: 15px;
}

.terms-document ul,
.terms-document ol {
    margin-bottom: 20px;
    padding-left: 30px;
}

.terms-document li {
    margin-bottom: 10px;
}

.terms-document a {
    color: var(--primary-purple, #7c3aed);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.terms-document a:hover {
    color: #5b21b6;
    text-decoration: underline;
}

/* Definitions List */
.definitions-list {
    background: rgba(248, 249, 250, 0.6);
    backdrop-filter: blur(5px);
    padding: 25px;
    border-radius: 8px;
    margin-top: 20px;
}

.definitions-list dt {
    font-weight: 700;
    color: var(--primary-purple, #7c3aed);
    margin-top: 15px;
    margin-bottom: 5px;
    font-size: 16px;
}

.definitions-list dt:first-child {
    margin-top: 0;
}

.definitions-list dd {
    margin-left: 0;
    margin-bottom: 10px;
    color: #555;
}

/* Notice/Alert Boxes */
.notice {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.notice strong {
    color: #856404;
}

/* Contact Box */
.contact-box {
    background: rgba(248, 249, 250, 0.6);
    backdrop-filter: blur(5px);
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
    margin: 20px 0;
}

.contact-box p {
    margin-bottom: 8px;
}

.contact-box p:last-child {
    margin-bottom: 0;
}

.contact-box strong {
    color: #333;
    display: inline-block;
    min-width: 80px;
}

/* Final Notice */
.final-notice {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 12px;
    margin-top: 60px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.final-notice h2 {
    color: white;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.final-notice p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.final-notice a {
    color: #ffd700;
}

.signature {
    margin-top: 30px;
    font-style: italic;
    text-align: right;
    font-size: 16px;
}

/* Version History */
.version-history {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 3px solid #f0f0f0;
}

.version-history h2 {
    font-family: 'DM Serif Text', serif;
    font-size: 28px;
    margin-bottom: 30px;
}

.versions-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.version-item {
    background: rgba(248, 249, 250, 0.8);
    backdrop-filter: blur(5px);
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #ddd;
    transition: all 0.3s ease;
}

.version-item.active {
    border-left-color: #4CAF50;
    background: rgba(241, 248, 244, 0.9);
}

.version-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.version-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.version-number {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.status-badge {
    padding: 4px 12px;
    background: #4CAF50;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.version-details p {
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
}

.version-details p:last-child {
    margin-bottom: 0;
}

.version-details strong {
    color: #333;
}

.version-details a {
    display: inline-block;
    margin-top: 10px;
    color: var(--primary-purple, #7c3aed);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.version-details a:hover {
    color: #5b21b6;
    text-decoration: underline;
}

/* Legal Footer */
.legal-footer {
    background: rgba(31, 32, 34, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 30px 20px;
    margin-top: 0;
}

.legal-footer .container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

@media (max-width: 768px) {
    .legal-footer .container {
        flex-direction: column;
        text-align: center;
    }
}

.legal-footer p {
    margin: 0;
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .footer-links {
        justify-content: center;
    }
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-purple, #7c3aed);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

/* Print styles */
@media print {
    .navbar,
    .legal-sidebar,
    .legal-footer,
    .version-link {
        display: none;
    }
    
    .legal-container {
        display: block;
        margin: 0;
        padding: 0;
    }
    
    .legal-content {
        box-shadow: none;
        padding: 20px;
    }
    
    .terms-document a {
        color: #333;
        text-decoration: underline;
    }
    
    .final-notice {
        background: #f0f0f0;
        color: #333;
    }
    
    .final-notice h2 {
        color: #333;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .terms-document {
        color: #000;
    }
    
    .legal-nav a.active {
        outline: 2px solid #000;
    }
}

