/*
 * Beer Board CSS Variables - Semantic Naming System
 * 
 * This stylesheet uses intuitive, context-based variable names instead of
 * Bootstrap-specific names. Variables are organized by feature area:
 * 
 * - BRAND COLORS: Core color palette (primary, success, danger, etc.)
 * - PAGE LAYOUT: Overall page structure (background, header)
 * - TAP CARDS: Beer tap display cards (number badge, price, beer name)
 * - BEER LIST TABLE: Available beers table
 * - NAVIGATION: Pagination controls
 * - MODALS/DIALOGS: Popup windows and overlays
 * - BUTTONS: Button styles (primary, success, danger)
 * - SWIPE ACTIONS: Mobile swipe gesture buttons
 * 
 * Bootstrap compatibility is maintained via mapped variables at the bottom
 * of the :root section.
 */

:root {
    /* ===== BRAND COLORS ===== */
    --brand-primary: #0d6efd;
    --brand-success: #28a745;
    --brand-danger: #dc3545;
    --brand-warning: #ffc107;
    --brand-info: #17a2b8;
    
    /* ===== PAGE LAYOUT ===== */
    --page-background: #f8f9fa;
    --page-header-background: #0d6efd;
    --page-header-text: #ffffff;
    
    /* ===== TAP CARDS ===== */
    --card-background: #ffffff;
    --card-border: #dee2e6;
    --card-shadow: rgba(0, 0, 0, 0.1);
    --card-border-radius: 0;
    
    /* Tap Number Badge */
    --tap-number-background: #0d6efd;
    --tap-number-text: #ffffff;
    
    /* Beer Name */
    --beer-name-text: #212529;
    
    /* Brewery Name */
    --brewery-text: #6c757d;
    
    /* Price Display */
    --price-text: #28a745;
    --price-background: transparent;
    
    /* ===== BEER LIST TABLE ===== */
    --table-header-background: #212529;
    --table-header-text: #ffffff;
    --table-row-hover: rgba(0, 0, 0, 0.075);
    
    /* ===== NAVIGATION (Pagination) ===== */
    --nav-link-color: #0d6efd;
    --nav-link-hover: #0056b3;
    --nav-active-background: #0d6efd;
    --nav-active-text: #ffffff;
    
    /* ===== MODALS / DIALOGS ===== */
    --dialog-background: #ffffff;
    --dialog-text: #212529;
    --dialog-header-text: var(--dialog-text);
    --dialog-body-text: var(--dialog-text);
    --dialog-header-background: #ffffff;
    --dialog-header-border: #dee2e6;
    --dialog-overlay-background: rgba(0, 0, 0, 0.5);

    /* ===== MODAL-SPECIFIC VARIABLES ===== */
    --edit-tap-modal-bg: var(--dialog-background);
    --edit-tap-modal-text: var(--dialog-text);
    --edit-tap-modal-header-text: var(--dialog-header-text);
    --edit-tap-modal-body-text: var(--dialog-body-text);
    --edit-tap-modal-header-bg: var(--dialog-header-background);
    --edit-tap-modal-header-border: var(--dialog-header-border);

    --beer-modal-bg: var(--dialog-background);
    --beer-modal-text: var(--dialog-text);
    --beer-modal-header-text: var(--dialog-header-text);
    --beer-modal-body-text: var(--dialog-body-text);
    --beer-modal-header-bg: var(--dialog-header-background);
    --beer-modal-header-border: var(--dialog-header-border);

    --beer-info-modal-bg: var(--dialog-background);
    --beer-info-modal-text: var(--dialog-text);
    --beer-info-modal-header-text: var(--dialog-header-text);
    --beer-info-modal-body-text: var(--dialog-body-text);
    --beer-info-modal-header-bg: var(--dialog-header-background);
    --beer-info-modal-header-border: var(--dialog-header-border);

    --price-modal-bg: var(--dialog-background);
    --price-modal-text: var(--dialog-text);
    --price-modal-header-text: var(--dialog-header-text);
    --price-modal-body-text: var(--dialog-body-text);
    --price-modal-header-bg: var(--dialog-header-background);
    --price-modal-header-border: var(--dialog-header-border);

    --manual-beer-modal-bg: var(--dialog-background);
    --manual-beer-modal-text: var(--dialog-text);
    --manual-beer-modal-header-text: var(--dialog-header-text);
    --manual-beer-modal-body-text: var(--dialog-body-text);
    --manual-beer-modal-header-bg: var(--dialog-header-background);
    --manual-beer-modal-header-border: var(--dialog-header-border);

    --confirm-modal-bg: var(--dialog-background);
    --confirm-modal-text: var(--dialog-text);
    --confirm-modal-header-text: var(--dialog-header-text);
    --confirm-modal-body-text: var(--dialog-body-text);
    --confirm-modal-header-bg: var(--dialog-header-background);
    --confirm-modal-header-border: var(--dialog-header-border);
    
    /* ===== BUTTONS ===== */
    --button-primary-background: #0d6efd;
    --button-primary-text: #ffffff;
    --button-primary-hover: #0b5ed7;
    
    --button-secondary-background: #6c757d;
    --button-secondary-text: #ffffff;
    --button-secondary-hover: #5a6268;
    
    --button-success-background: #28a745;
    --button-success-text: #ffffff;
    
    --button-danger-background: #dc3545;
    --button-danger-text: #ffffff;
    --button-danger-hover: #bb2d3b;
    
    /* ===== SWIPE ACTIONS / DRAG REVEAL ===== */
    --action-reveal-width: 240px;
    --action-button-gap: 8px;
    --action-button-radius: 8px;
    --action-button-radius: 0;
    --swipe-button-width: 60px;
    --swipe-stacked-offset: 2px;
    
    /* ===== REFRESH BUTTON ===== */
    --refresh-button-background: rgba(255, 255, 255, 0.2);
    --refresh-button-hover: rgba(255, 255, 255, 0.3);
    --refresh-button-text: #ffffff;
    
    /* ===== CARD GRID LAYOUT ===== */
    --card-grid-max-width: 768px;
    --card-grid-columns: 1;
    --card-grid-gap: 1rem;
    --card-grid-padding: 0;

    /* ===== TAP CONTROLS LAYOUT ===== */
    --tap-controls-max-width: 768px;
    --tap-controls-gap: 1rem;
    --tap-controls-padding: 0;
    --tap-controls-font-size: 14px;
    --tap-controls-icon-size: 28px;
    --tap-controls-icon-font-size: 14px;

    /* ===== FILTER/SORT BOTTOM SHEET ===== */
    --filter-sheet-max-height: 70vh;
    --sort-sheet-max-height: 60vh;
    --sheet-full-max-height: 100vh;
    --filter-sheet-padding: 16px;
    --filter-sheet-radius: 16px;
    
    /* ===== MODAL SCOPE DEFAULTS ===== */
    /* These get overridden per modal, but we need defaults */
    --modal-bg: #ffffff;
    --modal-header-text: #212529;
    --modal-body-text: #212529;
    --modal-header-bg: #ffffff;
    --modal-header-border: #dee2e6;

    /* ===== BEER INFO MODAL TEXT ===== */
    --beer-info-modal-brewery-text: #6c757d;
    --beer-info-modal-style-label-text: #6c757d;
    --beer-info-modal-abv-label-text: #6c757d;
    
    /* ===== BOOTSTRAP COMPATIBILITY ===== */
    /* Map Bootstrap vars to our semantic names */
    --bs-backdrop-bg: var(--dialog-overlay-background);
    --bs-backdrop-opacity: 1;
}

