:root {
    --color-bg-main: #0d001f;
    --color-bg-secondary: #1a001add;
    --color-bg-card: #1a001abb;
    --color-bg-card-alt: #1a001acc;
    --color-bg-button: rgba(0, 0, 50, 0.9);
    --color-bg-button-gradient-start: rgba(100, 0, 200, 0.6);
    --color-bg-button-gradient-end: rgba(10, 0, 30, 0.3);
    --color-bg-instructions: #1a001a6e;
    --color-bg-modal: #0d001f;
    --color-text-primary: #ff00ff;
    --color-text-secondary: #00ffff;
    --color-border-primary: #ff00ff;
    --color-border-secondary: #00ffff;
    --color-shadow-primary: #0000ff;
    --color-shadow-secondary: #00008b;
    --color-danger: rgba(255, 0, 255, 0.9);
    --color-bg-menu-section: rgba(25, 0, 40, 0.8);
    --color-bg-nav-buttons: rgba(20, 0, 40, 0.8);
    --color-bg-search-input: #000033;

    /* NEW: Background image variable */
    --bg-image: url('./images/background.jpg');
}


/* =========================
   USER INTERACTION
   ========================= */
.prevent-select {
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10 and IE 11 */
    user-select: none; /* Standard syntax */
}

/* =========================
   BASE HTML / BODY
   ========================= */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    font-family: 'Courier New', Courier, monospace;

    /* Background image setup */
    background-image: var(--bg-image);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed; /* keeps image in place while scrolling */

    /* Fallback background color (will show if image fails) */
    background-color: var(--color-bg-main);

    color: var(--color-text-primary);
}

::backdrop {
  background-image: url("./images/background.jpg");
  background-size: 105% 100%;
}  

/* =========================
   HAMBURGER MENU
   ========================= */
.hamburger-menu {
    z-index: 1001;
    width: 4%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 40%;
    margin: 10px 10px 10px 25px;
}

.hamburger-menu .bar {
    height: 7px;
    width: 100%;
    background-color: var(--color-text-secondary);
    border-radius: 5px;
}

/* =========================
   MENU
   ========================= */
#menu {
    display: none;
    z-index: 1000;
    width: 40%;
    max-height: 83%;
    border: .5vh outset var(--color-border-primary);
    background-color: var(--color-bg-secondary);
    position: absolute;
    top: 10vh;
    left: 1.25vw;
}

.menu-sections {
    cursor: pointer;
    margin: 6% 5%;
    padding: 2% 3%;
    font-size: 3vh;
    background-color: #00ffff20;
    border-radius: 20px;
}

/* =========================
   SCROLL CONTAINER
   ========================= */
#scrollContainer {
    width: 100%;
}

/* =========================
   QR CODE
   ========================= */
#qrDiv {
    height: 100%;
}

#qrTitle {
    color: var(--color-text-secondary);
    text-shadow: 10px 10px 10px var(--color-shadow-primary);
    text-align: center;
}

#qrImgDiv {
    height: 80%;
    display: flex;
    justify-content: center;
}

#qrCode {
    border: 1px solid var(--color-text-secondary);
    box-shadow: 5px 5px 10px var(--color-shadow-secondary);
    height: 100%;
    margin: auto;
}

/* =========================
   DRINK LIST
   ========================= */
#drinkList {
    margin: 0;
    width: 100%;
    background-color: var(--color-bg-card);
}

.letter-section {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center everything inside the letter section */
    margin-bottom: 2vh;  /* Optional spacing between letters */
}

.letter-header {
    font-size: 5vh;
    text-align: center;
    margin-bottom: 1vh;
    color: var(--color-text-primary) !important;
}

.drink-list {
    list-style: none;
    padding: 0;
    margin: 4vh 0;
    display: flex;
    flex-direction: column;
    align-items: center; /* Center each drink item under the letter */
    font-size: 4vh;
    color: var(--color-text-secondary);
}

/* =========================
   BATCH CARDS
   ========================= */
.batch-cards {
    border: .5vh solid var(--color-border-primary);
    background-color: var(--color-bg-card-alt);
    color: var(--color-text-primary);
    padding: 2vh;
    margin: 2%;
    width: 45%;
    min-width: 300px;
    max-width: 600px;
    box-shadow: 0 0 15px var(--color-shadow-primary);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    transition: transform 0.2s ease;
}

