/**
 * Theme Toggle and Advanced Animation Styles
 * For Vigthoria Landing Page
 */

/* Theme Variables */
:root {
    /* Dark Theme (Default) */
    --primary-color: #6c63ff;
    --secondary-color: #00bfa6;
    --text-color: #e4e6eb;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --bg-primary: #1e293b;
    --bg-secondary: #0f172a;
    --card-bg: rgba(15, 23, 42, 0.6);
    --header-bg: rgba(15, 23, 42, 0.9); /* Increased opacity for better readability */
    --border-color: rgba(108, 99, 255, 0.2);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --theme-transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    --glow-color: rgba(108, 99, 255, 0.6);
    --hover-color: #5a52d5;
    --muted-text: #94a3b8;
    --footer-bg: #0f172a;
    --solar-bg: #0d1321;
    --stats-bg: rgba(15, 23, 42, 0.8);
    --cube-border: rgba(108, 99, 255, 0.5);
    --cube-bg: rgba(30, 41, 59, 0.9);
    --tooltip-bg: rgba(15, 23, 42, 0.9);
    --gradient-main: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --contrast-text: #ffffff; /* High contrast text for buttons and important elements */
}

/* Light Theme Variables */
[data-theme="light"] {
    --primary-color: #6366f1;
    --secondary-color: #0ea5e9;
    --text-color: #0f172a;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --card-bg: rgba(255, 255, 255, 0.9);
    --header-bg: rgba(255, 255, 255, 0.95); /* Increased opacity for better readability */
    --border-color: rgba(99, 102, 241, 0.3);
    --shadow-color: rgba(0, 0, 0, 0.05);
    --glow-color: rgba(99, 102, 241, 0.4);
    --hover-color: #4f46e5;
    --muted-text: #64748b;
    --footer-bg: #f1f5f9;
    --solar-bg: #f8fafc;
    --stats-bg: rgba(255, 255, 255, 0.8);
    --cube-border: rgba(99, 102, 241, 0.5);
    --cube-bg: rgba(248, 250, 252, 0.9);
    --tooltip-bg: rgba(255, 255, 255, 0.95);
    --gradient-main: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --contrast-text: #ffffff; /* High contrast text for buttons and important elements */
}

/**
 * Modern Theme Toggle with Elegant Design
 * Complete redesign for Vigthoria Landing Page
 */

