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

:root {
    --primary-blue: #3B82F6;
    --primary-cyan: #06B6D4;
    --slate-900: #0F172A;
    --slate-800: #1E293B;
    --slate-700: #334155;
    --slate-600: #475569;
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Background Grid Pattern */
.bg-grid-pattern {
    background-image: 
        linear-gradient(rgba(59, 130, 246, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Custom Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.3); }
    50% { box-shadow: 0 0 30px rgba(59, 130, 246, 0.6); }
}

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

@keyframes bounceSoft {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes popOut {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.8); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Animation Classes */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.6s ease-out;
}

.animate-slide-down {
    animation: slideDown 0.4s ease-out;
}

.animate-pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

.animate-flash {
    animation: flash 0.15s ease-in-out;
}

.animate-bounce-soft {
    animation: bounceSoft 0.6s ease-out;
}

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

::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.6);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.8);
}

/* Control Toggle Buttons */
.control-toggle {
    position: relative;
    min-width: 130px;
    min-height: 90px;
    border-radius: 12px;
    background: rgba(51, 65, 85, 0.4);
    border: 2px solid rgba(71, 85, 105, 0.6);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
}

.control-toggle:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(51, 65, 85, 0.6);
    /* box-shadow: 0 10px 30px -10px rgba(59, 130, 246, 0.3); */
}

.control-toggle.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(6, 182, 212, 0.2));
    border-color: rgba(59, 130, 246, 0.8);
    /* box-shadow: 0 0 30px rgba(59, 130, 246, 0.4); */
}

.control-toggle.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(6, 182, 212, 0.1));
    border-radius: 10px;
}

/* Glowing effect for active light */
.control-toggle.active.light-control {
    /* box-shadow: 0 0 40px rgba(255, 193, 7, 0.6), 0 0 80px rgba(255, 193, 7, 0.3); */
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(255, 235, 59, 0.2));
    border-color: rgba(255, 193, 7, 0.8);
   
}

.control-toggle.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(6, 182, 212, 0.2));
    border-color: rgba(59, 130, 246, 0.8);
    /* box-shadow: 0 0 30px rgba(59, 130, 246, 0.4); */
}

.control-toggle.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(6, 182, 212, 0.1));
    border-radius: 14px;
}

/* Glowing effect for active light */
.control-toggle.active.light-control {
    /* box-shadow: 0 0 40px rgba(255, 193, 7, 0.6), 0 0 80px rgba(255, 193, 7, 0.3); */
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(255, 235, 59, 0.2));
    border-color: rgba(255, 193, 7, 0.8);
}

/* Popup Modal Styles */
.popup-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

.popup-content {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(71, 85, 105, 0.8);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    animation: popIn 0.3s ease-out;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

/* Custom Range Inputs */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(71, 85, 105, 0.5);
    outline: none;
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-cyan));
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.5);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-cyan));
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

