/* ------------------------- */
/* GLOBAL & TYPOGRAPHY */
/* ------------------------- */
:root {
    --color-background: #121212; /* Mörk bakgrund */
    --color-surface: #1E1E1E;   /* Kortare kort/innehållsytor */
    --color-text-primary: #E0E0E0; /* Ljus text */
    --color-text-secondary: #A0A0A0; /* Sekundär text (beskrivningar) */
    --color-accent: #00C4CC;    /* Huvudaccentfärg (turkos/cyan) */
    --color-accent-light: #66FFFF; /* Ljusare accent för hover/highlights */
    --radius: 12px;
    --shadow-depth: 0 6px 15px rgba(0, 196, 204, 0.2); /* Accent-skugga */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Smooth transition för alla element */
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--color-background);
    color: var(--color-text-primary);
    /* Säkerställer att appen tar upp hela skärmhöjden på mobil */
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

/* ------------------------- */
/* APP CONTAINER (MOBIL-FÖRST) */
/* ------------------------- */
#app {
    width: 100%; /* Tar upp hela bredden på mobilen */
    max-width: 500px; /* Maxbredd för att se bra ut på större skärmar */
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 20px; /* Avstånd mellan huvudkomponenter */
}

/* ------------------------- */
/* HEADER */
/* ------------------------- */
.app-header {
    text-align: center;
    padding: 15px 0;
    border-bottom: 2px solid var(--color-accent);
}

.app-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 5px;
}

.app-header p {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    font-weight: 300;
}

/* ------------------------- */
/* CONTENT AREA & VIEWS */
/* ------------------------- */
#content-area {
    flex-grow: 1; /* Låter innehållsytan ta upp all tillgänglig plats */
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.view {
    width: 100%;
    min-height: 70vh; /* Minimerar höjden för att det ska se bra ut */
    padding: 0;
}

.view:not(.active) {
    display: none; /* Dölj oaktiva vyer */
}

/* ------------------------- */
/* DRUG LIST VIEW (LÄGE 1: LISTA) */
/* ------------------------- */
#drug-list-view {
    display: flex;
    flex-direction: column;
    gap: 12px; /* Små luckor mellan drogarna */
}

.drug-card {
    background-color: var(--color-surface);
    padding: 15px 20px;
    border-radius: var(--radius);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    border-left: 5px solid var(--color-accent); /* Stark visuell ledtråd */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drug-card:hover {
    transform: translateY(-3px); /* Subtil upphöjning vid hover/tryck */
    box-shadow: var(--shadow-depth);
}

.drug-card.active {
    border-left: 5px solid var(--color-accent-light);
    transform: translateY(-2px);
}

.drug-info h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 3px;
}

.drug-info p {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.quick-effects span {
    font-size: 0.8rem;
    font-weight: 400;
    padding: 3px 8px;
    border-radius: 5px;
    margin-left: 5px;
}

.quick-effects .weak { background-color: rgba(0, 196, 204, 0.2); color: var(--color-accent); }
.quick-effects .normal { background-color: rgba(102, 255, 255, 0.2); color: var(--color-accent-light); }
.quick-effects .strong { background-color: rgba(255, 87, 51, 0.2); color: #FF5733; }

/* ------------------------- */
/* DRUG DETAIL VIEW (LÄGE 2: DETALJER) */
/* ------------------------- */
#drug-detail-view {
    padding: 0 10px;
}

.back-button {
    background: none;
    border: none;
    color: var(--color-accent);
    font-size: 1rem;
    font-weight: 600;
    padding: 10px 0;
    cursor: pointer;
    margin-bottom: 15px;
    display: block;
    width: 100%;
    text-align: left;
}

.back-button:hover {
    text-decoration: underline;
}

#detail-content {
    background-color: var(--color-surface);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-depth);
}

#detail-content h2 {
    font-size: 2rem;
    color: var(--color-accent-light);
    margin-bottom: 5px;
}

#detail-content .meta-info {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.effect-section {
    margin-bottom: 25px;
    padding-left: 15px;
    border-left: 3px solid var(--color-accent);
}

.effect-section h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--color-accent);
}

.effect-section p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--color-text-primary);
}

/* Styling för Specifika Effekter */
.effect-section.positive { border-left-color: #4CAF50; } /* Grönt */
.effect-section.negative { border-left-color: #F44336; } /* Rött */
.effect-section.dose-effects { border-left-color: #2196F3; } /* Blått */


/* ------------------------- */
/* FOOTER NAV (FÖR ÅTERFRÄSCHNING) */
/* ------------------------- */
.footer-nav {
    text-align: center;
    padding-top: 10px;
    border-top: 1px solid #333;
}

#refresh-button {
    background-color: var(--color-accent);
    color: var(--color-background);
    border: none;
    border-radius: 50%; /* Runda knappen */
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-depth);
    display: flex;
    align-items: center;
    justify-content: center;
}

#refresh-button:hover {
    transform: scale(1.05);
    background-color: var(--color-accent-light);
}

/* ------------------------- */
/* MEDIA QUERIES (För större skärmar - tablets/desktop) */
/* ------------------------- */
@media (min-width: 768px) {
    #app {
        padding: 30px 40px;
    }

    .app-header h1 {
        font-size: 2.8rem;
    }

    .drug-card {
        /* Gör korten bredare och mer utdragna på större skärmar */
        padding: 20px 30px;
        font-size: 1.05rem;
    }
}