/* get rid of annoying padding under pagination nav */
.pagination {
    margin-bottom: 0;
}

body {
    font-size: 16px;
    line-height: 1.5;
    padding: 0px;
    background-color: var(--page-background);
}

/* Tap controls layout (Sort / Filters / Per Page) */
.tap-controls-row {
    display: flex;
    justify-content: center;
}

.tap-controls-grid {
    width: 100%;
    max-width: var(--tap-controls-max-width);
    display: grid;
    grid-template-columns: 0.8fr 0.8fr 1.4fr;
    gap: var(--tap-controls-gap);
    padding: 0 var(--tap-controls-padding);
    align-items: center;
}

.tap-controls-cell {
    display: flex;
    align-items: center;
    min-height: 36px;
    font-size: var(--tap-controls-font-size);
}

.tap-controls-left {
    justify-content: center;
}

.tap-controls-center {
    justify-content: center;
    position: relative;
}

.tap-controls-right {
    justify-content: center;
}

.sort-direction-btn {
    width: var(--tap-controls-icon-size);
    height: var(--tap-controls-icon-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    color: #333;
    padding: 0;
    font-size: var(--tap-controls-icon-font-size);
    line-height: 1;
    cursor: pointer;
}

.sort-direction-btn:hover {
    background: #f5f5f5;
}

.sort-direction-btn:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}
/* Compact button styling for tap controls */
#sort-controls .btn,
#filter-controls .btn {
    padding: 0.25rem 0.5rem;
    font-size: 12px;
    line-height: 1.2;
    height: auto;
    min-height: auto;
}

