/* ====================================
   GLASSMORPHISM ULTRA-INTERACTIVE SYSTEM
   Inspired by modern music streaming apps
   ==================================== */

:root {
    /* === COLOR HIERARCHY === */
    /* Drug Categories */
    --color-supplement: #10B981;
    /* Green for supplements */
    --color-chronic: #3B82F6;
    /* Blue for chronic medications */
    --color-specialist: #8B5CF6;
    /* Purple for specialist drugs */
    --color-antibiotic: #F59E0B;
    /* Amber for antibiotics */
    --color-analgesic: #EF4444;
    /* Red for analgesics */

    /* Mood Themes */
    --color-urgency: #EF4444;
    /* Red alert for urgency mode */
    --color-general: #60A5FA;
    /* Blue calm for general consultation */

    /* Glassmorphism Base */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-bg-dark: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --glass-shadow-hover: 0 15px 50px rgba(0, 0, 0, 0.12);

    /* Blur Effects */
    --blur-light: blur(10px);
    --blur-medium: blur(20px);
    --blur-heavy: blur(30px);

    /* Border Radius */
    --radius-sm: 16px;
    --radius-md: 24px;
    --radius-lg: 32px;
    --radius-xl: 40px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-index layers */
    --z-base: 1;
    --z-floating: 10;
    --z-modal: 100;
    --z-tooltip: 1000;
}

/* === GLASSMORPHIC CARD BASE === */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--blur-medium);
    -webkit-backdrop-filter: var(--blur-medium);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.8) 50%,
            transparent);
    opacity: 0.7;
}

.glass-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--glass-shadow-hover);
}

/* === DRUG CARD VARIANTS WITH CATEGORY COLORS === */
.drug-card {
    position: relative;
    padding: 1.5rem;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.drug-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--category-color, #888);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.drug-card:hover::after {
    opacity: 1;
}

/* Category-specific styling */
.drug-card[data-category="supplement"] {
    --category-color: var(--color-supplement);
    --category-glow: rgba(16, 185, 129, 0.3);
}

.drug-card[data-category="chronic"] {
    --category-color: var(--color-chronic);
    --category-glow: rgba(59, 130, 246, 0.3);
}

.drug-card[data-category="specialist"] {
    --category-color: var(--color-specialist);
    --category-glow: rgba(139, 92, 246, 0.3);
}

.drug-card[data-category="antibiotic"] {
    --category-color: var(--color-antibiotic);
    --category-glow: rgba(245, 158, 11, 0.3);
}

.drug-card[data-category="analgesic"] {
    --category-color: var(--color-analgesic);
    --category-glow: rgba(239, 68, 68, 0.3);
}

/* Hover glow effect with category color */
.drug-card:hover {
    box-shadow: 0 10px 40px var(--category-glow),
        var(--glass-shadow-hover);
    transform: translateY(-8px) scale(1.05);
}

/* === FLOATING SEARCH BAR === */
.floating-search {
    background: var(--glass-bg-dark);
    backdrop-filter: var(--blur-heavy);
    -webkit-backdrop-filter: var(--blur-heavy);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 1rem 2rem;
    position: relative;
    z-index: var(--z-floating);
}

.floating-search::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.8),
            rgba(255, 255, 255, 0.2));
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.floating-search:focus-within::before {
    opacity: 1;
}

.floating-search input {
    background: transparent;
    border: none;
    outline: none;
    font-size: 1.25rem;
    color: #1a1a1a;
    width: 100%;
}

.floating-search input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

/* === ORBITAL RESULTS CONTAINER === */
.orbital-results {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 1rem;
    width: 500px;
    max-width: 90vw;
    perspective: 1000px;
}

.orbital-item {
    position: absolute;
    animation: orbit 15s linear infinite;
    transform-style: preserve-3d;
}

@keyframes orbit {
    from {
        transform: rotate(0deg) translateX(150px) rotate(0deg);
    }

    to {
        transform: rotate(360deg) translateX(150px) rotate(-360deg);
    }
}

.orbital-item:nth-child(1) {
    animation-delay: 0s;
}

.orbital-item:nth-child(2) {
    animation-delay: -3s;
}

.orbital-item:nth-child(3) {
    animation-delay: -6s;
}

.orbital-item:nth-child(4) {
    animation-delay: -9s;
}

.orbital-item:nth-child(5) {
    animation-delay: -12s;
}