.batch-cards:hover {
    transform: scale(1.02);
}

.batch-cards h2 {
    text-align: center;
    font-size: 3vh;
    font-weight: 700;
    margin-bottom: 1vh;
    padding-bottom: 1vh;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-text-secondary);
    text-shadow: 1px 1px 3px var(--color-text-primary);
}

.batch-cards ul {
    padding-left: 1.5rem;
    margin-top: 1vh;
}

.batch-cards li {
    margin: 0.5vh 0;
    font-size: 1.9vh;
    line-height: 1.4;
    word-wrap: break-word;
    color: var(--color-text-primary);
}

.batch-cards .alt-title {
    margin-top: 1vh;
    font-weight: 600;
    text-decoration: underline;
    font-size: 2vh;
    color: var(--color-text-secondary);
}

@media screen and (max-width: 800px) {
    .batch-cards {
        width: 90%;
        min-width: unset;
        margin: 1% auto;
    }
    .batch-cards h2 {
        font-size: 2.5vh;
    }
    .batch-cards li, .batch-cards .alt-title {
        font-size: 1.7vh;
    }
}

/* =========================
   SCROLLBAR HIDING
   ========================= */
#mainContainer, #scrollContainer::-webkit-scrollbar {
    display: none;
}

#mainContainer, #scrollContainer {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* =========================
   ALPHABET NAV
   ========================= */
#alphabetNav {
    margin: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    user-select: none;
    cursor: pointer;
    background: inherit;
    padding: 5px 0;
}

#alphabetNav span {
    width: 100%;
    color: var(--color-text-primary);
    font-size: 3vh;
    flex-grow: 1;
    text-align: center;
    transition: color 0.3s ease;
}

#alphabetNav span:hover {
    color: var(--color-text-secondary);
}

/* =========================
   BUTTONS
   ========================= */
button.missing {
    opacity: 0.5;
    color: var(--color-text-primary);
}

button {
    border: .5vh outset var(--color-border-primary);
    box-shadow: 0 0 15px var(--color-shadow-primary);
    background-color: var(--color-bg-button);
    background-image: linear-gradient(var(--color-bg-button-gradient-start), var(--color-bg-button-gradient-end));
    margin: 1%;
    width: 45vw;
    height: 9vh;
    font-size: 3vh;
    cursor: pointer;
    color: var(--color-text-primary);
    position: relative;
}

.nav-buttons {
    background-color: var(--color-bg-nav-buttons);
    color: var(--color-text-secondary);
    /* border-radius: 30px; */
}

.drink-buttons {
    border: .5vh outset var(--color-border-primary);
    padding: 1.25%;
    width: 16vw;
    height: 20vh;
    border-radius: 10%;
    background-color: var(--color-bg-card);
    color: var(--color-text-secondary);
}

.missing-ingredient {
    font-size: 2vh;
    background-color: var(--color-danger);
    padding: 1vh;
    position: absolute;
    top: 150px;
    right: 15px;
    height: 3vh;
    width: fit-content;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
}

/* =========================
   NAVIGATION LAYOUT
   ========================= */
#cocktails,
#originals {
    width: 47%;
    height: 10vh;
}

#searchDrinks {
    width: 96%;
    height: 10vh;
}

#topNav,
#bottomNav {
    padding: .1%;
    width: 100%;
    height: 10%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#topNav {
    width: 98%;
    padding-right: 2%;
}

/* =========================
   MAIN CONTAINER
   ========================= */
#mainContainer {
    border-top: .5vh outset var(--color-border-primary);
    border-bottom: .5vh outset var(--color-border-primary);
    background-color: var(--color-bg-instructions);
    box-shadow: 0 0 15px var(--color-shadow-primary);
    width: 100%;
    height: 75%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    overflow: auto;
}

/* =========================
   DRINK INFO / RECIPE
   ========================= */

#searchDiv {
    margin: 0%;
    width: 95%;
    height: 15%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#searchInput {
    width: 80%;
    padding: 1%;
    font-size: 2.5vh;
    color: var(--color-text-primary);
    background-color: var(--color-bg-search-input);
}

#clearButton {
    width: 10vw;
    height: 7vh;
    color: var(--color-text-primary);
    background-color: var(--color-bg-search-input);
}

#searchListDiv {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 95%;
    height: 80%;
    overflow: auto;
}

