:root {
    /* User Requested Palette */
    --color-light-pink: #ECBAD0;
    --color-pink: #DC82A3;
    --color-rose: #B25681;
    --color-muted-purple: #91759C;
    --color-deep-purple: #31294C;
    --color-dark-bg: #0F0924;

    /* Semantic Mappings */
    --bg-primary: var(--color-dark-bg);
    --bg-secondary: var(--color-deep-purple);
    --text-primary: #ffffff;
    --text-secondary: var(--color-light-pink);
    --accent-primary: var(--color-rosa);
    --accent-glow: var(--color-pink);

    --glass-bg: rgba(49, 41, 76, 0.4);
    --glass-border: rgba(236, 186, 208, 0.1);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(178, 86, 129, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(145, 117, 156, 0.15) 0%, transparent 40%);
}

.video-placeholder:hover {
    background: rgba(0, 0, 0, 0.4) !important;
    border-color: var(--color-pink) !important;
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

.video-placeholder:hover i {
    transform: scale(1.1);
    transition: all 0.3s ease;
}

/* YouTube-style Play Button and Team Avatar Enhancements */
.youtube-play-btn:hover,
.video-placeholder:hover .youtube-play-btn {
    transform: scale(1.12);
    background: #e84393 !important;
    box-shadow: 0 0 25px rgba(232, 67, 147, 0.7) !important;
}

.team-card:hover .avatar {
    transform: scale(1.05);
    border-color: var(--color-light-pink) !important;
    box-shadow: 0 0 20px rgba(236, 186, 208, 0.5) !important;
    transition: all 0.3s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Glassmorphism Utility (Optimized) */
.glass-panel {
    background: var(--glass-bg);
    /* Fallback for no support or low power mode */
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.2);
    /* Reduced shadow spread */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* Enable backdrop-filter only on larger screens or capable devices to reduce lag */
@media (min-width: 768px) {
    .glass-panel {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    }
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--color-rose), var(--color-pink));
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(178, 86, 129, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    will-change: transform;
    /* Hint to browser */
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(178, 86, 129, 0.6);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-pink);
    color: var(--color-light-pink);
    padding: 10px 22px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
}

.btn-outline:hover {
    background: rgba(220, 130, 163, 0.1);
    color: white;
}

/* New Component Button Styles */
.component-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: #aaa;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.component-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.component-btn.active {
    background: linear-gradient(90deg, rgba(220, 130, 163, 0.2), transparent);
    border-left: 3px solid var(--color-pink);
    color: white;
}

/* Animation Utilities (Optimized) */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
    will-change: transform;
    /* Hint to browser */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Loader Styles */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-dark-bg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out;
}

.loader-heart {
    font-size: 64px;
    color: var(--color-pink);
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
        text-shadow: 0 0 20px var(--color-rose);
    }

    100% {
        transform: scale(1);
    }
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(49, 41, 76, 0.95);
    border: 1px solid var(--glass-border);
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    opacity: 0;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Feature Card Interactions */
.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(236, 186, 208, 0.3);
}

.feature-card:hover .icon-box {
    background: rgba(236, 186, 208, 0.2);
    transform: scale(1.1);
}

.feature-card .icon-box {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.feature-card:hover i {
    animation: iconPulse 1s infinite;
}

@keyframes iconPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
        filter: drop-shadow(0 0 5px var(--color-pink));
    }

    100% {
        transform: scale(1);
    }
}

/* Staggered Animation Entry (Optional - if using JS observer later) */
.feature-card {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.feature-card:nth-child(1) {
    animation-delay: 0.1s;
}

.feature-card:nth-child(2) {
    animation-delay: 0.2s;
}

.feature-card:nth-child(3) {
    animation-delay: 0.3s;
}

.feature-card:nth-child(4) {
    animation-delay: 0.4s;
}

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

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

/* 2x2 Grid Layout for Features */
@media (min-width: 768px) {
    .features-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        max-width: 900px !important;
        margin: 0 auto !important;
        gap: 40px !important;
    }
}

/* Quote Section Animations */
#quote blockquote {
    position: relative;
    z-index: 1;
}

#quote .quote-container {
    transition: transform 0.5s ease;
}

#quote:hover .quote-container {
    transform: scale(1.02);
}

#quote i {
    animation: float 6s ease-in-out infinite;
}

/* Manual Check Section Styles */
.result {
    border-radius: 12px;
    animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.result.normal {
    background: rgba(76, 209, 55, 0.1);
    border: 1px solid rgba(76, 209, 55, 0.3);
    color: #4cd137;
}

.result.elevated {
    background: rgba(229, 142, 38, 0.1);
    border: 1px solid rgba(229, 142, 38, 0.3);
    color: #ffd32a;
}

.result.high {
    background: rgba(235, 77, 75, 0.1);
    border: 1px solid rgba(235, 77, 75, 0.3);
    color: #ff5e57;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    60% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

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

/* AI Chat Styles */
.message {
    font-size: 15px;
    animation: fadeIn 0.3s ease-out;
}

.message.user {
    align-self: flex-end;
    text-align: right;
    max-width: 80%;
}

.message.user div {
    background: linear-gradient(135deg, var(--color-rose), var(--color-pink));
    color: white;
    padding: 12px 20px;
    border-radius: 20px 20px 5px 20px;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(178, 86, 129, 0.3);
}

/* Profile Badges */
.badges span {
    backdrop-filter: blur(5px);
}

/* 📚 HEALTH MANUAL INTERACTIVE STYLES */
.manual-nav-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ccc;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease-in-out;
}
.manual-nav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-color: rgba(236, 186, 208, 0.3);
}
.manual-nav-btn.active {
    background: linear-gradient(135deg, var(--color-rose), var(--color-pink));
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(178, 86, 129, 0.4);
}

