/* ===== TETHER SPACE THEME ===== */
/* Unique identity: Connected network in space */

/* ===== CSS VARIABLES ===== */
:root {
    /* Tether Colors - Purple + Gold */
    --space-black: #0a0a0f;
    --deep-space: #0d0d1a;
    --nebula-purple: #6b21a8;
    --tether-purple: #9333ea;
    --tether-gold: #f59e0b;
    --tether-gold-light: #fbbf24;
    --violet: #8b5cf6;
    --star-white: #f8fafc;
    --muted-gray: #94a3b8;

    /* Tether Gradients */
    --gradient-primary: linear-gradient(135deg, var(--tether-purple) 0%, var(--nebula-purple) 100%);
    --gradient-glow: linear-gradient(135deg, var(--tether-purple) 0%, var(--violet) 50%, var(--tether-gold) 100%);
    --gradient-accent: linear-gradient(135deg, var(--tether-gold) 0%, var(--tether-gold-light) 100%);
    --gradient-card: linear-gradient(145deg, rgba(147, 51, 234, 0.1), rgba(107, 33, 168, 0.1));
    --text-gradient: linear-gradient(90deg, var(--violet), var(--tether-gold), var(--violet));

    /* Legacy compatibility */
    --cosmic-blue: var(--tether-purple);
    --electric-blue: var(--violet);

    /* Focus color */
    --focus-color: var(--tether-gold);

    /* Theme-specific variables (dark mode default) */
    --bg-primary: #0a0a0f;
    --bg-secondary: #0d0d1a;
    --bg-card: rgba(13, 13, 26, 0.8);
    --bg-card-hover: rgba(13, 13, 26, 0.9);
    --bg-input: rgba(10, 10, 15, 0.8);
    --bg-nav: rgba(10, 10, 15, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: rgba(139, 92, 246, 0.2);
    --border-hover: rgba(245, 158, 11, 0.4);
    --shadow-card: 0 20px 40px rgba(147, 51, 234, 0.2), 0 0 20px rgba(245, 158, 11, 0.1);
}

/* ===== LIGHT MODE ===== */
[data-theme="light"] {
    --space-black: #f8fafc;
    --deep-space: #f1f5f9;
    --star-white: #0f172a;
    --muted-gray: #64748b;

    /* Light mode theme variables */
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-input: rgba(255, 255, 255, 0.9);
    --bg-nav: rgba(255, 255, 255, 0.85);
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: rgba(147, 51, 234, 0.15);
    --border-hover: rgba(147, 51, 234, 0.4);
    --shadow-card: 0 20px 40px rgba(147, 51, 234, 0.1), 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Background is now handled by JavaScript SVG in layouts */

/* ===== SPACE THEME BASE ===== */
.space-theme {
    background-color: var(--space-black);
    color: var(--star-white);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ===== GLASSMORPHISM CARDS ===== */
.glass-card {
    background: rgba(13, 13, 26, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 20px 40px rgba(147, 51, 234, 0.2), 0 0 20px rgba(245, 158, 11, 0.1);
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-glow);
    transform: scaleX(0);
    transition: transform 0.4s ease;
    border-radius: 20px 20px 0 0;
}

.glass-card:hover::before {
    transform: scaleX(1);
}

/* ===== GRADIENT BUTTONS ===== */
.btn-space {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-space-primary {
    background: var(--gradient-glow);
    color: white;
    box-shadow: 0 4px 20px rgba(147, 51, 234, 0.4);
}

.btn-space-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.5), 0 4px 15px rgba(147, 51, 234, 0.4);
    color: white;
}

.btn-space-secondary {
    background: transparent;
    color: var(--star-white);
    border: 2px solid rgba(139, 92, 246, 0.5);
}

.btn-space-secondary:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--nebula-purple);
    transform: translateY(-3px);
    color: white;
}

/* ===== ORBIT RINGS ===== */
.orbit-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
}

.orbit-ring {
    position: absolute;
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 50%;
    animation: orbit-rotate 20s linear infinite;
}

.orbit-ring-1 {
    width: 400px;
    height: 400px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.orbit-ring-2 {
    width: 600px;
    height: 600px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 30s;
    animation-direction: reverse;
}

.orbit-ring-3 {
    width: 800px;
    height: 800px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 40s;
}

@keyframes orbit-rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.orbit-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--electric-blue);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--electric-blue);
}

/* ===== SPACE FORM STYLES ===== */
.space-form .form-control {
    background: rgba(10, 10, 15, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    color: var(--star-white);
    padding: 0.875rem 1rem;
    transition: all 0.3s ease;
}

.space-form .form-control:focus {
    outline: none;
    border-color: var(--electric-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: rgba(10, 10, 15, 0.9);
}

.space-form .form-control::placeholder {
    color: var(--muted-gray);
}

.space-form .form-label {
    color: var(--star-white);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* ===== SPACE NAVIGATION ===== */
.space-nav {
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    padding: 1rem 0;
    position: relative;
    z-index: 100;
}

.space-nav-link {
    color: var(--muted-gray);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
}

.space-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gradient-glow);
    transition: width 0.3s ease;
}

.space-nav-link:hover {
    color: var(--star-white);
}

.space-nav-link:hover::after {
    width: 80%;
}

/* ===== SPACE HERO ===== */
.space-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 100px 20px;
    z-index: 1;
}

