/* Terms Page - Modern Redesign */

:root {
    --primary-blue: #3b82f6;
    --primary-blue-dark: #2563eb;
    --primary-blue-light: #60a5fa;
    --secondary-blue: #1e40af;
    --background-dark: #0a0f1a;
    --background-darker: #060912;
    --background-white: #ffffff;
    --background-gray: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-light: #e2e8f0;
    --border-light: #e2e8f0;
    --success-green: #10b981;
    --warning-amber: #f59e0b;
    --error-red: #ef4444;
    --gradient-start: #3b82f6;
    --gradient-end: #8b5cf6;
    
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-white);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
}

.brand-icon {
    font-size: 1.5rem;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-blue);
}

.nav-cta {
    background: var(--primary-blue);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-cta:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-1px);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 4px;
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
}

.mobile-nav.active {
    display: block;
}

.mobile-nav-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

.mobile-nav-cta {
    background: var(--primary-blue);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    font-weight: 500;
}

main {
    margin-top: 70px;
}

/* Hero Section */
.hero {
    min-height: 60vh;
    background: linear-gradient(135deg, var(--background-dark) 0%, var(--background-darker) 100%);
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 4rem 0;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.cyber-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.floating-orbs {
    position: absolute;
    width: 100%;
    height: 100%;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    animation: float 6s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-blue);
    top: 10%;
    right: 10%;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: var(--gradient-end);
    bottom: 20%;
    left: 5%;
    animation-delay: -2s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: var(--primary-blue-light);
    top: 50%;
    left: 50%;
    animation-delay: -4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.05); }
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-blue), transparent);
    animation: scan 4s linear infinite;
}

