/* Custom CSS for CLI Vibes Landing Page */

/* Remove all focus outlines from navigation links */
nav a:focus,
nav a:active,
nav a:focus-visible,
nav button:focus,
nav button:active,
nav button:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* Root Variables */
:root {
    --brand-body: #FBF9FF;
    --brand-primary: #6C29D8;
    --brand-text: #8D5EFE;
    --brand-black: #0F0D1B;
}

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

body {
    font-family: 'Work Sans', sans-serif;
    background-color: var(--brand-body);
    line-height: 1.6;
    color: var(--brand-black);
}

/* Typography */
.font-rubik {
    font-family: 'Rubik', sans-serif;
}

.font-work {
    font-family: 'Work Sans', sans-serif;
}

/* Custom Animations */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
    100% {
        transform: translateY(0px);
    }
}

@keyframes waterFloat {
    0% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-8px) rotate(1deg);
    }
    50% {
        transform: translateY(-15px) rotate(0deg);
    }
    75% {
        transform: translateY(-8px) rotate(-1deg);
    }
    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Custom Utility Classes */
.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-water-float {
    animation: waterFloat 4s ease-in-out infinite;
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

.animate-pulse-custom {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.code-black {
    padding: 8px 16px; /* Equivalent to py-2 px-4 */
}

/* Hero Section Enhancements */
.hero-monitor {
    animation: float 8s ease-in-out infinite;
}

/* Documentation Theme Variables */
:root {
    --brand-primary: #6c29d8;
    --brand-text: #8d5efe;
    --brand-black: #0f0d1b;
    --brand-body: #fbf9ff;
}

/* Dark theme variables */
[data-theme="dark"] {
    --bg-primary: #0f0d1b;
    --bg-secondary: #1f1f2e;
    --bg-tertiary: #2a2a3e;
    --text-primary: #ffffff;
    --text-secondary: #e5e7eb;
    --text-muted: #9ca3af;
    --border-color: #374151;
    --code-bg: #1f2937;
    --sidebar-bg: #1a1a2e;
    --header-bg: #16213e;
    --logo-filter: invert(1);
}

/* Light theme variables */
[data-theme="light"] {
    --bg-primary: #fbf9ff;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8fafc;
    --text-primary: #0f0d1b;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --code-bg: #f3f4f6;
    --sidebar-bg: #f8fafc;
    --header-bg: #ffffff;
    --logo-filter: none;
}

/* Documentation Font Classes */
.font-rubik {
    font-family: "Rubik", sans-serif;
}
.font-work-sans {
    font-family: "Work Sans", sans-serif;
}

/* Documentation Theme-aware styles */
.docs-body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.docs-header {
    background-color: var(--header-bg);
    border-color: var(--border-color);
}

.docs-sidebar {
    background-color: var(--sidebar-bg);
    border-color: var(--border-color);
}

/* Override Tailwind text colors for theme responsiveness */
.docs-body h1, .docs-body h2, .docs-body h3, .docs-body h4, .docs-body h5, .docs-body h6 {
    color: var(--text-primary) !important;
}

.docs-body p, .docs-body span, .docs-body div, .docs-body li, .docs-body a:not(.docs-nav-item):not(.docs-toc-item) {
    color: var(--text-secondary) !important;
}

.docs-body .text-gray-200, .docs-body .text-gray-300, .docs-body .text-gray-400 {
    color: var(--text-secondary) !important;
}

.docs-body .text-white {
    color: var(--text-primary) !important;
}

.docs-body .list-count
{
    color: #ffff !important;
}

/* Table of contents specific styling */
.docs-toc-item {
    color: var(--text-muted) !important;
    transition: color 0.2s ease;
}

.docs-toc-item.active {
    color: var(--brand-primary) !important;
    font-weight: 600;
}

.docs-toc-item:hover {
    color: var(--brand-primary) !important;
}

/* Main content area styling */
.docs-prose h1, .docs-prose h2, .docs-prose h3 {
    color: var(--text-primary) !important;
}

.docs-prose p, .docs-prose ol, .docs-prose ul, .docs-prose li {
    color: var(--text-secondary) !important;
}

/* Ensure all elements inherit theme colors */
.docs-body * {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* Custom scrollbar for sidebar */
.docs-sidebar-scroll::-webkit-scrollbar {
    width: 4px;
}

.docs-sidebar-scroll::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.docs-sidebar-scroll::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 2px;
}

.docs-sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Documentation Code syntax highlighting */
.docs-code-block {
    background: var(--code-bg);
    border-radius: 8px;
    padding: 1rem;
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    color: var(--text-primary);
}

.docs-code-inline {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    font-size: 0.875em;
    color: var(--text-primary);
}

/* Documentation Navigation active states */
.docs-nav-item {
    transition: all 0.2s ease;
    color: var(--text-secondary);
    border-radius: 6px;
}

.docs-nav-item:hover {
    color: var(--brand-primary) !important;
    transform: translateX(4px);
}

.docs-nav-item.active {
    color: var(--brand-primary) !important;
    font-weight: 600;
}

/* Simple Theme Toggle Button */
.theme-toggle-btn {
    position: relative;
    width: 48px;
    height: 32px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Darker background for light mode */
[data-theme="light"] .theme-toggle-btn {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.theme-toggle-btn:hover {
    border-color: var(--brand-primary);
}

.theme-toggle-btn:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(108, 41, 216, 0.2);
}

.theme-icon {
    position: absolute;
    font-size: 16px;
    transition: all 0.3s ease;
    opacity: 0.5;
}

/* Show appropriate icon based on theme */
[data-theme="dark"] .theme-icon-dark {
    opacity: 1;
    transform: scale(1);
}

[data-theme="dark"] .theme-icon-light {
    opacity: 0.3;
    transform: scale(0.8);
}

[data-theme="light"] .theme-icon-light {
    opacity: 1;
    transform: scale(1);
}

[data-theme="light"] .theme-icon-dark {
    opacity: 0.3;
    transform: scale(0.8);
}

/* Documentation Button styling for theme adaptation */
.docs-btn-primary {
    background-color: var(--brand-primary);
    color: white;
    transition: all 0.3s ease;
}

.docs-btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Green icon color adaptation for documentation */
.docs-icon-green {
    color: #10b981; /* emerald-500 - works well in both themes */
}

/* Terminal Typing Effect */
.terminal-cursor {
    animation: pulse 1s infinite;
}

/* Button Hover Effects */
.btn-primary {
    background-color: var(--brand-primary);
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px 0 rgba(108, 41, 216, 0.3);
}

.btn-primary:hover {
    background-color: #5a1fb5;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(108, 41, 216, 0.4);
}

.btn-secondary {
    border: 2px solid var(--brand-primary);
    color: var(--brand-primary);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: var(--brand-primary);
    color: white;
    transform: translateY(-2px);
}

/* Feature Cards */
.feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(108, 41, 216, 0.1);
}

/* Code Block Styling */
.code-block {
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 8px 16px; /* Equivalent to px-4 py-2 */
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.code-block code {
    color: var(--text-primary);
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    font-size: 0.875rem;
    background: transparent;
}

.code-block .icon-green {
    color: #10b981; /* emerald-500 - works well in both themes */
}

/* Grid Background */
.grid-bg {
    background-image: radial-gradient(circle, var(--brand-text) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.1;
}

.css-grid-pattern {
    background-image: 
        linear-gradient(to right, #8D5EFE 1px, transparent 1px),
        linear-gradient(to bottom, #8D5EFE 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.15;
}

/* Wave Animation */
@keyframes wave {
    0% {
        d: path("M0,200 Q300,150 600,200 T1200,200 L1200,400 L0,400 Z");
    }
    50% {
        d: path("M0,200 Q300,250 600,200 T1200,200 L1200,400 L0,400 Z");
    }
    100% {
        d: path("M0,200 Q300,150 600,200 T1200,200 L1200,400 L0,400 Z");
    }
}

.wave-animation {
    animation: wave 4s ease-in-out infinite;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Navigation Enhancements */
.navbar {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--brand-text);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Responsive Design Enhancements */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.5rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
}

/* Loading Animation */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: dots 2s infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus States */
button:focus,
a:focus {
    outline: 2px solid var(--brand-text);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .no-print {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .feature-card {
        border: 1px solid var(--brand-black);
    }
    
    .btn-primary {
        border: 2px solid var(--brand-black);
    }
}

/* Remove animations from borders and dividers */
.border-t, .border-b, .border-l, .border-r,
[class*="border-"] {
    transition: none !important;
    animation: none !important;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