/* Highlight filters button when active */
#filterBtn.filters-active {
    background-color: var(--brand-danger);
    border-color: var(--brand-danger);
    color: white;
}

#filterBtn.filters-active:hover {
    background-color: var(--button-danger-hover);
    border-color: var(--button-danger-hover);
}
#filterOffcanvas {
    --sheet-max-height: var(--filter-sheet-max-height);
}

#sortOffcanvas {
    --sheet-max-height: var(--sort-sheet-max-height);
}

.filter-offcanvas {
    height: auto;
    max-height: var(--sheet-max-height, var(--filter-sheet-max-height));
    border-top-left-radius: var(--filter-sheet-radius);
    border-top-right-radius: var(--filter-sheet-radius);
    --bs-offcanvas-height: auto;
}

.filter-offcanvas .offcanvas-body {
    padding: var(--filter-sheet-padding);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.filter-sheet-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-sheet-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
}

.filter-sheet-actions .btn {
    flex: 1;
}

.bg-primary-custom {
    background-color: var(--page-header-background) !important;
    color: var(--page-header-text) !important;
}

/* === PAGE HEADER LAYOUT === */
.page-header-wrapper {
    padding: 1.5rem 1rem;
}

/* Title row: Title/Logo centered with user dropdown on right */
.page-header-title-row {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    
    /*height: 36px;*/
    /*min-height: 36px;*/
    
}

/* Combined logo + title layout */
.page-header-title-row.has-logo-with-title {
    gap: 1rem;
}

.page-header-title-row.has-logo-with-title .page-header-title {
    margin: 0;
    flex-shrink: 1;
}

.page-header-title {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.3;
    font-weight: 600;
}