/* Toggle container */
.theme-toggle {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(25, 34, 49, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(108, 99, 255, 0.3);
    cursor: pointer;
    /* Removing white toggle point */
    appearance: none;
    -webkit-appearance: none;
}

/* Light theme version of toggle container */
[data-theme="light"] .theme-toggle {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(108, 99, 255, 0.2);
    /* Removing white toggle point */
    appearance: none;
    -webkit-appearance: none;
}

/* Button styling */
.theme-toggle button {
    width: 100%;
    height: 100%;
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
}

/* Button focus state */
.theme-toggle button:focus {
    outline: none;
}

/* Mode icons - shared styles */
.theme-toggle .mode-icon {
    position: absolute;
    width: 24px;
    height: 24px;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Sun icon (light mode) */
.theme-toggle .light-icon {
    opacity: 0;
    transform: scale(0.5) rotate(-45deg);
    color: #ff9500;
}

/* Moon icon (dark mode) */
.theme-toggle .dark-icon {
    opacity: 1;
    transform: scale(1) rotate(0);
    color: #6c63ff;
}

/* Icon state in light mode */
[data-theme="light"] .theme-toggle .light-icon {
    opacity: 1;
    transform: scale(1) rotate(0);
}

[data-theme="light"] .theme-toggle .dark-icon {
    opacity: 0;
    transform: scale(0.5) rotate(45deg);
}

/* Visual decorative elements */
.theme-toggle .toggle-decoration {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

/* Stars - visible in dark mode */
.theme-toggle .stars {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.theme-toggle .star {
    position: absolute;
    background-color: #ffffff;
    border-radius: 50%;
    animation: twinkle 3s infinite alternate;
}

.theme-toggle .star:nth-child(1) {
    width: 2px;
    height: 2px;
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.theme-toggle .star:nth-child(2) {
    width: 3px;
    height: 3px;
    top: 30%;
    left: 70%;
    animation-delay: 0.5s;
}

.theme-toggle .star:nth-child(3) {
    width: 2px;
    height: 2px;
    top: 70%;
    left: 30%;
    animation-delay: 1s;
}

.theme-toggle .star:nth-child(4) {
    width: 1px;
    height: 1px;
    top: 60%;
    left: 60%;
    animation-delay: 1.5s;
}

[data-theme="light"] .theme-toggle .stars {
    opacity: 0;
}

/* Clouds - visible in light mode */
.theme-toggle .clouds {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.theme-toggle .cloud {
    position: absolute;
    background-color: #ffffff;
    border-radius: 50%;
}

.theme-toggle .cloud:nth-child(1) {
    width: 12px;
    height: 6px;
    top: 20%;
    left: 25%;
    border-radius: 6px;
}

.theme-toggle .cloud:nth-child(2) {
    width: 16px;
    height: 8px;
    top: 60%;
    left: 55%;
    border-radius: 8px;
}

[data-theme="light"] .theme-toggle .clouds {
    opacity: 1;
}

/* Glow effect */
.theme-toggle::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(108, 99, 255, 0.3) 0%, rgba(108, 99, 255, 0) 70%);
    pointer-events: none;
    z-index: -1;
    opacity: 0.8;
    transition: all 0.4s ease;
}

[data-theme="light"] .theme-toggle::after {
    background: radial-gradient(circle, rgba(255, 149, 0, 0.3) 0%, rgba(255, 149, 0, 0) 70%);
}

/* Hover effects */
.theme-toggle:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .theme-toggle:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.theme-toggle:hover::after {
    opacity: 1;
}

/* Active/press effect */
.theme-toggle:active {
    transform: translateY(-2px);
    box-shadow: 0 7px 15px rgba(0, 0, 0, 0.3);
}

/* Twinkle animation for stars */
@keyframes twinkle {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Tooltip styling */
.theme-toggle .tooltip {
    position: absolute;
    bottom: 75px;
    right: 0;
    background: rgba(25, 34, 49, 0.9);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

[data-theme="light"] .theme-toggle .tooltip {
    background: rgba(255, 255, 255, 0.9);
    color: #0f172a;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover .tooltip {
    opacity: 1;
    transform: translateY(0);
}

/* Umstrukturierung der Nav-Buttons */
.nav-buttons {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.nav-buttons > * {
    order: 2; /* Default Reihenfolge */
}

.nav-buttons > .btn-primary {
    order: 1; /* Get Started zuerst */
}

.nav-buttons > .theme-toggle {
    order: 2; /* Danach der Theme Toggle */
}

.nav-buttons > .mobile-menu-toggle {
    order: 3; /* Zuletzt der Mobile-Menu-Button */
}

/* Theme-specific styling for page elements */

/* Body background */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Hero section */
.hero-section {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    transition: background 0.3s ease;
}

[data-theme="light"] .hero-section {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

/* Product cards */
.product-card {
    background-color: var(--card-bg);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

[data-theme="light"] .product-card {
    border: 1px solid rgba(226, 232, 240, 0.8);
}

/* Text colors */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
}

p, span {
    color: var(--text-secondary);
}

.nav-link {
    color: var(--text-primary) !important; /* Ensure nav links are always readable */
}

/* Hero section text */
.hero-title {
    color: var(--text-primary);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .hero-title {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.hero-subtitle {
    color: var(--text-secondary);
}

/* Product card content */
.product-card .product-title {
    color: var(--text-primary);
}

.product-card .product-description {
    color: var(--text-secondary);
}

.product-card .product-url {
    color: var(--primary-color);
}

/* Feature list items */
.feature-list li {
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.03);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
    transition: background-color 0.3s ease;
}

[data-theme="dark"] .feature-list li {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .feature-list li {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.feature-list li i {
    color: var(--primary-color);
    margin-right: 8px;
}

.feature-list li span {
    color: var(--text-secondary);
}

/* Buttons with better contrast */
.btn-primary {
    background: var(--gradient-main);
    color: var(--contrast-text) !important;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--text-primary) !important;
    font-weight: 600;
}

[data-theme="dark"] .btn-secondary:hover {
    background: rgba(108, 99, 255, 0.1);
}

[data-theme="light"] .btn-secondary:hover {
    background: rgba(99, 102, 241, 0.05);
}

/* Cube styling adjustments for both modes */
.cube-face {
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .cube-face {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(108, 99, 255, 0.7);
    color: var(--text-primary);
}

[data-theme="light"] .cube-face {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(99, 102, 241, 0.7);
    color: var(--text-primary);
}

[data-theme="dark"] .cube-face i {
    color: var(--primary-color);
}

[data-theme="light"] .cube-face i {
    color: var(--primary-color);
}

.cube-content span {
    color: var(--text-primary);
    font-weight: 600;
}

/* Header and footer with proper contrast */
.header, header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer-title {
    color: var(--text-primary);
}

.footer-section p, .footer-section a {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--primary-color);
}

/* Ecosystem section improvements */
.section-header h2 {
    color: var(--text-primary);
}

.section-header p {
    color: var(--text-secondary);
}

/* Ecosystem node colors */
.ecosystem-node {
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="light"] .ecosystem-node {
    background-color: #ffffff;
    color: var(--text-primary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .ecosystem-node {
    background-color: #1e293b;
    color: var(--text-primary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.ecosystem-node .node-title {
    color: var(--text-primary);
    font-weight: 600;
}

/* Pricing section improvements */
.pricing-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.pricing-card .card-header {
    border-bottom: 1px solid var(--border-color);
}

.pricing-card .price {
    color: var(--primary-color);
}

.pricing-card .price-period {
    color: var(--muted-text);
}

.pricing-card .feature-item {
    color: var(--text-secondary);
}

.pricing-card .feature-item i {
    color: var(--primary-color);
}

/* Theme toggle tooltip */
.theme-toggle .tooltip {
    z-index: 9999;
    width: auto;
    white-space: nowrap;
}

[data-theme="dark"] .theme-toggle .tooltip {
    background: rgba(25, 34, 49, 0.9);
    color: #ffffff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .theme-toggle .tooltip {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Mobile menu */
.nav-links {
    transition: background-color 0.3s ease;
}

[data-theme="dark"] .nav-links {
    background-color: rgba(10, 10, 10, 0.95);
}

[data-theme="light"] .nav-links {
    background-color: rgba(247, 250, 252, 0.95);
}

/* Action buttons */
.action-btn {
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] .action-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

[data-theme="light"] .action-btn {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

/* Ensure form inputs are readable */
input, textarea, select {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

[data-theme="dark"] input, 
[data-theme="dark"] textarea, 
[data-theme="dark"] select {
    background-color: rgba(30, 41, 59, 0.8);
}

[data-theme="light"] input, 
[data-theme="light"] textarea, 
[data-theme="light"] select {
    background-color: rgba(255, 255, 255, 0.8);
}

/* Table styles */
table {
    background-color: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

table th {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

table td {
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

/* Links with better hover states */
a {
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--hover-color);
}

/* Tooltip text color */
[data-theme="light"] .tooltip-inner {
    color: var(--text-primary);
}

[data-theme="dark"] .tooltip-inner {
    color: var(--text-primary);
}

/* Override important text for article content */
article p, 
article li, 
article blockquote, 
.content-section p, 
.content-section li {
    color: var(--text-secondary) !important;
}

/* Fix for dark mode code snippets */
[data-theme="dark"] pre, 
[data-theme="dark"] code {
    background: rgba(15, 23, 42, 0.8);
    color: #e2e8f0;
    border: 1px solid rgba(108, 99, 255, 0.2);
}

[data-theme="light"] pre, 
[data-theme="light"] code {
    background: rgba(240, 245, 250, 0.8);
    color: #334155;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Enhanced Glow Animation */
.glow-animation {
    animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
    0% {
        box-shadow: 0 0 10px rgba(108, 99, 255, 0.2),
                    0 0 20px rgba(108, 99, 255, 0);
    }
    100% {
        box-shadow: 0 0 20px rgba(108, 99, 255, 0.6),
                    0 0 40px rgba(108, 99, 255, 0.3);
    }
}

/* Float Animations for Ecosystem Nodes */
.float-animation {
    animation: float 6s ease-in-out infinite;
}

.float-reverse-animation {
    animation: float 6s ease-in-out infinite reverse;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* Connector Particle Animation */
.connector-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    animation: move-particle 3s linear infinite;
    opacity: 0.8;
    top: -4px;
    left: 0;
    box-shadow: 0 0 10px rgba(108, 99, 255, 0.5);
}

@keyframes move-particle {
    0% {
        left: 0;
    }
    100% {
        left: 100%;
    }
}

/* Ecosystem Connectors */
.ecosystem-connector {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, 
        rgba(108, 99, 255, 0.3) 0%, 
        rgba(108, 99, 255, 0.7) 50%, 
        rgba(108, 99, 255, 0.3) 100%);
    transform-origin: 0 0;
    z-index: 1;
    overflow: visible;
}

.ecosystem-connector.secondary {
    opacity: 0.5;
    height: 1px;
}

/* Theme-specific styling for ecosystem nodes */
[data-theme="light"] .ecosystem-node {
    background-color: #ffffff;
    color: #1a202c;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .ecosystem-node {
    background-color: #1e293b;
    color: #f8fafc;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Node type-specific colors */
.ecosystem-node.operator .node-icon {
    color: #6c63ff;
}

.ecosystem-node.coder .node-icon {
    color: #00bfa6;
}

.ecosystem-node.llm .node-icon {
    color: #f59e0b;
}

.ecosystem-node.app .node-icon {
    color: #ef4444;
}

.ecosystem-node.main .node-icon {
    color: #ffffff;
}

/* Advanced reveal animations */
.reveal-animation {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-animation.active {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animations for children */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-item.active {
    opacity: 1;
    transform: translateY(0);
}

/* Animated Image Container Effects */
.animated-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.animated-image-container.hovered {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* Prevent display issues when images are missing */
.animated-image-container {
    min-height: 200px;
    background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .animated-image-container {
    background-color: rgba(255, 255, 255, 0.05);
}

.animated-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, 
        rgba(108, 99, 255, 0.2) 0%, 
        rgba(0, 191, 166, 0.2) 100%);
    z-index: 2;
    opacity: 1; /* Show by default until image loads */
    transition: opacity 0.5s ease;
}

.animated-placeholder .product-logo {
    width: 40%;
    height: 40%;
    opacity: 0.7;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
}

.image-overlay-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        rgba(108, 99, 255, 0.2) 0%, 
        rgba(0, 191, 166, 0.2) 100%);
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.animated-image-container:hover .image-overlay-effect {
    opacity: 1;
}

.image-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: translateX(-100%);
    animation: shine 4s infinite;
    z-index: 3;
}

@keyframes shine {
    0% {
        transform: translateX(-100%);
    }
    20%, 100% {
        transform: translateX(100%);
    }
}

/* Enhanced reveal animations with proper active state */
.reveal-animation {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    will-change: opacity, transform;
}

.reveal-animation.active {
    opacity: 1;
    transform: translateY(0);
}

/* Delay classes for animations */
.delay-200 {
    transition-delay: 0.2s;
}

.delay-400 {
    transition-delay: 0.4s;
}

.delay-600 {
    transition-delay: 0.6s;
}

.delay-800 {
    transition-delay: 0.8s;
}

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}
