/* Medgeniero - Futuristic Medical Platform Styles */
:root {
    /* Futuristic Color Palette */
    --neon-cyan: #00ffd1;
    --neon-pink: #ff0080;
    --neon-blue: #0080ff;
    --electric-purple: #8a2be2;
    --matrix-green: #00ff41;
    --hologram-blue: #40e0d0;
    
    /* Dark Theme */
    --dark-bg: #0a0a0f;
    --darker-bg: #05050a;
    --card-bg: #1a1a2e;
    --card-hover: #252545;
    --text-primary: #ffffff;
    --text-secondary: #b8c5d6;
    --text-accent: #00ffd1;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-neon: linear-gradient(45deg, #00ffd1, #ff0080, #0080ff);
    --gradient-matrix: linear-gradient(135deg, #00ff41, #00ffd1);
    --gradient-purple: linear-gradient(135deg, #8a2be2, #ff0080);
    
    /* Glass effects */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    /* Shadows */
    --shadow-neon: 0 0 20px rgba(0, 255, 209, 0.5);
    --shadow-pink: 0 0 20px rgba(255, 0, 128, 0.5);
    --shadow-blue: 0 0 20px rgba(0, 128, 255, 0.5);
}

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

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: var(--dark-bg);
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(0, 255, 209, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 0, 128, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(0, 128, 255, 0.1) 0%, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background Particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(2px 2px at 40% 60%, var(--neon-cyan), transparent),
        radial-gradient(2px 2px at 70% 30%, var(--neon-pink), transparent),
        radial-gradient(1px 1px at 90% 80%, var(--neon-blue), transparent),
        radial-gradient(1px 1px at 10% 90%, var(--matrix-green), transparent);
    background-size: 300px 300px, 400px 400px, 200px 200px, 350px 350px;
    animation: float-particles 20s ease-in-out infinite;
    opacity: 0.3;
    z-index: -1;
}

@keyframes float-particles {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(20px, -20px) rotate(90deg); }
    50% { transform: translate(-20px, 20px) rotate(180deg); }
    75% { transform: translate(20px, 20px) rotate(270deg); }
}

/* Navigation - Futuristic Glass */
nav {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

nav .container {
    max-width: 1400px;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 900;
    background: var(--gradient-neon);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(0, 255, 209, 0.5);
    transition: all 0.3s ease;
}

.nav-brand:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 10px var(--neon-cyan));
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.nav-link {
    position: relative;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.nav-link:hover {
    color: var(--neon-cyan);
    background: var(--glass-bg);
    box-shadow: 0 0 15px rgba(0, 255, 209, 0.2);
}

.nav-link.active {
    color: var(--neon-cyan);
    background: var(--glass-bg);
    border: 1px solid rgba(0, 255, 209, 0.3);
}

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

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

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 4rem 0;
    position: relative;
}

.hero-title {
    font-size: 4rem;
    font-weight: 900;
    background: var(--gradient-neon);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 4s ease-in-out infinite;
    margin-bottom: 1rem;
    text-shadow: 0 0 50px rgba(0, 255, 209, 0.3);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Futuristic Buttons */
.btn-futuristic {
    position: relative;
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--glass-bg);
    border: 2px solid var(--neon-cyan);
    border-radius: 50px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.btn-futuristic:hover {
    color: var(--dark-bg);
    background: var(--neon-cyan);
    box-shadow: var(--shadow-neon);
    transform: translateY(-3px);
}

.btn-futuristic::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-futuristic:hover::before {
    left: 100%;
}

.btn-secondary {
    border-color: var(--neon-pink);
    color: var(--neon-pink);
}

.btn-secondary:hover {
    background: var(--neon-pink);
    box-shadow: var(--shadow-pink);
}

/* Feature Cards */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 4rem 0;
}

.feature-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-neon);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card:hover {
    background: var(--card-hover);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(-10px);
    border-color: var(--neon-cyan);
}

.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.feature-icon svg {
    width: 30px;
    height: 30px;
    color: white;
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.feature-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.feature-link {
    color: var(--neon-cyan);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.feature-link:hover {
    color: var(--neon-pink);
    transform: translateX(5px);
}

/* Quick Access Section */
.quick-access {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    padding: 3rem;
    text-align: center;
    margin: 4rem 0;
    position: relative;
    overflow: hidden;
}

.quick-access::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, var(--neon-cyan), transparent);
    animation: rotate 10s linear infinite;
    z-index: -1;
    opacity: 0.1;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.quick-access-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.quick-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.quick-card:hover {
    background: var(--card-hover);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    transform: translateY(-5px);
    border-color: var(--neon-cyan);
}

.quick-card-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.quick-card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Stats Counter */
.stats-section {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-item {
    padding: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    background: var(--gradient-neon);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    animation: countUp 2s ease-out;
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-access {
        padding: 2rem 1rem;
    }
    
    .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .btn-futuristic {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
    }
}

/* Loading Animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-bg);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--glass-border);
    border-top: 3px solid var(--neon-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hide loading overlay when loaded */
body.loaded .loading-overlay {
    opacity: 0;
    pointer-events: none;
}

/* Enhanced Mobile Menu Styles */
#mobile-menu {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 0 0 1rem 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#mobile-menu .nav-link {
    position: relative;
    overflow: hidden;
}

#mobile-menu .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 209, 0.2), transparent);
    transition: left 0.5s ease;
}

#mobile-menu .nav-link:hover::before {
    left: 100%;
}

/* Quick Actions Grid Animation */
#mobile-menu .grid a {
    transform: translateY(10px);
    opacity: 0;
    animation: slideUpFade 0.3s ease forwards;
}

#mobile-menu .grid a:nth-child(1) {
    animation-delay: 0.1s;
}

#mobile-menu .grid a:nth-child(2) {
    animation-delay: 0.2s;
}

@keyframes slideUpFade {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Scroll to Top Button Styles */
#scroll-to-top {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 
        0 8px 32px rgba(0, 255, 209, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(0, 255, 209, 0.3);
}

#scroll-to-top:hover {
    background: linear-gradient(135deg, #00ffd1, #ff0080);
    box-shadow: 
        0 12px 40px rgba(0, 255, 209, 0.5),
        0 0 20px rgba(255, 0, 128, 0.3);
    transform: translateY(-2px) scale(1.1);
}

#scroll-to-top:active {
    transform: translateY(0) scale(1.05);
    box-shadow: 
        0 6px 20px rgba(0, 255, 209, 0.4),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Enhanced Animation Classes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Mobile Menu Button Animation */
#mobile-menu-button svg {
    transition: transform 0.3s ease;
}

#mobile-menu-button:hover svg {
    transform: scale(1.1);
}

/* Enhanced Glass Effect for Mobile Menu */
@supports (backdrop-filter: blur(20px)) {
    #mobile-menu {
        background: rgba(15, 23, 42, 0.8);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
}

@supports not (backdrop-filter: blur(20px)) {
    #mobile-menu {
        background: rgba(15, 23, 42, 0.95);
    }
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    #scroll-to-top {
        bottom: 1rem;
        right: 1rem;
        padding: 0.75rem;
    }
    
    #scroll-to-top svg {
        width: 1.25rem;
        height: 1.25rem;
    }
}

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

/* Focus Styles for Accessibility */
#mobile-menu-button:focus,
#scroll-to-top:focus {
    outline: 2px solid var(--neon-cyan);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    #mobile-menu {
        background: rgba(0, 0, 0, 0.95);
        border: 2px solid var(--neon-cyan);
    }
    
    #scroll-to-top {
        background: var(--neon-cyan);
        color: black;
    }
}

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