.space-hero-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    color: var(--star-white);
}

.space-hero-title .gradient-text {
    background: var(--gradient-glow);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.space-hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: var(--muted-gray);
    margin-bottom: 2.5rem;
    max-width: 700px;
    line-height: 1.6;
}

/* ===== GLOW EFFECTS ===== */
.glow-text {
    text-shadow: 0 0 20px rgba(245, 158, 11, 0.4), 0 0 40px rgba(147, 51, 234, 0.3);
}

.glow-border {
    box-shadow: 0 0 20px rgba(147, 51, 234, 0.3),
                0 0 40px rgba(245, 158, 11, 0.15);
}

/* Gold accent glow */
.glow-gold {
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4),
                0 0 30px rgba(245, 158, 11, 0.2);
}

/* ===== GRADIENT TEXT ===== */
.text-gradient {
    background: var(--gradient-glow);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===== SPACE SECTION STYLES ===== */
.space-section {
    padding: 80px 0;
    position: relative;
    z-index: 1;
}

.space-section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--star-white);
}

.space-section-subtitle {
    color: var(--muted-gray);
    text-align: center;
    max-width: 600px;
    margin: 0 auto 3rem;
    font-size: 1.1rem;
}

/* ===== FEATURE CARDS ===== */
.space-feature-card {
    background: rgba(13, 13, 26, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.space-feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-glow);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.space-feature-card:hover {
    transform: translateY(-10px);
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 20px 40px rgba(147, 51, 234, 0.2), 0 0 25px rgba(245, 158, 11, 0.15);
}

.space-feature-card:hover::before {
    transform: scaleX(1);
}

.space-feature-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: white;
}

.space-feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--star-white);
}

.space-feature-text {
    color: var(--muted-gray);
    line-height: 1.7;
}

/* ===== PRICING CARDS ===== */
.space-pricing-card {
    background: rgba(13, 13, 26, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.4s ease;
    position: relative;
}

.space-pricing-card.featured {
    border-color: var(--violet);
    transform: scale(1.05);
}

.space-pricing-card.featured::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 22px;
    background: var(--gradient-glow);
    z-index: -1;
    opacity: 0.5;
}

.space-pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-glow);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.space-pricing-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--star-white);
    margin-bottom: 0.5rem;
}

.space-pricing-price {
    font-size: 3rem;
    font-weight: 800;
    color: var(--star-white);
    margin-bottom: 0.5rem;
}

.space-pricing-price span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--muted-gray);
}

/* ===== FOOTER ===== */
.space-footer {
    background: rgba(10, 10, 15, 0.95);
    border-top: 1px solid rgba(139, 92, 246, 0.2);
    padding: 2rem 0;
    position: relative;
    z-index: 1;
}

.space-footer a {
    color: var(--muted-gray);
    text-decoration: none;
    transition: color 0.3s ease;
}

.space-footer a:hover {
    color: var(--electric-blue);
}

/* ===== TETHER LOGO ANIMATION ===== */
/* Unique "connection pulse" effect - lines pulse outward like a signal */
.tether-logo {
    filter: drop-shadow(0 0 6px rgba(0, 74, 173, 0.5));
    transition: all 0.3s ease;
}

.tether-logo:hover {
    filter: drop-shadow(0 0 12px rgba(203, 106, 227, 0.7));
}

.tether-lines line {
    stroke-dasharray: 50;
    stroke-dashoffset: 0;
    transform-origin: 50px 50px;
}

/* Primary lines - staggered pulse animation */
.tether-lines line:nth-child(1) { animation: tether-pulse-line 2.5s ease-in-out infinite 0s; }
.tether-lines line:nth-child(2) { animation: tether-pulse-line 2.5s ease-in-out infinite 0.2s; }
.tether-lines line:nth-child(3) { animation: tether-pulse-line 2.5s ease-in-out infinite 0.4s; }
.tether-lines line:nth-child(4) { animation: tether-pulse-line 2.5s ease-in-out infinite 0.6s; }
.tether-lines line:nth-child(5) { animation: tether-pulse-line 2.5s ease-in-out infinite 0.8s; }
.tether-lines line:nth-child(6) { animation: tether-pulse-line 2.5s ease-in-out infinite 1.0s; }