.error-message {
    font-size: 6vh;
    font-weight: bold;
    text-shadow: 0 0 15px var(--color-shadow-primary);
    color: var(--color-text-primary);
}

/* =========================
   DRINK INFO / RECIPE (continued)
   ========================= */
#drinkInfoContainer {
    width: 100%;
    height: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

#cardTitle {
    border-bottom: .5vh inset var(--color-border-primary);
    background-color: var(--color-bg-instructions);
    text-shadow: 0 0 15px var(--color-shadow-primary);
    width: 98%;
    height: 8vh;
    padding: 0 2%;
    text-align: center;
    font-size: 3vh;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--color-text-secondary);
}

#drinkInfo {
    width: 100%;
    height: 87%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.info-divs {
    width: 23%;
    height: 100%;
    color: var(--color-text-primary);
}

#drinkPhoto {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.drink-photo {
    border: 1px outset var(--color-text-secondary);
    box-shadow: 0 0 10px var(--color-shadow-primary);
    max-width: 20vw;
    max-height: 40vh;
    overflow: hidden;
}

#drinkRecipeDiv {
    border-left: .25vh outset var(--color-border-primary);
    border-right: .25vh outset var(--color-border-primary);
    width: 45%;
    height: 100%;
    font-size: 2.5vh;
    display: flex;
    text-align: center;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    overflow: auto;
    background-color: var(--color-bg-button);
    color: var(--color-text-secondary);
}

.recipe-div {
    width: 100%;
}

.recipe-title-div {
    display: flex;
}

.recipe-title {
    width: 22%;
    margin: 0 0 2% 4%;
    padding: 0%;
    display: block;
    text-align: left;
    color: var(--color-text-primary);
}

.drink-recipe {
    max-width: 100%;
    color: var(--color-text-secondary);
}

.recipe {
    max-width: 100%;
    margin: 0%;
    margin-bottom: 2%;
    display: block;
    text-align: left;
    cursor: pointer;
    color: var(--color-text-secondary);
}

/* =========================
   DRINK INSTRUCTIONS
   ========================= */
#drinkInstructionsDiv {
    background-color: var(--color-bg-instructions);
    display: block;
    flex-wrap: wrap;
    justify-content: center;
    overflow: auto;
    width: 30%;
    color: var(--color-text-secondary);
}

#drinkInstructionsTitle {
    border-bottom: .25vh inset var(--color-border-primary);
    border-top: .25vh inset var(--color-border-primary);
    width: 100%;
    height: fit-content;
    padding: 1vh 0;
    font-size: 2.25vh;
    font-weight: 600;
    text-align: center;
    color: var(--color-text-primary);
}

.instructions {
    text-align: left;
    margin: 8% 5%;
    font-size: 2vh;
    color: var(--color-text-secondary);
}

/* =========================
   MODAL
   ========================= */
#modalBG {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-bg-button);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    background: var(--color-bg-modal);
    padding: 2rem;
    border-radius: 12px;
    max-width: 80%;
    max-height: 80%;
    color: var(--color-text-secondary);
    font-family: sans-serif;
    box-shadow: 0 0 20px rgba(255,0,255,0.2);
    flex-wrap: wrap;
    overflow: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#modalTitleDiv {
    width: 100%;
    margin: 0%;
}

.modal-title {
    font-size: 2rem;
    margin: 0%;
    margin-bottom: 1rem;
    color: var(--color-text-primary);
    text-align: center;
}

.modal-flex {
    width: 100%;
    display: block;
}

.modal-image {
    display: block;
    margin: 0 auto;
    max-height: 60vh;
    max-width: 20vw;
    object-fit: contain;
    border-radius: 20px;
    border: 1px solid var(--color-text-secondary);
}

.modal-right {
    width: 80%;
    margin: auto;
}

.modal-description li {
    margin-top: 1.5rem;
    font-size: 1.5rem;
    line-height: 1.5;
    text-align: center;
    color: var(--color-text-secondary);
}

.modal-alternatives {
    margin-top: 2rem;
}

.modal-alt-title, .modal-desc-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-align: center;
    color: var(--color-text-primary);
    text-decoration: underline;
}

.modal-alt-list {
    list-style: none;
    padding: 0;
    text-align: center;
}

.modal-alt-list li {
    margin: 0.25rem 0 1.5rem;
    color: var(--color-text-secondary);
    font-size: 1.25rem;
}