/* Logo in header */
.page-header-logo {
    max-width: 100%;
    max-height: 70px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

/* User Avatar Dropdown - fixed position (top-right of viewport, matches hamburger symmetry) */
.header-user-dropdown {
    position: fixed;
    right: 0.75rem;
    top: 0.7rem;
    width: 36px;
    height: 36px;
    z-index: 1050; /* Above hamburger menu (z-index: 1000) */
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hide avatar when scrolled (controlled by JS) */
.header-user-dropdown.scrolled-hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.header-avatar-btn {
    background: transparent;
    border: none;
    color: var(--page-header-text, white);
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.header-avatar-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.header-avatar-btn:active {
    transform: scale(0.95);
}

.header-avatar-btn i {
    font-size: 36px;
}

/* Logout button in hamburger nav */
.admin-nav-logout {
    border: none;
    width: 100%;
    text-align: left;
    margin-top: auto; /* Push to bottom on mobile */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .page-header-wrapper {
        padding: 0.75rem 0.75rem 1.5rem 0.75rem;
        /*padding: 0.75rem 0.75rem 0.9rem 0.75rem;*/  
    }
    
    .page-header-top-row {
        margin-bottom: 0.5rem;
    }
    
    .page-header-title {
        font-size: 1.1rem;
    }
    
    .page-header-logo {
        max-height: 55px;
    }
    
    .page-header-title-row.has-logo-with-title {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Tablet and up */
@media (min-width: 768px) {
    .page-header-wrapper {
        padding: 1rem 1.5rem 1.5rem 1.5rem;
        /*padding: 1rem 1.5rem 0.9rem 1.5rem;*/
    }
    
    .page-header-title {
        font-size: 1.5rem;
    }
}

/* Beer Board Page - Reduce header height */
.beer-board-page .page-header-wrapper {
    padding: 0.75rem 1rem;
}

/* Beer Board Page - Hide hamburger by default (shown only when authenticated via JS) */
.beer-board-page .admin-nav-hamburger {
    display: none;
}

@media (max-width: 767px) {
    .beer-board-page .page-header-wrapper {
        padding: 0.75rem;
    }
}

@media (min-width: 768px) {
    .beer-board-page .page-header-wrapper {
        padding: 0.75rem 1.5rem;
    }
}

/* Admin Page - Tighter header spacing */
.admin-page .page-header-title-row {
    height: 36px;
    min-height: 36px;
}

@media (max-width: 767px) {
    .admin-page .page-header-wrapper {
        padding: 0.75rem 0.75rem 0.9rem 0.75rem;
    }
}

@media (min-width: 768px) {
    .admin-page .page-header-wrapper {
        padding: 1rem 1.5rem 0.9rem 1.5rem;
    }
}

.table-dark-custom {
    background-color: var(--table-header-background) !important;
    color: white;
}

.btn-primary {
    background-color: var(--button-primary-background) !important;
    border-color: var(--button-primary-background) !important;
    color: var(--button-primary-text) !important;
}

.btn-primary:hover {
    background-color: var(--button-primary-hover) !important;
    border-color: var(--button-primary-hover) !important;
    color: var(--button-primary-text) !important;
}

.page-link {
    color: var(--nav-link-color) !important;
}

.page-link:hover,
.page-link:focus {
    color: var(--nav-link-hover) !important;
}

.page-item.active .page-link,
.page-link.active {
    background-color: var(--nav-active-background) !important;
    border-color: var(--nav-active-background) !important;
    color: var(--nav-active-text) !important;
}

/* Refresh Button */
.refresh-button {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--refresh-button-text);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 10px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.refresh-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    color: var(--refresh-button-text);
    border-color: rgba(255, 255, 255, 0.5);
}

.refresh-button.spinning i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.admin-only {
    display: none;
}

.read-only-message {
    display: none;
}


/* Tap Card States - Higher specificity */
.tap-card.tap-card--empty {
    background: #f8f9fa !important;
    border: 2px dashed #dee2e6 !important;
    color: #6c757d;
    min-height: 80px; /* Reduced height for less obtrusiveness */
    transition: all 0.2s ease;
}

.tap-card.tap-card--empty:hover {
    border-color: var(--brand-primary) !important;
    background: #f0f8ff !important;
    transform: translateY(-1px);
}

.tap-card.tap-card--assigned {
    background: white !important;
    border: 1px solid #dee2e6 !important;
    transition: all 0.2s ease;
}

.tap-card.tap-card--assigned:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--brand-primary) !important;
    transform: translateY(-1px);
}

.tap-card.tap-card--updating {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.tap-card.tap-card--updating::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--brand-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.tap-lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: #fff;
    background: rgba(220, 53, 69, 0.85);
    border-radius: 4px;
    padding: 1px 5px;
    margin-bottom: 3px;
    pointer-events: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State Styling */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.empty-tap-icon {
    font-size: 2rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.empty-tap-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.empty-tap-subtext {
    font-size: 0.9rem;
    color: #adb5bd;
}

/* Touch Target Improvements */
.tap-card {
    min-height: 48px;
    touch-action: manipulation;
}

.btn {
    min-height: 48px;
    min-width: 48px;
}

/* Modal Button Improvements */
.btn-lg {
    min-height: 56px;
    font-size: 1.1rem;
}

.btn-lg i {
    margin-right: 0.5rem;
}

/* Tap Card Container */
.tap-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: var(--card-border-radius);
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.75rem 0.25rem 0.75rem;
    padding: 0.1rem 0.75rem 0.1rem 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    height: 120px;
    height: initial;
    width: 100%;
}

.tap-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Column 1 - Left side with tap number and price */
.tap-left-column {
    width: 55px;
    min-width: 55px;
    max-width: 55px;
    display: flex;
    flex-direction: column;
    margin-right: 0.75rem;
}

.tap-number-section {
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    /*border-bottom: 1px solid #e9ecef;*/
}

.tap-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--tap-number-text);
    line-height: 1;
}

.tap-price-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tap-left-price {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--price-text);
}

