@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-main: #F8FAFC;
    --bg-surface: #FFFFFF;
    --bg-surface-elevated: #FFFFFF;
    --border-main: #E2E8F0;
    --border-subtle: #F1F5F9;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    
    /* Brand accents */
    --accent-emerald: #059669;
    --accent-emerald-light: #ECFDF5;
    --accent-indigo: #4F46E5;
    --accent-indigo-light: #EEF2FF;
    --accent-blue: #0284C7;
    --accent-blue-light: #F0F9FF;
    --accent-violet: #7C3AED;
    --accent-violet-light: #F5F3FF;
    --accent-amber: #D97706;
    --accent-amber-light: #FFFBEB;
    --accent-rose: #E11D48;
    --accent-rose-light: #FFF1F2;
    
    --card-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.05), 0 1px 2px -1px rgba(15, 23, 42, 0.05);
    --card-shadow-hover: 0 10px 25px -5px rgba(15, 23, 42, 0.07), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

.dark {
    --bg-main: #0B0F19;
    --bg-surface: #111827;
    --bg-surface-elevated: #1F2937;
    --border-main: #1F2937;
    --border-subtle: #161F30;
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    
    --accent-emerald: #10B981;
    --accent-emerald-light: rgba(16, 185, 129, 0.12);
    --accent-indigo: #6366F1;
    --accent-indigo-light: rgba(99, 102, 241, 0.12);
    --accent-blue: #38BDF8;
    --accent-blue-light: rgba(56, 189, 248, 0.12);
    --accent-violet: #A78BFA;
    --accent-violet-light: rgba(167, 139, 250, 0.12);
    --accent-amber: #FBBF24;
    --accent-amber-light: rgba(251, 191, 36, 0.12);
    --accent-rose: #FB7185;
    --accent-rose-light: rgba(251, 113, 133, 0.12);
    
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Persian / RTL Font Support */
[dir="rtl"] body,
[dir="rtl"] {
    font-family: 'Vazirmatn', 'Inter', system-ui, -apple-system, sans-serif !important;
}

[dir="rtl"] .font-mono {
    font-family: 'JetBrains Mono', 'Vazirmatn', monospace !important;
    direction: ltr;
    display: inline-block;
}

/* Elegant SaaS Cards */
.saas-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-main);
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.saas-card-hover:hover {
    box-shadow: var(--card-shadow-hover);
    border-color: #CBD5E1;
}

.dark .saas-card-hover:hover {
    border-color: #374151;
}

/* Ambient Glowing Background Orbs */
.bg-orb-1 {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.06) 0%, rgba(79, 70, 229, 0) 70%);
    top: -120px;
    left: 10%;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.bg-orb-2 {
    position: absolute;
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, rgba(5, 150, 105, 0.05) 0%, rgba(5, 150, 105, 0) 70%);
    top: 300px;
    right: 5%;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.dark .bg-orb-1 {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0) 70%);
}

.dark .bg-orb-2 {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0) 70%);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 9999px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #374151;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* Custom Range Input */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #E2E8F0;
    border-radius: 9999px;
    outline: none;
}

.dark input[type="range"] {
    background: #1F2937;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4F46E5;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Audio Waveform Animation Bars */
.wave-bar {
    width: 3px;
    height: 8px;
    background: #4F46E5;
    border-radius: 9999px;
    transition: height 0.15s ease;
}

.playing .wave-bar {
    animation: wavePulse 1s ease-in-out infinite alternate;
}

.playing .wave-bar:nth-child(2) { animation-delay: 0.1s; }
.playing .wave-bar:nth-child(3) { animation-delay: 0.2s; }
.playing .wave-bar:nth-child(4) { animation-delay: 0.3s; }
.playing .wave-bar:nth-child(5) { animation-delay: 0.4s; }
.playing .wave-bar:nth-child(6) { animation-delay: 0.5s; }
.playing .wave-bar:nth-child(7) { animation-delay: 0.25s; }
.playing .wave-bar:nth-child(8) { animation-delay: 0.15s; }

@keyframes wavePulse {
    0% { height: 6px; }
    50% { height: 28px; }
    100% { height: 12px; }
}

/* Shimmer Loading Animation */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.shimmer-active {
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Typing cursor blink */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.typing-cursor::after {
    content: '▋';
    display: inline-block;
    color: #4F46E5;
    margin-left: 2px;
    animation: blink 0.8s infinite;
}

/* Toast Notifications */
#toastContainer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

[dir="rtl"] #toastContainer {
    right: auto;
    left: 20px;
}

.toast {
    pointer-events: auto;
    animation: slideInUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