@keyframes scan {
    0% { top: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-text {
    color: white;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    color: var(--primary-blue-light);
    margin-bottom: 1.5rem;
}

.badge-pulse {
    width: 8px;
    height: 8px;
    background: var(--success-green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.title-line {
    display: block;
}

.gradient-text {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero-highlights {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.highlight-icon {
    font-size: 1.25rem;
}

.highlight-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-light);
}

.hero-visual {
    display: flex;
    justify-content: center;
}

.document-preview {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    width: 100%;
    max-width: 350px;
    backdrop-filter: blur(10px);
}

.doc-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 600;
}

.doc-icon {
    font-size: 1.5rem;
}

.doc-meta {
    padding: 1rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.doc-sections {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.doc-section {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--primary-blue-light);
    font-size: 0.875rem;
}

/* Quick Navigation Section */
.quick-nav-section {
    padding: 4rem 0;
    background: var(--background-gray);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.quick-nav-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

.quick-nav-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    background: white;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.quick-nav-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.nav-icon {
    font-size: 2rem;
}

.nav-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

/* Terms Content Section */
.terms-content {
    padding: 4rem 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
}

/* Sidebar TOC */
.terms-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.toc-card {
    background: var(--background-gray);
    border-radius: 16px;
    padding: 1.5rem;
}

.toc-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.toc-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.toc-link:hover {
    background: white;
    color: var(--primary-blue);
}

.toc-link.active {
    background: white;
    color: var(--primary-blue);
    border-left-color: var(--primary-blue);
    font-weight: 500;
}

/* Main Terms Content */
.terms-main {
    max-width: 800px;
}

.terms-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
}

.terms-section:last-child {
    border-bottom: none;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-number {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.terms-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.highlight-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: var(--text-primary);
}

.terms-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.terms-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.terms-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-green);
    font-weight: 700;
}

.terms-list.prohibited li::before {
    content: '✗';
    color: var(--error-red);
}

.legal-notice {
    background: var(--background-gray);
    border-left: 4px solid var(--warning-amber);
    padding: 1.5rem;
    border-radius: 0 12px 12px 0;
}

.legal-notice p {
    font-size: 0.875rem;
    margin: 0;
    color: var(--text-secondary);
}

.jurisdiction-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.info-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem;
    background: var(--background-gray);
    border-radius: 12px;
}

.info-icon {
    font-size: 1.5rem;
}

.info-item strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.info-item p {
    margin: 0;
    font-size: 0.875rem;
}

.attribution-list {
    background: var(--background-gray);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1rem;
}

.attribution-list ul {
    margin: 0.5rem 0 0 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.attribution-list li {
    margin-bottom: 0.5rem;
}

.contact-card {
    background: var(--background-gray);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1rem;
}

.contact-email {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 1rem;
}

.contact-email:hover {
    text-decoration: underline;
}

.contact-address {
    font-style: normal;
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.8;
}

/* CTA Section */
.cta-section {
    padding: 4rem 0;
    background: var(--background-gray);
}

.cta-card {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    padding: 3rem;
    border-radius: 24px;
    text-align: center;
}

.cta-content h2 {
    font-size: 2rem;
    color: white;
    margin-bottom: 1rem;
}

.cta-content p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.cta-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: var(--primary-blue);
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* Footer */
.footer {
    background: #0f172a;
    color: white;
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand {
    max-width: 350px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.footer-logo .brand-icon {
    font-size: 2rem;
}

.footer-logo h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.footer-brand p {
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.footer-contact {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-contact p {
    margin-bottom: 0.5rem;
    color: #e2e8f0;
}

.footer-contact a {
    color: var(--primary-blue-light);
    text-decoration: none;
    font-weight: 600;
}

.footer-section h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-blue-light);
}

.certifications {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.certifications p {
    color: #94a3b8;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.footer-certs {
    display: flex;
    gap: 0.5rem;
}

.cert-badge {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-copyright p {
    color: #94a3b8;
    margin-bottom: 0.25rem;
}

.footer-tagline {
    font-style: italic;
    opacity: 0.7;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social a {
    color: #94a3b8;
    transition: color 0.3s ease;
}

.footer-social a:hover {
    color: var(--primary-blue-light);
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .hero-highlights {
        justify-content: center;
    }
    
    .document-preview {
        margin: 0 auto;
    }
    
    .quick-nav-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .terms-sidebar {
        position: static;
    }
    
    .toc-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .toc-link {
        border-left: none;
        border-bottom: 2px solid transparent;
    }
    
    .toc-link.active {
        border-left-color: transparent;
        border-bottom-color: var(--primary-blue);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .quick-nav-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .jurisdiction-info {
        grid-template-columns: 1fr;
    }
    
    .cta-card {
        padding: 2rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .quick-nav-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .quick-nav-card {
        padding: 1rem;
    }
    
    .nav-icon {
        font-size: 1.5rem;
    }
}

/* =========================================
   iOS & Android Mobile Optimizations
   ========================================= */

/* Safe Area Support for notched devices */
@supports (padding: max(0px)) {
    .navbar {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-top: max(0.5rem, env(safe-area-inset-top));
    }
    
    .footer {
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }
    
    .mobile-nav {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

/* Touch-friendly targets (min 44px for iOS HIG, 48dp for Android) */
@media (pointer: coarse) {
    .nav-link,
    .mobile-nav-link {
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    .nav-toggle {
        min-width: 48px;
        min-height: 48px;
    }
    
    .btn-primary,
    .btn-secondary,
    .nav-cta,
    .mobile-nav-cta {
        min-height: 48px;
        padding: 0.875rem 1.75rem;
    }
    
    .footer-links a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .quick-nav-card {
        min-height: 80px;
    }
    
    .terms-section {
        padding: 1.75rem;
    }
}

/* Prevent iOS zoom on input focus */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    input, textarea, select {
        font-size: 16px !important;
    }
}

/* iOS momentum scrolling */
.mobile-nav,
.terms-content {
    -webkit-overflow-scrolling: touch;
}

/* Prevent text selection highlight on touch */
.nav-toggle,
.btn-primary,
.btn-secondary,
.nav-cta,
.quick-nav-card {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

/* iOS Safari viewport height fix */
@supports (-webkit-touch-callout: none) {
    .hero {
        min-height: -webkit-fill-available;
    }
}

/* Android Chrome address bar handling */
@media screen and (max-width: 768px) {
    .hero {
        min-height: calc(100vh - 56px);
    }
}

/* Smooth scrolling for all platforms */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

/* Better font rendering on mobile */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Prevent horizontal overflow */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Active states for mobile touch feedback */
@media (hover: none) {
    .btn-primary:active,
    .btn-secondary:active,
    .nav-cta:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    .quick-nav-card:active,
    .terms-section:active {
        transform: scale(0.99);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: rgba(255, 255, 255, 0.5);
    }
    
    .btn-primary,
    .btn-secondary {
        border: 2px solid currentColor;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .cyber-grid,
    .floating-orbs,
    .scan-line {
        display: none;
    }
}