/* Column 2 - Right side with beer info */
.tap-right-column {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tap-right-column--public {
    position: relative;
}

.tap-right-column--public .tap-info-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    border: none;
    background: none;
    cursor: pointer;
    z-index: 10;
    color: var(--primary-color);
    font-size: 1.2rem;
    padding: 0;
    line-height: 1;
}

/* Row 1 - Beer name and brewery */
.beer-info-section {
    flex: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /*border-bottom: 1px solid #e9ecef;*/
    padding-bottom: 0.5rem;
    padding-bottom: initial;
}

.beer-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.tap-right-column--public .beer-info-section {
    padding-right: 2rem;
}

.tap-right-column--public .beer-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brewery-name {
    font-size: 1rem;
    color: #6c757d;
}

/* Row 2 - Beer details */
.beer-details-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 2px;
}

.beer-style {
    font-size: 0.95rem;
    color: #6c757d;
    text-align: center;
    text-align: left;
    text-align: right;
    flex: 1;
}

.beer-abv {
    font-size: 0.95rem;
    color: #6c757d;
    min-width: 50px;
    text-align: right;
}

/* Empty state */
.text-muted {
    font-size: 1rem;
    color: #6c757d;
}

/* Drag-to-Reveal Action Styles */
.tap-card-container {
    position: relative;
    overflow: hidden;
    margin-bottom: 0.5rem;
    border-radius: var(--card-border-radius);
    touch-action: pan-y; /* allow vertical scroll until horizontal intent */
}

.swipe-actions {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: calc(var(--reveal-p, 0) * var(--stacked-width, var(--action-reveal-width)));
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0;
    box-sizing: border-box;
    border-radius: var(--card-border-radius);
    overflow: hidden;
    margin: 0;
    z-index: 1;
}

/* Stacked (Mail-style) mode: overlapping buttons (keep masked width) */
.swipe-actions--stacked {
    width: var(--action-reveal-width);
    display: block;
}

.swipe-action {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    margin: 0;
    border-radius: var(--action-button-radius);
    will-change: transform, opacity;
    transform: translateX(var(--btn-tx, 0px));
    opacity: var(--btn-opacity, 0);
    transition: background-color 0.15s ease;
}

.swipe-actions--stacked .swipe-action {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: var(--swipe-button-width);
    flex: none;
}

.swipe-action:active {
    opacity: 0.8;
}

.swipe-action-price {
    background-color: var(--button-primary-background);
}

.swipe-action-price:hover {
    background-color: var(--button-primary-hover);
}

.swipe-action-change {
    background-color: var(--button-secondary-background);
}

.swipe-action-change:hover {
    background-color: var(--button-secondary-hover);
}

.swipe-action-delete {
    background-color: var(--button-danger-background);
}

.swipe-action-delete:hover {
    background-color: var(--button-danger-hover);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .swipe-action {
        transform: none !important;
        opacity: 1 !important;
    }
}

/* Ensure tap card has proper positioning */
.tap-card-container .tap-card {
    position: relative;
    z-index: 2;
    background: white;
    transition: transform 0.3s ease;
    margin-bottom: 0;
}

.tap-card-container .tap-card.is-dragging {
    transition: none;
}