/* Range Input Color Variants */
input[type="range"].accent-green-500::-webkit-slider-thumb {
    background: linear-gradient(135deg, #10B981, #34D399);
}

input[type="range"].accent-yellow-500::-webkit-slider-thumb {
    background: linear-gradient(135deg, #F59E0B, #FCD34D);
}

input[type="range"].accent-purple-500::-webkit-slider-thumb {
    background: linear-gradient(135deg, #8B5CF6, #A78BFA);
}

input[type="range"].accent-cyan-500::-webkit-slider-thumb {
    background: linear-gradient(135deg, #06B6D4, #22D3EE);
}

input[type="range"].accent-pink-500::-webkit-slider-thumb {
    background: linear-gradient(135deg, #EC4899, #F472B6);
}

/* Custom Select Styles */
select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Button Hover Effects */
button {
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::before {
    width: 300px;
    height: 300px;
}

/* Card Hover Effects */
.bg-slate-800\/40:hover {
    background: rgba(30, 41, 59, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.bg-slate-700\/30:hover {
    background: rgba(51, 65, 85, 0.5);
    transform: translateY(-1px);
}

/* Focus States for Accessibility */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* Loading States */
.loading {
    position: relative;
    color: transparent;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top-color: #3B82F6;
    animation: spin 1s linear infinite;
}

/* Custom Toggle Switch for Modals */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(71, 85, 105, 0.8);
    border-radius: 24px;
    transition: all 0.3s ease;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-cyan));
    border-color: rgba(59, 130, 246, 0.5);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.toggle-slider:hover {
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 50;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    border-left-width: 4px;
    backdrop-filter: blur(12px);
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: rgba(34, 197, 94, 0.9);
    border-color: #16A34A;
    color: white;
}

.notification.error {
    background: rgba(239, 68, 68, 0.9);
    border-color: #DC2626;
    color: white;
}

.notification.warning {
    background: rgba(245, 158, 11, 0.9);
    border-color: #D97706;
    color: white;
}

.notification.info {
    background: rgba(59, 130, 246, 0.9);
    border-color: #2563EB;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .control-toggle {
        min-width: 80px;
        min-height: 80px;
    }
    
    .popup-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
    
    .notification {
        right: 0.5rem;
        left: 0.5rem;
        max-width: calc(100vw - 1rem);
    }
    
    .grid-cols-2 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    
    .md\:grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .hero-controls .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    .text-4xl {
        font-size: 2rem;
        line-height: 2.5rem;
    }
    
    .text-5xl {
        font-size: 2.5rem;
        line-height: 3rem;
    }
    
    .px-8 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .py-3 {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .control-toggle {
        min-width: 70px;
        min-height: 70px;
    }
}

/* Color picker buttons */
.color-picker-button {
    transition: all 0.2s ease;
    position: relative;
}

.color-picker-button:hover {
    transform: scale(1.1);
}

.color-picker-button.active {
    transform: scale(1.15);
}

.color-picker-button.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

/* Settings section spacing */
.settings-section {
    border-top: 1px solid rgba(71, 85, 105, 0.3);
    margin-top: 1rem;
    padding-top: 1rem;
}

/* Inline settings styling */
.inline-settings {
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid rgba(71, 85, 105, 0.4);
    border-radius: 12px;
    backdrop-filter: blur(8px);
}

.inline-settings h4 {
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* Enhanced range input styling */
input[type="range"] {
    background: linear-gradient(to right, rgba(71, 85, 105, 0.3) 0%, rgba(71, 85, 105, 0.8) 100%);
}

input[type="range"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Loading animation for better UX */
.morse-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top-color: #3B82F6;
    animation: spin 1s linear infinite;
}

/* Smooth transitions for all interactive elements */
button, input, select, textarea {
    transition: all 0.2s ease;
}

/* Enhanced focus states */
button:focus-visible {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
    transform: translateY(-1px);
}

input:focus-visible, 
textarea:focus-visible, 
select:focus-visible {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Improved button hover states */
button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

/* Enhanced notification positioning */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    max-width: 400px;
    pointer-events: auto;
}

/* Better modal backdrop */
.popup-modal {
    backdrop-filter: blur(12px);
    background: rgba(0, 0, 0, 0.75);
}

/* Improved scrollbar for modal content */
.popup-content::-webkit-scrollbar {
    width: 8px;
}

.popup-content::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.3);
    border-radius: 4px;
}

.popup-content::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 4px;
}

.popup-content::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .control-toggle {
        border-width: 3px;
        border-color: rgba(255, 255, 255, 0.8);
    }
    
    .control-toggle.active {
        border-color: #60A5FA;
        background: rgba(59, 130, 246, 0.3);
    }
}

/* 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;
    }
    
    .animate-fade-in,
    .animate-slide-up,
    .animate-slide-down,
    .animate-pulse-glow,
    .animate-flash,
    .animate-bounce-soft {
        animation: none;
    }
}




.bg-grid-pattern {
            background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.15) 1px, transparent 0);
            background-size: 20px 20px;
        }
        
        /* Custom mobile-first responsive breakpoints */
        @media (max-width: 320px) {
            .text-responsive { font-size: 0.875rem; }
            .logo-responsive { width: 2.5rem; height: 2.5rem; }
            .brand-text { font-size: 1.25rem; }
        }
        
        @media (min-width: 321px) and (max-width: 480px) {
            .logo-responsive { width: 2.75rem; height: 2.75rem; }
            .brand-text { font-size: 1.375rem; }
        }
        
        /* Smooth transitions for mobile menu */
        .mobile-menu-enter {
            opacity: 0;
            transform: translateY(-10px);
        }
        
        .mobile-menu-enter-active {
            opacity: 1;
            transform: translateY(0);
            transition: opacity 300ms ease-out, transform 300ms ease-out;
        }
        
        .mobile-menu-exit {
            opacity: 1;
            transform: translateY(0);
        }
        
        .mobile-menu-exit-active {
            opacity: 0;
            transform: translateY(-10px);
            transition: opacity 200ms ease-in, transform 200ms ease-in;
        }
        
        /* Footer responsive grid fixes */
        @media (max-width: 768px) {
            .footer-grid {
                grid-template-columns: 1fr;
                gap: 2rem;
            }
            
            .footer-brand {
                text-align: center;
            }
            
            .footer-links {
                text-align: center;
            }
        }
        
        @media (min-width: 768px) and (max-width: 1024px) {
            .footer-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 2rem;
            }
        }
        
        /* Touch-friendly tap targets */
        .tap-target {
            min-height: 44px;
            min-width: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
        }