* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 30px 15px;
    font-family: Arial, sans-serif;
    background: #1c0f24;
    color: #f1f3f5;
}

.container {
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    margin: 0 0 8px;
    font-size: 32px;
}

.subtitle {
    text-align: center;
    color: #A47BAA;
    margin-bottom: 25px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.card {
    background: #35154A;
    padding: 14px;
    margin: 12px 0;
    border-radius: 12px;
    border: 1px solid #4A1C5C;
}

.stats .card {
    margin: 0;
    min-height: 100px;
}

.card h2 {
    margin-top: 0;
    font-size: 18px;
}

.card p {
    margin: 8px 0;
}

select {
    width: 100%;
    padding: 12px;
    margin-top: 5px;
    border: 1px solid #4A1C5C;
    border-radius: 9px;
    background: #24102F;
    color: #f1f3f5;
    font-size: 16px;
}

#caffeineAmount {
    color: #A47BAA;
}

#addDrink {
    width: 100%;
    margin-top: 8px;
    padding: 13px;
    border: none;
    border-radius: 9px;
    background: #5B2473;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

#addDrink:hover {
    opacity: 0.9;
}

.drink {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    margin: 8px 0;
    background: #24102F;
    border-radius: 9px;
    border: 1px solid #4A1C5C;
}

.drink button {
    width: auto;
    padding: 7px 10px;
    border: 1px solid #6E3A82;
    border-radius: 7px;
    background: #6E3A82;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.drink button:hover {
    opacity: 0.85;
}

@media (max-width: 600px) {
    .stats {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 28px;
    }
}

.today-card {
    padding: 20px;
    border-width: 2px;
}

.today-card h2 {
    font-size: 22px;
}

.today-card p {
    margin: 8px 0;
    font-size: 17px;
}

.stats .card h2 {
    margin-bottom: 14px;
}

.stats .card p {
    margin: 6px 0;
}

#drinkList {
    max-height: 300px;
    overflow-y: auto;
}

#resetDrinks {
    width: 100%;
    margin-top: 8px;
    padding: 11px;
    border: 1px solid #6E3A82;
    border-radius: 9px;
    background: #35154A;
    color: #A47BAA;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}

#resetDrinks:hover {
    opacity: 0.85;
}

#drinkList h3 {
    margin: 18px 0 8px;
    padding-bottom: 6px;
    color: #A47BAA;
    font-size: 15px;
    border-bottom: 1px solid #4A1C5C;
}

#drinkList h3:first-child {
    margin-top: 0;
} 

#historySearch {
    width: 100%;
    padding: 12px;
    margin: 4px 0 12px;
    border: 1px solid #4A1C5C;
    border-radius: 9px;
    background: #24102F;
    color: #f1f3f5;
    font-size: 16px;
    outline: none;
}

#historySearch:focus {
    border-color: #6E3A82;
}

#historySearch::placeholder {
    color: #A47BAA;
}

.hidden-select {
    display: none;
}

.drink-picker-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    margin-top: 5px;
    border: 1px solid #4A1C5C;
    border-radius: 9px;
    background: #24102F;
    color: #f1f3f5;
    font-size: 16px;
    text-align: left;
}

.drink-picker-trigger:hover {
    border-color: #6E3A82;
}

.selected-drink-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
}

.selected-drink-img.hidden {
    display: none;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background: #24102F;
    border: 1px solid #4A1C5C;
    border-radius: 14px;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 18px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.modal-close-btn {
    background: none;
    border: none;
    color: #A47BAA;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 0 6px;
}

.modal-close-btn:hover {
    color: #f1f3f5;
}

#drinkModalSearch {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #4A1C5C;
    border-radius: 9px;
    background: #35154A;
    color: #f1f3f5;
    font-size: 16px;
    outline: none;
}

#drinkModalSearch:focus {
    border-color: #6E3A82;
}

.drink-modal-grid {
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding-right: 4px;
}

@media (max-width: 500px) {
    .drink-modal-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.drink-option-group {
    grid-column: 1 / -1;
    margin: 10px 0 2px;
    color: #A47BAA;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #4A1C5C;
    padding-bottom: 4px;
}

.drink-option-group:first-child {
    margin-top: 0;
}

.drink-option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px;
    background: #35154A;
    border: 1px solid #4A1C5C;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
}

.drink-option-card:hover {
    border-color: #6E3A82;
}

.drink-option-card.no-match {
    display: none;
}

.drink-option-card img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.drink-option-card span {
    font-size: 12px;
    line-height: 1.3;
}