/* Responsive breakpoints */
@media (min-width: 1024px) {
    /* Changed from 768px */
    .container-fluid {
        max-width: 1200px;
        margin: 0 auto;
    }
    
    /* Desktop: 2-column card grid */
    #mobile-tap-list {
        display: grid;
        grid-template-columns: repeat(var(--card-grid-columns), 1fr);
        gap: var(--card-grid-gap);
        max-width: var(--card-grid-max-width);
        margin: 0 auto;
        padding: 0 var(--card-grid-padding);
    }
    
    @supports (grid-template-columns: repeat(auto-fit, minmax(350px, 1fr))) {
        #mobile-tap-list {
            grid-template-columns: repeat(2, 1fr);
        }
    }
}
/* Modal Theming */
.modal-content {
    background-color: var(--modal-bg) !important;
    color: var(--modal-body-text) !important;
}

.modal-header {
    background-color: var(--modal-header-bg) !important;
    border-bottom-color: var(--modal-header-border) !important;
    --modal-close-color: var(--modal-header-text);
    position: relative;
}

.modal-title {
    color: var(--modal-header-text) !important;
    font-weight: 500;
    width: 100%;
    text-align: center;
    padding: 0 2.5rem; /* leave room for close button on right, balanced on left */
}

.modal-header .btn-close {
    background-image: none !important;
    background-color: var(--modal-close-color) !important;
    opacity: var(--modal-close-opacity, 0.8) !important;
    width: 1.25rem;
    height: 1.25rem;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    -webkit-mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath d='M2.146 2.854a.5.5 0 0 1 .708-.708L6 5.293l3.146-3.147a.5.5 0 0 1 .708.708L6.707 6l3.147 3.146a.5.5 0 0 1-.708.708L6 6.707l-3.146 3.147a.5.5 0 0 1-.708-.708L5.293 6 2.146 2.854z'/%3e%3c/svg%3e") center/1.25rem 1.25rem no-repeat;
    mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath d='M2.146 2.854a.5.5 0 0 1 .708-.708L6 5.293l3.146-3.147a.5.5 0 0 1 .708.708L6.707 6l3.147 3.146a.5.5 0 0 1-.708.708L6 6.707l-3.146 3.147a.5.5 0 0 1-.708-.708L5.293 6 2.146 2.854z'/%3e%3c/svg%3e") center/1.25rem 1.25rem no-repeat;
}

.modal-header .btn-close:hover {
    opacity: 1 !important;
}

/* On small screens push modal down to clear the sticky admin nav */
@media (max-width: 767.98px) {
    .modal-dialog {
        margin-top: 4rem;
    }
}

.modal-body {
    background-color: var(--modal-bg) !important;
    color: var(--modal-body-text) !important;
}

.modal-footer {
    background-color: var(--modal-bg) !important;
    color: var(--modal-body-text) !important;
    border-top-color: var(--modal-header-border) !important;
}

#beerInfoModal .modal-title {
    color: var(--modal-header-text) !important;
}

.beer-info-brewery {
    color: var(--beer-info-modal-brewery-text) !important;
}

.beer-info-style-label {
    color: var(--beer-info-modal-style-label-text) !important;
}

.beer-info-abv-label {
    color: var(--beer-info-modal-abv-label-text) !important;
}

#beerListContainer {
    max-height: 400px;
    overflow-y: auto;
}

.modal-footer {
    background-color: var(--modal-bg) !important;
    color: var(--modal-body-text) !important;
    border-top-color: var(--modal-header-border) !important;
}

/* Modal-scoped variable mapping */
#editTapModal {
    --modal-bg: var(--edit-tap-modal-bg);
    --modal-header-text: var(--edit-tap-modal-header-text);
    --modal-body-text: var(--edit-tap-modal-body-text);
    --modal-header-bg: var(--edit-tap-modal-header-bg);
    --modal-header-border: var(--edit-tap-modal-header-border);
}

#beerModal {
    --modal-bg: var(--beer-modal-bg);
    --modal-header-text: var(--beer-modal-header-text);
    --modal-body-text: var(--beer-modal-body-text);
    --modal-header-bg: var(--beer-modal-header-bg);
    --modal-header-border: var(--beer-modal-header-border);
}