.manual-details {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.manual-details[open] {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(236, 186, 208, 0.25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.manual-details summary {
    padding: 15px 20px;
    font-weight: 600;
    color: #eee;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    outline: none;
    user-select: none;
}
.manual-details summary::-webkit-details-marker {
    display: none;
}
.manual-details summary::after {
    content: "＋";
    font-size: 14px;
    color: var(--color-pink);
    transition: transform 0.2s ease;
}
.manual-details[open] summary::after {
    content: "－";
    color: var(--color-light-pink);
}
.manual-details p {
    padding: 0 20px 20px 20px;
    color: #ccc;
    font-size: 14.5px;
    line-height: 1.6;
}

/* 💬 MEDBOT HEALTH CHAT STYLES */
.suggestion-chip {
    background: rgba(236, 186, 208, 0.08);
    border: 1px solid rgba(236, 186, 208, 0.15);
    color: var(--color-light-pink);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 8px;
    outline: none;
}
.suggestion-chip:hover {
    background: rgba(236, 186, 208, 0.15);
    border-color: var(--color-pink);
    color: white;
    transform: translateY(-1px);
}
.suggestion-container {
    margin-top: 10px;
    padding: 0 10px;
    display: flex;
    flex-wrap: wrap;
}

/* Typing Indicator Animation */
.dot-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 5px;
}
.dot-typing span {
    width: 6px;
    height: 6px;
    background-color: var(--color-light-pink);
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.4s infinite ease-in-out both;
}
.dot-typing span:nth-child(1) { animation-delay: -0.32s; }
.dot-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* 📊 OPTIMA DATA CUSTOM STYLES */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-normal {
    background: rgba(46, 213, 115, 0.15);
    border: 1px solid rgba(46, 213, 115, 0.3);
    color: #2ed573;
}

.badge-elevated {
    background: rgba(255, 165, 2, 0.15);
    border: 1px solid rgba(255, 165, 2, 0.3);
    color: #ffa502;
}

.badge-high {
    background: rgba(255, 71, 87, 0.15);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: #ff4757;
}

.badge-low {
    background: rgba(30, 144, 255, 0.15);
    border: 1px solid rgba(30, 144, 255, 0.3);
    color: #1e90ff;
}

#optimaTableBody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

#optimaTableBody td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================
   🎙️ MEDBOT CONVERSATIONAL & VOICE STYLES
   ========================================== */

/* Voice Input Microphone Button */
.voice-mic-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-light-pink);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    flex-shrink: 0;
    outline: none;
}

.voice-mic-btn:hover {
    background: rgba(220, 130, 163, 0.2);
    border-color: var(--color-pink);
    color: white;
    transform: scale(1.05);
}

.voice-mic-btn.listening {
    background: linear-gradient(135deg, #ff4757, var(--color-pink)) !important;
    border-color: #ff4757 !important;
    color: white !important;
    animation: micPulse 1.5s infinite;
}

@keyframes micPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7);
    }
    70% {
        box-shadow: 0 0 0 14px rgba(255, 71, 87, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0);
    }
}

/* Voice Live Status Banner */
.voice-live-banner {
    display: none;
    padding: 10px 20px;
    margin: 0 20px 10px 20px;
    border-radius: 30px;
    background: rgba(220, 130, 163, 0.12);
    border: 1px solid rgba(220, 130, 163, 0.25);
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: space-between;
    animation: fadeIn 0.3s ease;
}

.voice-pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ff4757;
    display: inline-block;
    animation: dotPulse 1.2s infinite ease-in-out;
}

@keyframes dotPulse {
    0%, 100% {
        transform: scale(0.85);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
        box-shadow: 0 0 8px #ff4757;
    }
}

/* TTS Speech Play / Stop Button inside Message Bubbles */
.tts-play-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ccc;
    border-radius: 14px;
    padding: 4px 10px;
    font-size: 11.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    transition: all 0.2s ease;
    outline: none;
}

.tts-play-btn:hover {
    background: rgba(220, 130, 163, 0.2);
    border-color: var(--color-pink);
    color: white;
}

.tts-play-btn.speaking {
    background: rgba(255, 71, 87, 0.15) !important;
    border-color: #ff4757 !important;
    color: #ff7675 !important;
    animation: speakPulse 1.5s infinite;
}

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

/* Header Control Buttons */
.ai-ctrl-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ccc;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    outline: none;
}

.ai-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(236, 186, 208, 0.3);
}

.ai-ctrl-btn.active {
    background: linear-gradient(135deg, var(--color-rose), var(--color-pink));
    border-color: transparent;
    color: white;
    box-shadow: 0 2px 10px rgba(178, 86, 129, 0.4);
}

.voice-badge {
    font-size: 12px;
    color: var(--color-light-pink);
    background: rgba(220, 130, 163, 0.1);
    border: 1px solid rgba(220, 130, 163, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Mobile Responsiveness for AI chat */
@media (max-width: 600px) {
    #chatForm {
        gap: 8px !important;
    }
    .voice-mic-btn, #chatSendBtn {
        width: 44px !important;
        height: 44px !important;
    }
    #chatInput {
        padding: 12px 16px !important;
        font-size: 14px !important;
    }
    .voice-live-banner {
        margin: 0 10px 10px 10px;
        padding: 8px 14px;
    }
}