:root {
    /* Premium Color Palette */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    
    /* Light Theme - Optimized for Visibility */
    --bg-main: #ffffff;
    --bg-sec: #f1f5f9;
    --bg-footer: #0f172a; /* Keep footer dark for elegance */
    --text-main: #0f172a;
    --text-sec: #475569;
    --border: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.05);
    --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    --card-hover-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.1);
}

.dark {
    /* True Dark Theme - Deep Navy & Elegant */
    --bg-main: #0b1120;
    --bg-sec: #131c30;
    --bg-footer: #0b1120;
    --text-main: #ffffff;
    --text-sec: #94a3b8;
    --border: #1a1f2e;
    --glass-bg: rgba(11, 17, 32, 0.8);
    --glass-border: #1a1f2e;
    --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.6);
    --card-hover-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Glassmorphism Utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-sec);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-sec);
}

/* Premium Buttons */
.btn-premium {
    position: relative;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
}

.btn-premium-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.btn-premium-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

/* Hero Section Adjustments */
#inicio {
    position: relative;
    z-index: 1;
}

.orb {
    pointer-events: none;
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    z-index: -1;
}

/* Premium Card Base */
.premium-card-base {
    border-radius: 2rem;
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* App Cards */
.app-card {
    background: var(--bg-sec);
    border-radius: 2rem;
    border: 1px solid var(--border);
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.app-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: var(--card-hover-shadow);
}

/* Fix light mode hover text regression */
html:not(.dark) .app-card:hover h3, 
html:not(.dark) .group:hover h3 {
    color: var(--text-main) !important;
}

html:not(.dark) .app-card:hover p,
html:not(.dark) .group:hover p {
    color: var(--text-sec) !important;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.app-card:hover::before {
    opacity: 0.05;
}

.app-card > * {
    position: relative;
    z-index: 1;
}

/* Chatbot UI Improvements */
#shei-chat {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    background: var(--bg-main);
}

.chat-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

#shei-chat-messages::-webkit-scrollbar {
    width: 4px;
}

.message-bubble {
    border-radius: 18px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

.dark #inicio {
    background: radial-gradient(circle at 50% -20%, #1e1b4b 0%, #000000 100%);
}

.dark .section-title {
    background: linear-gradient(to right, #ffffff, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Modal Improvements */
.modal-glass {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 2rem;
    box-shadow: 0 0 0 1px #1a1f2e, 0 20px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.dark .modal-glass {
    background: #0a0a0a;
}

/* Subtle Dark Border for Internal Dividers */
.dark-border-subtle {
    border-color: var(--border) !important;
}

/* Swiper Overrides */
.swiper-pagination-bullet {
    background: var(--primary) !important;
    opacity: 0.3;
}
.swiper-pagination-bullet-active {
    opacity: 1;
    width: 24px !important;
    border-radius: 4px !important;
}
/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.animate-slide-up {
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-scale-in {
    animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-500 { animation-delay: 0.5s; }

/* Grid Background */
/* Grid Background - Enhanced Net/Cyber Effect */
.bg-grid-premium {
    background-image: radial-gradient(circle at 2px 2px, rgba(99, 102, 241, 0.15) 1px, transparent 0);
    background-size: 40px 40px;
}

.dark .bg-grid-premium {
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Specific Section Overrides for Forced Dark */
.section-cta-premium, .footer-premium {
    background-color: #0b1120 !important; 
    color: white !important;
}

/* CTA & Footer Forced Visibility (Always Dark) */
.section-cta-premium, .footer-premium {
    background-color: #020617 !important; /* Deep Navy/Black */
    color: white !important;
}

.section-cta-premium h2, 
.section-cta-premium p,
.footer-premium h4,
.footer-premium p,
.footer-premium a,
.footer-premium li {
    color: white !important;
}

.footer-premium a:hover {
    color: var(--primary) !important;
}

.footer-premium .text-slate-400 {
    color: #94a3b8 !important;
}

.footer-premium border-slate-900 {
    border-color: #1a1f2e !important;
}

/* Forced Dark Mode Visibility for Branding & Icons */
.dark .rounded-full.bg-indigo-50,
.dark .rounded-2xl.bg-indigo-50,
.dark .rounded-2xl.bg-purple-50,
.dark .rounded-2xl.bg-blue-50,
.dark .rounded-2xl.bg-emerald-50 {
    background-color: rgba(99, 102, 241, 0.25) !important;
    border: 1px solid rgba(99, 102, 241, 0.4) !important;
}

.dark .text-indigo-600,
.dark .text-purple-600,
.dark .text-blue-600,
.dark .text-emerald-600 {
    color: #a5b4fc !important;
}