#beerInfoModal {
    --modal-bg: var(--beer-info-modal-bg);
    --modal-header-text: var(--beer-info-modal-header-text);
    --modal-body-text: var(--beer-info-modal-body-text);
    --modal-header-bg: var(--beer-info-modal-header-bg);
    --modal-header-border: var(--beer-info-modal-header-border);
}

#priceModal {
    --modal-bg: var(--price-modal-bg);
    --modal-header-text: var(--price-modal-header-text);
    --modal-body-text: var(--price-modal-body-text);
    --modal-header-bg: var(--price-modal-header-bg);
    --modal-header-border: var(--price-modal-header-border);
}

#manualBeerModal {
    --modal-bg: var(--manual-beer-modal-bg);
    --modal-header-text: var(--manual-beer-modal-header-text);
    --modal-body-text: var(--manual-beer-modal-body-text);
    --modal-header-bg: var(--manual-beer-modal-header-bg);
    --modal-header-border: var(--manual-beer-modal-header-border);
}

#confirmModal {
    --modal-bg: var(--confirm-modal-bg);
    --modal-header-text: var(--confirm-modal-header-text);
    --modal-body-text: var(--confirm-modal-body-text);
    --modal-header-bg: var(--confirm-modal-header-bg);
    --modal-header-border: var(--confirm-modal-header-border);
}

.beer-pagination-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

/* Modal backdrop base styling (stacking handled in JS) */
.modal-backdrop {
    background-color: var(--bs-backdrop-bg);
    opacity: 0.5;
}
/* Base modal and backdrop z-indexes - Bootstrap defaults */


/* ============================================
   ADMIN NAVIGATION BAR
   Horizontally scrollable navigation for admin pages
   Modern, polished design matching the page aesthetic
   ============================================ */

