/* Reset default browser styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: #000;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: repeating-linear-gradient(45deg,
            rgba(255, 255, 255, 0.08) 0px,
            rgba(255, 255, 255, 0.08) 1px,
            transparent 1px,
            transparent 30px),
        linear-gradient(135deg, #000000, #0a0a0a);
    color: #ffffff;

    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 50px;
    padding-bottom: 50px;
    overflow-y: auto;
}

.container {
    text-align: center;
    padding: 20px;
    width: 100%;
    max-width: 800px;
}

header {
    margin-bottom: 30px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}



.header-buttons {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 10px;
    flex-direction: column;
    /* Stack on extremely small screens */
    align-items: flex-end;
}

/* Header Buttons */
.btn-login,
.btn-manage-users {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #aaa;
    font-size: 0.8rem;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-login:hover,
.btn-manage-users:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

.btn-manage-users {
    color: #74c0fc;
    /* Light blue to distinguish */
}


header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.2), 0 0 60px rgba(255, 255, 255, 0.1);
}

header p {
    font-size: 1.2rem;
    color: #e0e0e0;
    font-weight: 300;
    letter-spacing: 1px;
}

/* Controls & Form */
.controls {
    margin-bottom: 20px;
}

.add-drink-form {
    display: flex;
    /* Will be toggled by JS/CSS */
    gap: 15px;
    /* Increased gap */
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    align-items: center;
    /* Align checkbox vertically */
    padding: 15px;
}

/* Checkbox Style */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #fff;
    /* White check */
}

input:not([type="range"]):not([type="checkbox"]) {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    outline: none;
    transition: border-color 0.3s;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

input:focus {
    border-bottom-color: #fff;
}

button {
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    transition: transform 0.2s, background-color 0.3s;
    font-weight: 600;
}

button:active {
    transform: scale(0.98);
}

.btn-toggle {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-add {
    background: #fff;
    color: #000;
}

.btn-add:hover {
    background: #e0e0e0;
}

.btn-primary {
    background: #fff;
    color: #000;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
}

.btn-primary:hover {
    background: #ddd;
}

/* NEW BUTTONS */
.btn-generate {
    background: transparent;
    color: #fff;
    font-size: 0.9rem;
    padding: 15px 30px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    /* Pill shape */
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: none;
}

.btn-generate:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.1);
}

.btn-share {
    background: #fff;
    color: #000;
    font-size: 1rem;
    padding: 12px 25px;
    margin-top: 20px;
    margin-right: 10px;
    border-radius: 25px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.btn-share:hover {
    transform: scale(1.05);
    background: #f0f0f0;
}

.btn-back {
    margin-top: 20px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: #fff;
}


/* Drink List - Flex Layout */
.drink-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.drink-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    gap: 20px;
    flex-wrap: wrap;
    /* Allow wrapping for mobile */
    transition: background 0.3s;
}

/* PACK ITEM STYLE */
.drink-item.pack-item {
    background: rgba(0, 150, 255, 0.15);
    /* Blue tint for packs */
    border: 1px solid rgba(0, 150, 255, 0.3);
}

.pack-badge {
    font-size: 0.8rem;
    color: #74c0fc;
    font-weight: 400;
    margin-left: 5px;
}

.drink-name {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 100px;
    color: #fff;
}

/* Slider Container */
.drink-slider-container {
    flex-grow: 1;
    /* Take available space */
    display: flex;
    /* Fix vertical alignment */
    align-items: center;
}

/* Controls */
.drink-secondary {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Thin Slider Style */
.thin-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 2px;
    background: transparent;
    outline: none;
    cursor: pointer;
    margin: 10px 0;
    padding: 0;
    border: none;
}

/* Track */
.thin-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 1px;
    border: none;
}

/* Thumb */
.thin-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-top: -9px;
}

.thin-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

.stock-input {
    width: 60px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3) !important;
    /* Ensure override */
    border-bottom: none !important;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 500;
}

.btn-delete {
    background: transparent;
    color: rgba(255, 255, 255, 0.3);
    padding: 5px 10px;
    font-size: 1.5rem;
    line-height: 1;
}

.btn-delete:hover {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
}

/* ADMIN MODE UTILITY */
/* By default (guest), admin items are hidden */
.admin-only {
    display: none !important;
}

/* CSS Logic for permissions will be handled via JS adding classes to body 
   BUT standard approach is 'admin-can-add' 'admin-can-delete' classes on body 
   or just handling visibility entirely in JS render.
   Let's use JS render for delete buttons, and CSS for Add Form.
*/
body.can-add .add-drink-form {
    display: flex;
}

body:not(.can-add) .add-drink-form {
    display: none;
}


/* MODAL STYLES */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(20, 20, 20, 0.9);
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.modal-actions {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
}

/* USER MODAL STYLES */
.user-modal-content {
    background: rgba(20, 20, 20, 0.95);
    padding: 30px;
    border-radius: 15px;
    width: 95%;
    max-width: 500px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    text-align: left;
    max-height: 80vh;
    overflow-y: auto;
}

.user-modal-content h2 {
    text-align: center;
    margin-bottom: 20px;
}

.add-user-form {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.add-user-form input {
    margin-bottom: 10px;
    width: 100%;
}

.permissions-group {
    display: flex;
    gap: 15px;
    margin: 10px 0;
}

.user-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    border-radius: 5px;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-badges {
    display: flex;
    gap: 5px;
    margin-top: 3px;
}

.badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

.badge.active {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

.badge.admin {
    background: rgba(116, 192, 252, 0.2);
    color: #74c0fc;
}

.btn-remove-user {
    background: transparent;
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
    padding: 5px 10px;
    font-size: 0.8rem;
}

.btn-remove-user:hover {
    background: rgba(255, 107, 107, 0.1);
}


/* REPORT VIEW STYLES */
.report-container {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 20px;
    padding: 30px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.report-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.report-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 1.2rem;
}

.report-name {
    font-weight: 600;
}

.report-quantity {
    color: #4ade80;
    /* Green for quantity */
    font-weight: bold;
}

.report-quantity.pack-quantity {
    color: #74c0fc;
}


/* Responsive design */
@media (max-width: 600px) {
    header h1 {
        font-size: 2rem;
    }

    .header-buttons {
        flex-direction: row;
        /* Row on mobile is usually better if space allows, but let's stick to simple */
        position: relative;
        /* Unset absolute to flow naturally if needed, or keep absolute */
        top: auto;
        right: auto;
        justify-content: center;
        margin-bottom: 15px;
    }

    .add-drink-form {
        flex-direction: column;
    }

    /* Mobile Layout Transformation */
    .drink-item {
        /* No column direction, rely on wrap + order */
        justify-content: space-between;
        padding: 15px;
        gap: 10px;
    }

    .drink-name {
        order: 1;
        flex-grow: 1;
        /* Fill left space */
        width: auto;
    }

    .drink-secondary {
        order: 2;
        width: auto;
        /* Just take needed space */
    }

    .drink-slider-container {
        order: 3;
        width: 100%;
        /* Force new line */
        margin-top: 5px;
    }
}