/* =========================
   MEDIA QUERIES
   ========================= */
@media screen and (max-width: 800px) and (orientation: portrait) {
    .hamburger-menu {
        width: 8%;
        height: 32%;
        margin: 10px 10px 10px 15px;
    }

    .hamburger-menu .bar {
        background-color: var(--color-text-primary);
    }

    #menu {
        width: 80%;
        max-height: 85%;
        padding: 4vh 2vh;
    }

    .drink-list {
        font-size: 2.5vh;
        color: var(--color-text-secondary);
    }

    .menu-sections {
        padding: 3%;
        background-color: rgba(25, 0, 40, 0.8);
    }

    #qrCode {
        height: 80%;
        border-color: var(--color-text-secondary);
    }

    .under-construction {
        font-size: 3.5vh;
        color: var(--color-text-primary);
    }

    #drinkRecipeDiv {
        width: 96%;
        height: 64.5vh;
    }

    .info-divs {
        width: 96%;
        margin: 1% 0;
        color: var(--color-text-secondary);
    }

    #drinkInstructionsDiv {
        width: 96%;
        height: fit-content;
        order: 2;
        font-size: 2vh;
    }

    .drink-recipe {
        width: 75%;
        color: var(--color-text-secondary);
    }

    .recipe {
        max-width: 100%;
    }

    #drinkPhoto {
        height: fit-content;
        padding: 4% 0;
        order: 1;
    }

    .drink-photo {
        max-width: 90vw;
        border-color: var(--color-text-secondary);
    }

    .drink-buttons {
        width: 44vw;
        height: 13vh;
        padding: 3%;
        border-radius: 40px;
        color: var(--color-text-secondary);
        border-color: var(--color-border-primary);
        background-color: var(--color-bg-card);
    }

    #searchInput {
        width: 70%;
        color: var(--color-text-primary);
        background-color: #000033;
    }

    #clearButton {
        width: 20vw;
        height: 5vh;
        font-size: 2.5vh;
        color: var(--color-text-primary);
        background-color: #000033;
    }

    .error-message {
        font-size: 4vh;
        text-align: center;
        color: var(--color-text-primary);
    }
}

@media screen and (max-width: 1440px) and (orientation: portrait) {
    body {
        background-repeat: no-repeat;
        background-size: cover;
    }

    #drinkRecipeDiv {
        width: 96%;
        height: 64.5vh;
    }

    .info-divs {
        width: 96%;
        margin: 1% 0;
        color: var(--color-text-secondary);
    }

    #drinkInstructionsDiv {
        width: 96%;
        height: fit-content;
        order: 2;
    }

    .drink-recipe {
        margin-left: 4%;
        width: 100%;
        color: var(--color-text-secondary);
    }

    .recipe-title-div {
        display: flex;
        flex-wrap: wrap;
    }

    .recipe-title {
        font-size: 2.5vh;
        width: 100%;
        text-decoration: underline;
        color: var(--color-text-primary);
    }

    .recipe {
        max-width: 98%;
        color: var(--color-text-secondary);
    }

    #drinkPhoto {
        height: fit-content;
        padding: 4% 0;
        order: 1;
    }

    .drink-buttons {
        width: 44vw;
        height: 13vh;
        padding: 3%;
        border-radius: 40px;
        color: var(--color-text-secondary);
    }

    #searchInput {
        width: 70%;
    }

    #clearButton {
        width: 20vw;
        height: 5vh;
        font-size: 2.5vh;
    }

    .error-message {
        font-size: 4vh;
        text-align: center;
    }

    .modal-content {
        max-width: 90vw;
        color: var(--color-text-secondary);
        background-color: var(--color-bg-modal);
        box-shadow: 0 0 20px rgba(255,0,255,0.2);
    }

    .modal-image {
        max-height: 30vh;
        border: 1px solid var(--color-text-secondary);
    }
}

@media screen and (max-width: 3088px) and (orientation: landscape) {
    body {
        background-repeat: no-repeat;
        background-size: cover;
    }
}


@media screen and (orientation: portrait) {
    body {
        background-repeat: no-repeat;
        background-position: center center;
        background-size: auto 100%; /* height fills viewport, width auto */
    }

    ::backdrop {
        background-image: var(--bg-image);
        background-position: center center;
        background-size: auto 100%; /* match body behavior in fullscreen */
    }
}