/* === MOOD SELECTOR === */
.mood-selector {
    display: flex;
    gap: 1rem;
    padding: 0.5rem;
    background: var(--glass-bg);
    backdrop-filter: var(--blur-medium);
    -webkit-backdrop-filter: var(--blur-medium);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
}

.mood-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: transparent;
    position: relative;
    overflow: hidden;
}

.mood-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: currentColor;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.mood-btn:hover::before {
    opacity: 0.1;
}

.mood-btn.active::before {
    opacity: 0.15;
}

.mood-btn[data-mood="general"] {
    color: var(--color-general);
    border: 2px solid var(--color-general);
}

.mood-btn[data-mood="general"].active {
    background: var(--color-general);
    color: white;
    box-shadow: 0 5px 20px rgba(96, 165, 250, 0.4);
}

.mood-btn[data-mood="urgency"] {
    color: var(--color-urgency);
    border: 2px solid var(--color-urgency);
}

.mood-btn[data-mood="urgency"].active {
    background: var(--color-urgency);
    color: white;
    box-shadow: 0 5px 20px rgba(239, 68, 68, 0.4);
}

/* === QUICK ACTION BAR === */
.quick-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--glass-bg-dark);
    backdrop-filter: var(--blur-heavy);
    -webkit-backdrop-filter: var(--blur-heavy);
    border-top: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    z-index: var(--z-floating);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform var(--transition-slow);
}

.quick-action-bar.visible {
    transform: translateY(0);
}

.selected-drug-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 250px;
}

.selected-drug-preview img {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.quick-actions {
    display: flex;
    gap: 1rem;
    flex: 1;
}

.quick-actions button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: var(--blur-light);
    -webkit-backdrop-filter: var(--blur-light);
}

.quick-actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* === CATEGORY BADGE === */
.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--category-color);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* === POSOLOGY CASCADE BUBBLES === */
.posology-bubble {
    position: absolute;
    padding: 0.75rem 1.25rem;
    background: var(--glass-bg-dark);
    backdrop-filter: var(--blur-medium);
    -webkit-backdrop-filter: var(--blur-medium);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    animation: bubble-cascade 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
    pointer-events: none;
    z-index: var(--z-tooltip);
}

@keyframes bubble-cascade {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.posology-bubble:nth-child(2) {
    animation-delay: 0.1s;
}

.posology-bubble:nth-child(3) {
    animation-delay: 0.2s;
}

.posology-bubble:nth-child(4) {
    animation-delay: 0.3s;
}

/* === PARTICLE BURST EFFECT === */
.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--category-color);
    pointer-events: none;
    animation: particle-burst 0.8s ease-out forwards;
}

@keyframes particle-burst {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* === SIDE PANEL === */
.medical-categories-panel {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    background: var(--glass-bg-dark);
    backdrop-filter: var(--blur-heavy);
    -webkit-backdrop-filter: var(--blur-heavy);
    border-right: 1px solid var(--glass-border);
    padding: 2rem 1.5rem;
    z-index: var(--z-floating);
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.05);
}

.medical-categories-panel h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 50%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.medical-categories-panel nav a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: #4b5563;
    font-weight: 600;
    transition: all var(--transition-fast);
    margin-bottom: 0.5rem;
}

.medical-categories-panel nav a:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateX(5px);
}

.medical-categories-panel nav a.active {
    background: rgba(139, 92, 246, 0.1);
    color: var(--color-specialist);
}

/* === FLOATING ANIMATION === */
@keyframes float-smooth {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.float-animation {
    animation: float-smooth 3s ease-in-out infinite;
}

/* === GLOW PULSE === */
@keyframes glow-pulse {

    0%,
    100% {
        box-shadow: 0 0 20px var(--category-glow);
    }

    50% {
        box-shadow: 0 0 40px var(--category-glow);
    }
}

.glow-pulse {
    animation: glow-pulse 2s ease-in-out infinite;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .medical-categories-panel {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }

    .orbital-results {
        width: 90vw;
    }
}

/* === THEME VARIATIONS === */
body[data-mood="urgency"] {
    --glass-bg: rgba(254, 242, 242, 0.75);
    --glass-bg-dark: rgba(254, 242, 242, 0.85);
}

body[data-mood="urgency"] .glass-card {
    border-color: rgba(239, 68, 68, 0.2);
}

body[data-mood="general"] {
    --glass-bg: rgba(239, 246, 255, 0.75);
    --glass-bg-dark: rgba(239, 246, 255, 0.85);
}

body[data-mood="general"] .glass-card {
    border-color: rgba(96, 165, 250, 0.2);
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
