* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'system-ui', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
    line-height: 1.6;
    font-size: 14px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.header {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

h1 {
    color: #0056b3;
    font-size: 2.5rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.search-section {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background-color: #ffffff;
    color: #212529;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #0056b3;
}

.filters {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.price-toggles {
    display: flex;
    gap: 15px;
    margin-left: auto;
}

.price-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.price-checkbox {
    accent-color: #0056b3;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background-color: #ffffff;
    color: #212529;
    font-size: 14px;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 10px 10px 10px 0;
}

.item-card {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.15);
    border-color: #0056b3;
}

.item-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #0056b3;
    margin-bottom: 10px;
}

.item-details {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 10px;
}

.item-prices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 0.85rem;
}

.price-item {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.price-item-default {
    background-color: #e3f2fd;
    border-color: #bbdefb;
}

.price-item-sane {
    background-color: #e8f5e8;
    border-color: #c8e6c9;
    display: none; /* Hidden by default */
}

.price-item-dmg {
    background-color: #ffebee;
    border-color: #ffcdd2;
    display: none; /* Hidden by default */
}

.price-label {
    color: #212529;
    font-weight: 500;
    font-size: 13px;
}

.price-value {
    color: #212529;
    font-weight: 500;
    font-size: 13px;
}

.cart-section {
    background: #ffffff;
    border: 2px solid #dee2e6;
    border-radius: 15px;
    padding: 25px;
    height: fit-content;
    position: sticky;
    top: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.cart-title {
    color: #0056b3;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 10px;
}

.cart-items {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.cart-item {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border: 1px solid #e9ecef;
}

.cart-item-info {
    flex: 1;
}

.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cart-item-name {
    font-weight: 500;
    color: #212529;
    font-size: 14px;
    flex: 1;
}

.cart-item-prices {
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cart-price-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-price-label {
    flex: 0 0 auto;
}

.cart-price-amount {
    flex: 0 0 auto;
    text-align: right;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    font-size: 13px;
}

.cart-price-line-default {
    background-color: #e3f2fd;
    border-radius: 4px;
    padding: 2px 4px;
    border: 1px solid #bbdefb;
}

.cart-price-line-sane {
    background-color: #e8f5e8;
    border-radius: 4px;
    padding: 2px 4px;
    border: 1px solid #c8e6c9;
    display: none; /* Hidden by default */
}

.cart-price-line-dmg {
    background-color: #ffebee;
    border-radius: 4px;
    padding: 2px 4px;
    border: 1px solid #ffcdd2;
    display: none; /* Hidden by default */
}

.cart-price-default {
    color: #212529;
}

.cart-price-sane {
    color: #212529;
}

.cart-price-dmg {
    color: #212529;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    background-color: #0056b3;
    color: #fff;
    border: none;
    border-radius: 4px;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.quantity-btn:hover {
    background-color: #004494;
}

.quantity {
    color: #212529;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
    font-size: 13px;
}

.cart-total {
    border-top: 2px solid #dee2e6;
    padding-top: 15px;
    text-align: center;
}

.total-amount {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-amount.default-total {
    background-color: #e3f2fd;
    border-radius: 6px;
    padding: 8px;
    border: 1px solid #bbdefb;
    color: #212529;
    margin-bottom: 8px;
}

.total-amount.sane-total {
    background-color: #e8f5e8;
    border-radius: 6px;
    padding: 8px;
    border: 1px solid #c8e6c9;
    color: #212529;
    margin-bottom: 8px;
    display: none; /* Hidden by default */
}

.total-amount.dmg-total {
    background-color: #ffebee;
    border-radius: 6px;
    padding: 8px;
    border: 1px solid #ffcdd2;
    color: #212529;
    margin-bottom: 8px;
    display: none; /* Hidden by default */
}

.party-size-section {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.party-size-label {
    color: #212529;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    display: block;
}

.party-size-slider {
    width: 100%;
    height: 8px;
    background: #dee2e6;
    border-radius: 4px;
    outline: none;
    margin-bottom: 15px;
    -webkit-appearance: none;
}

.party-size-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: #0056b3;
    border-radius: 50%;
    cursor: pointer;
}

.party-size-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #0056b3;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.party-size-display {
    color: #0056b3;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
}

.per-member-costs {
    font-size: 13px;
}

.per-member-cost {
    margin-bottom: 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.per-member-cost.per-member-default {
    background-color: #e3f2fd;
    border-radius: 4px;
    padding: 4px 6px;
    border: 1px solid #bbdefb;
    color: #212529;
    margin-bottom: 4px;
}

.per-member-cost.per-member-sane {
    background-color: #e8f5e8;
    border-radius: 4px;
    padding: 4px 6px;
    border: 1px solid #c8e6c9;
    color: #212529;
    margin-bottom: 4px;
    display: none; /* Hidden by default */
}

.per-member-cost.per-member-dmg {
    background-color: #ffebee;
    border-radius: 4px;
    padding: 4px 6px;
    border: 1px solid #ffcdd2;
    color: #212529;
    margin-bottom: 4px;
    display: none; /* Hidden by default */
}

.cart-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.clear-cart {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
    flex: 1;
}

.clear-cart:hover {
    background-color: #c82333;
}

.print-receipt {
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
    flex: 1;
}

.print-receipt:hover {
    background-color: #218838;
}

.loading {
    text-align: center;
    font-size: 1.2rem;
    color: #0056b3;
    margin-top: 50px;
}

.empty-cart {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    font-size: 14px;
    padding: 20px;
}

/* Table styles for overrides page */
.table-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.table-wrapper {
    background: #ffffff;
    border: 2px solid #dee2e6;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

th {
    background-color: #f8f9fa;
    color: #0056b3;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover {
    background-color: #f8f9fa;
}

tr:nth-child(even) {
    background-color: rgba(0, 86, 179, 0.02);
}

.price-positive {
    color: #28a745;
    font-weight: 500;
}

.price-negative {
    color: #dc3545;
    font-weight: 500;
}

/* Scrollbar styles */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f8f9fa;
}

::-webkit-scrollbar-thumb {
    background: #6c757d;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #495057;
}

/* FAQ button */
.faq-btn {
    position: absolute;
    top: 0;
    left: 0;
    background-color: #0056b3;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.faq-btn:hover {
    background-color: #004494;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 86, 179, 0.3);
}

/* Overrides button */
.overrides-btn {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #0056b3;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.overrides-btn:hover {
    background-color: #004494;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 86, 179, 0.3);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #fefefe;
    margin: 2% auto;
    border: none;
    border-radius: 12px;
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background-color: #0056b3;
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-btn {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.close-btn:hover {
    color: #cccccc;
}

.modal-body {
    padding: 0;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.modal .table-wrapper {
    margin: 0;
    padding: 20px;
}

/* Show sane prices when checkbox is checked */
.show-sane-prices .price-item-sane,
.show-sane-prices .cart-price-line-sane,
.show-sane-prices .sane-total,
.show-sane-prices .per-member-sane {
    display: flex !important;
}

/* Show 2014 prices when checkbox is checked */
.show-2014-prices .price-item-dmg,
.show-2014-prices .cart-price-line-dmg,
.show-2014-prices .dmg-total,
.show-2014-prices .per-member-dmg {
    display: flex !important;
}

/* Receipt modal styling */
.receipt-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
}

.receipt-display {
    flex: 1;
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background-color: #ffffff;
    color: #212529;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.4;
    min-height: 300px;
    max-height: 60vh;
}

.receipt-table {
    width: 100%;
    border-collapse: collapse;
    margin: 5px 0;
    font-size: 13px;
}

.receipt-table th,
.receipt-table td {
    padding: 6px 10px;
    text-align: left;
    border: 1px solid #dee2e6;
}

.receipt-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.receipt-table .total-row {
    background-color: #f8f9fa;
    font-weight: 600;
}

.receipt-table .total-row td {
    border-top: 2px solid #dee2e6;
}

.receipt-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-shrink: 0;
}

/* Specific modal body styling for receipt modal */
#receiptModal .modal-body {
    padding: 20px;
    height: calc(90vh - 120px);
    overflow: hidden;
}

#receiptModal .receipt-display br {
    line-height: 1.2;
}

#receiptModal .receipt-display strong {
    display: block;
    margin-bottom: 5px;
}

.copy-btn {
    background-color: #0056b3;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
    flex: 1;
    max-width: 150px;
}

.copy-btn:hover {
    background-color: #004085;
}