/* === HAMBURGER MENU BUTTON (Mobile Only) === */
.admin-nav-hamburger {
    position: fixed;
    top: 0.9rem;
    left: 0.75rem;
    z-index: 2000;
    width: 36px;
    height: 36px;
    background: var(--brand-primary, #0d6efd);
    border: none;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.admin-nav-hamburger:hover {
    background: var(--brand-primary-dark, #0b5ed7);
    transform: scale(1.05);
}

.admin-nav-hamburger:active {
    transform: scale(0.95);
}

/* Hide hamburger when scrolled (controlled by JS) */
.admin-nav-hamburger.scrolled-hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.hamburger-line {
    width: 18px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hide hamburger on desktop */
@media (min-width: 768px) {
    .admin-nav-hamburger {
        display: none !important;
    }
}

/* === BACKDROP OVERLAY (Mobile Only) === */
.admin-nav-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.admin-nav-backdrop.open {
    opacity: 1;
    visibility: visible;
}

/* Hide backdrop on desktop */
@media (min-width: 768px) {
    .admin-nav-backdrop {
        display: none;
    }
}

/* === CLOSE BUTTON (Mobile Only) === */
.admin-nav-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.7);
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.admin-nav-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.9);
}

/* Hide close button on desktop */
@media (min-width: 768px) {
    .admin-nav-close {
        display: none;
    }
}

/* === NAVIGATION MENU === */
/* Mobile: Slide-in sidebar menu */
@media (max-width: 767px) {
    .admin-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        background: white;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
        z-index: 1600;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .admin-nav.open {
        transform: translateX(0);
    }
    
    .admin-nav-container {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        padding: 4rem 1rem 1rem 1rem;
    }
    
    .admin-nav-item {
        flex: none;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 1rem;
        padding: 1rem;
        min-height: 54px;
        text-decoration: none;
        color: rgba(0, 0, 0, 0.75);
        border-radius: 8px;
        transition: all 0.25s ease;
        font-weight: 500;
        background: transparent;
        border-left: 3px solid transparent;
    }
    
    .admin-nav-item i {
        font-size: 1.5rem;
        min-width: 24px;
        transition: transform 0.2s ease;
    }
    
    .admin-nav-label {
        font-size: 1rem;
        font-weight: 600;
    }
    
    .admin-nav-item:hover {
        background: rgba(13, 110, 253, 0.08);
        color: var(--brand-primary, #0d6efd);
        border-left-color: var(--brand-primary, #0d6efd);
    }
    
    .admin-nav-item.active {
        background: rgba(13, 110, 253, 0.12);
        color: var(--brand-primary, #0d6efd);
        border-left-color: var(--brand-primary, #0d6efd);
        font-weight: 700;
    }
    
    .admin-nav-item.active i {
        color: var(--brand-primary, #0d6efd);
        transform: scale(1.1);
    }
}

/* Desktop: Horizontal top navigation */
@media (min-width: 768px) {
    .admin-nav {
        background: linear-gradient(to bottom, 
            rgba(255, 255, 255, 1) 0%, 
            rgba(248, 249, 250, 0.95) 100%
        );
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        position: sticky;
        top: 0;
        z-index: 1000;
        box-shadow: 
            0 1px 3px rgba(0, 0, 0, 0.06),
            0 1px 2px rgba(0, 0, 0, 0.04);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .admin-nav-container {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0.25rem;
        padding: 0.5rem 1rem;
        max-width: 1400px;
        margin: 0 auto;
    }

    /* Hide scrollbar but keep functionality */
    .admin-nav-container::-webkit-scrollbar {
        display: none;
    }

    .admin-nav-item {
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        padding: 0.65rem 1rem;
        min-width: 95px;
        text-decoration: none;
        color: rgba(0, 0, 0, 0.65);
        border-radius: 8px;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        white-space: nowrap;
        cursor: pointer;
        background: transparent;
        position: relative;
        font-weight: 500;
    }

    /* Subtle bottom indicator line */
    .admin-nav-item::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%) scaleX(0);
        width: 80%;
        height: 3px;
        background: var(--brand-primary, #0d6efd);
        border-radius: 3px 3px 0 0;
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .admin-nav-item i {
        font-size: 1.35rem;
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .admin-nav-label {
        font-size: 0.8125rem;
        font-weight: 600;
        letter-spacing: 0.01em;
    }

    /* Hover state - elevated card effect */
    .admin-nav-item:hover {
        color: var(--brand-primary, #0d6efd);
        background: rgba(13, 110, 253, 0.06);
        transform: translateY(-1px);
    }

    .admin-nav-item:hover i {
        transform: scale(1.1);
    }

    /* Active state - bold with indicator */
    .admin-nav-item.active {
        color: var(--brand-primary, #0d6efd);
        background: linear-gradient(135deg, 
            rgba(13, 110, 253, 0.12) 0%, 
            rgba(13, 110, 253, 0.08) 100%
        );
        font-weight: 700;
    }

    .admin-nav-item.active::after {
        transform: translateX(-50%) scaleX(1);
    }

    .admin-nav-item.active i {
        color: var(--brand-primary, #0d6efd);
        filter: drop-shadow(0 1px 2px rgba(13, 110, 253, 0.3));
    }

    /* Focus state for accessibility */
    .admin-nav-item:focus-visible {
        outline: 2px solid var(--brand-primary, #0d6efd);
        outline-offset: 2px;
    }

    /* Keep reset password out of desktop ribbon; use avatar menu instead. */
    #adminNavResetPassword {
        display: none !important;
    }
}

/* Larger screens - more breathing room */
@media (min-width: 1024px) {
    .admin-nav-item {
        min-width: 110px;
        padding: 0.75rem 1.25rem;
    }
    
    .admin-nav-item i {
        font-size: 1.4rem;
    }
    
    .admin-nav-label {
        font-size: 0.875rem;
    }
}

/* === STAFF NAV MODE: hide admin nav controls entirely === */
body.staff-nav-hidden .admin-nav,
body.staff-nav-hidden .admin-nav-hamburger,
body.staff-nav-hidden .admin-nav-backdrop {
    display: none !important;
}