/* Secondary lines - different timing for depth */
.tether-lines line:nth-child(7) { animation: tether-connect 3s ease-in-out infinite 0.1s; }
.tether-lines line:nth-child(8) { animation: tether-connect 3s ease-in-out infinite 0.3s; }
.tether-lines line:nth-child(9) { animation: tether-connect 3s ease-in-out infinite 0.5s; }
.tether-lines line:nth-child(10) { animation: tether-connect 3s ease-in-out infinite 0.7s; }
.tether-lines line:nth-child(11) { animation: tether-connect 3s ease-in-out infinite 0.9s; }
.tether-lines line:nth-child(12) { animation: tether-connect 3s ease-in-out infinite 1.1s; }

/* Main pulse - extends outward like establishing a connection */
@keyframes tether-pulse-line {
    0%, 100% {
        opacity: 0.85;
        stroke-width: 2.5;
        filter: drop-shadow(0 0 2px rgba(0, 74, 173, 0.3));
    }
    50% {
        opacity: 1;
        stroke-width: 3;
        filter: drop-shadow(0 0 6px rgba(203, 106, 227, 0.6));
    }
}

/* Connection animation - like data flowing through tethers */
@keyframes tether-connect {
    0%, 100% {
        stroke-dashoffset: 0;
        opacity: 0.5;
    }
    25% {
        stroke-dashoffset: -15;
        opacity: 0.9;
    }
    50% {
        stroke-dashoffset: 0;
        opacity: 0.7;
    }
    75% {
        stroke-dashoffset: 15;
        opacity: 0.9;
    }
}

/* ===== FLOAT ANIMATION ===== */
.float-animation {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* ===== FADE IN ANIMATION ===== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .glass-card {
        padding: 1.5rem;
    }

    .space-hero {
        padding: 80px 20px;
    }

    .orbit-ring {
        display: none;
    }

    .btn-space {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .starfield,
    .stars,
    .nebula,
    .orbit-ring,
    .fade-in {
        animation: none !important;
    }

    .fade-in {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ===== SCROLLBAR ===== */
.space-theme::-webkit-scrollbar {
    width: 10px;
}

.space-theme::-webkit-scrollbar-track {
    background: var(--space-black);
}

.space-theme::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--cosmic-blue), var(--nebula-purple));
    border-radius: 5px;
}

.space-theme::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--electric-blue), #a855f7);
}

/* ===== THEME TOGGLE BUTTON ===== */
.theme-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: var(--tether-purple);
    box-shadow: 0 4px 20px rgba(147, 51, 234, 0.3);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    position: absolute;
    transition: all 0.3s ease;
}

/* Dark mode: show sun icon */
[data-theme="dark"] .theme-toggle .icon-sun {
    opacity: 1;
    transform: rotate(0deg);
}

[data-theme="dark"] .theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(-90deg);
}

/* Light mode: show moon icon */
[data-theme="light"] .theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(90deg);
}

[data-theme="light"] .theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0deg);
}

/* ===== LIGHT MODE COMPONENT OVERRIDES ===== */
[data-theme="light"] .space-theme {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="light"] .glass-card {
    background: var(--bg-card);
    border-color: var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .glass-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card);
}

[data-theme="light"] .space-nav {
    background: var(--bg-nav);
    border-bottom-color: var(--border-color);
}

[data-theme="light"] .space-form .form-control {
    background: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="light"] .space-form .form-control:focus {
    background: #fff;
    border-color: var(--tether-purple);
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.15);
}

[data-theme="light"] .space-form .form-control::placeholder {
    color: var(--text-secondary);
}

[data-theme="light"] .space-form .form-label {
    color: var(--text-primary);
}

[data-theme="light"] .space-feature-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="light"] .space-feature-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card);
}

[data-theme="light"] .space-feature-title {
    color: var(--text-primary);
}

[data-theme="light"] .space-feature-text {
    color: var(--text-secondary);
}

[data-theme="light"] .space-pricing-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="light"] .space-pricing-name,
[data-theme="light"] .space-pricing-price {
    color: var(--text-primary);
}

[data-theme="light"] .space-footer {
    background: var(--bg-secondary);
    border-top-color: var(--border-color);
}

[data-theme="light"] .space-hero-title {
    color: var(--text-primary);
}

[data-theme="light"] .space-hero-subtitle {
    color: var(--text-secondary);
}

[data-theme="light"] .space-section-title {
    color: var(--text-primary);
}

[data-theme="light"] .space-section-subtitle {
    color: var(--text-secondary);
}

[data-theme="light"] .btn-space-secondary {
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="light"] .btn-space-secondary:hover {
    background: rgba(147, 51, 234, 0.1);
    color: var(--tether-purple);
}

[data-theme="light"] .space-nav-link {
    color: var(--text-secondary);
}

[data-theme="light"] .space-nav-link:hover {
    color: var(--text-primary);
}

/* Light mode scrollbar */
[data-theme="light"] .space-theme::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

[data-theme="light"] .space-theme::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--tether-purple), var(--violet));
}

/* Light mode network background adjustment */
[data-theme="light"] .tether-network-bg {
    background: radial-gradient(ellipse at 30% 20%, rgba(147, 51, 234, 0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(245, 158, 11, 0.04) 0%, transparent 50%);
}
