/* ========================================
   1. GLOBAL STYLES & RESET
   ======================================== */
:root {
    /* Default Light Mode Variables */
    --color-background: #f4f4f9;
    --color-text: #333;
    --color-primary: #007bff;
    --color-secondary: #f0f0f0;
    --color-card-bg: #ffffff;
    --color-shadow: rgba(0, 0, 0, 0.1);
}

/* Dracula Theme Variables */
.theme-dracula {
    --color-background: #282a36;
    --color-text: #f8f8f2;
    --color-primary: #bd93f9; /* Purple */
    --color-secondary: #44475a;
    --color-card-bg: #21222c;
    --color-shadow: rgba(255, 255, 255, 0.05);
}

/* Dark Theme Variables */
.theme-dark {
    --color-background: #121212;
    --color-text: #e0e0e0;
    --color-primary: #bb86fc; /* Light purple accent */
    --color-secondary: #1e1e1e;
    --color-card-bg: #1e1e1e;
    --color-shadow: rgba(255, 255, 255, 0.05);
}

/* Synthwave Theme Variables */
.theme-synthwave {
    --color-background: #1a002e; /* Deep purple/blue */
    --color-text: #ffe0f0;
    --color-primary: #ff00ff; /* Neon Pink */
    --color-secondary: #00ffff; /* Cyan */
    --color-card-bg: #3a0066;
    --color-shadow: rgba(255, 0, 255, 0.5);
}

/* Matrix Theme Variables */
.theme-matrix {
    --color-background: #0a0a0a;
    --color-text: #00ff00; /* Bright Green */
    --color-primary: #00ff00;
    --color-secondary: rgba(0, 255, 0, 0.1);
    --color-card-bg: #050505;
    --color-shadow: rgba(0, 255, 0, 0.3);
}

/* ========================================
   2. BASE STYLING (Mobile First)
   ======================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--color-background);
    color: var(--color-text);
    transition: background-color 0.5s ease, color 0.5s ease;
    padding-bottom: 80px; /* Space for fixed footer/buttons if needed */
}

header {
    padding: 20px;
    text-align: center;
    background-color: var(--color-card-bg);
    box-shadow: 0 2px 10px var(--color-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-family: 'Orbitron', sans-serif;
    color: var(--color-primary);
    margin-bottom: 15px;
}

/* Theme Switcher */
.theme-switcher {
    padding: 10px;
    background: var(--color-secondary);
    border-radius: 8px;
}
#theme-select {
    padding: 8px;
    border-radius: 5px;
    border: 1px solid var(--color-primary);
    background: var(--color-background);
    color: var(--color-text);
}

/* Main Content Area */
#app-container {
    padding: 20px 15px;
    max-width: 1200px;
    margin: 0 auto;
}

h2 {
    text-align: center;
    margin: 30px 0 20px;
    color: var(--color-primary);
    font-family: 'Orbitron', sans-serif;
}

/* Disclaimer */
.disclaimer-box {
    background-color: #ffdd57; /* Warning yellow fallback */
    color: #333;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    border-left: 5px solid #d9a900;
}
/* Adjust disclaimer color for dark themes */
.theme-dark .disclaimer-box { background-color: #3c382f; color: #f8f8f2; }
.theme-synthwave .disclaimer-box { background-color: #8a00a8; color: #ffe0f0; }
.theme-matrix .disclaimer-box { background-color: #003300; color: #00ff00; }
.theme-dracula .disclaimer-box { background-color: #6272a4; color: #f8f8f2; }


/* Drug Grid (List View) */
.drug-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.drug-card {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-primary);
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 4px 15px var(--color-shadow);
    text-align: center;
}

.drug-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px var(--color-primary);
    border-color: var(--color-primary);
}

.drug-card h3 {
    font-size: 1.3em;
    margin-bottom: 5px;
    color: var(--color-primary);
}

.drug-card p {
    font-size: 0.9em;
    opacity: 0.8;
}


/* Details Panel (Modal/Overlay Style for mobile focus) */
.details-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
    animation: fadeIn 0.3s ease-out;
}

.details-panel.hidden {
    display: none;
}

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

#close-details {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2.5rem;
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    transition: transform 0.2s;
}
#close-details:hover {
    transform: scale(1.1);
}

.details-content {
    background-color: var(--color-card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 0 30px var(--color-primary);
    animation: slideUp 0.3s ease-out;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.details-content h2 {
    text-align: center;
    margin-bottom: 25px;
}

.dose-info, .effects-info {
    margin-bottom: 30px;
    padding: 15px;
    border-left: 4px solid var(--color-primary);
}

.dose-levels div {
    padding: 8px 0;
    border-bottom: 1px dashed var(--color-secondary);
}
.dose-levels div:last-child {
    border-bottom: none;
}

/* Effects List Styling */
.effect-block h4 {
    margin-top: 10px;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.effect-block ul {
    list-style: none;
    padding-left: 0;
}

.effect-block li {
    padding: 8px 0;
    border-bottom: 1px dotted var(--color-secondary);
    display: flex;
    align-items: center;
}

.effect-block li::before {
    content: "•";
    color: var(--color-primary);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

/* ========================================
   3. MEDIA QUERIES (Desktop Adjustments)
   ======================================== */
@media (min-width: 768px) {
    /* Larger screens can have more structured layout */
    .drug-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .details-content {
        max-width: 700px;
        margin: 50px auto; /* Center the details panel on desktop */
        padding: 40px;
    }
    #app-container {
        padding: 40px 20px;
    }
}
