/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', 'Courier', monospace;
    background: 
        repeating-linear-gradient(
            0deg,
            #f8f8f8,
            #f8f8f8 1px,
            #f5f5f5 1px,
            #f5f5f5 2px
        ),
        linear-gradient(90deg, #fafafa 0%, #f5f5f5 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 20px 20px 20px;
    position: relative;
}

/* Calculator Container */
.calculator-container {
    background: linear-gradient(145deg, #3a3a3a, #252525);
    border-radius: 20px;
    padding: 30px;
    box-shadow:
        inset 1px 5px 5px -1px #fff9,
        inset -1px -2px 5px -1px #00000080,
        0 1px 1px #00000013,
        0 2px 2px #00000014,
        0 4px 4px #0000001a,
        0 8px 8px #0003,
        0 16px 16px #00000038;
    max-width: 500px;
    width: 100%;
    border: 4px solid #1a1a1a;
    border-top-color: #4a4a4a;
    border-left-color: #2a2a2a;
    border-bottom-color: #0a0a0a;
    position: relative;
    margin-bottom: 30px;
    z-index: 100;
    overflow: hidden;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

.calculator-container::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border-radius: 24px;
    z-index: -1;
    border: 2px solid #0a0a0a;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Header */
.calculator-header {
    padding: 8px 12px 8px 12px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calculator-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.budgie-text {
    color: #555;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    font-family: 'Science Gothic', Arial, Helvetica, sans-serif;
    text-transform: uppercase;
    opacity: 0.7;
}

/* Currency Selector in Header */
.currency-selector-header,
.currency-selector-top {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Clean currency selector - minimal styling */
.currency-select {
    padding: 6px 8px;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #888;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    font-family: 'Courier New', 'Courier', monospace;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-shadow: none;
}

.currency-select:hover {
    background: #2f2f2f;
    box-shadow: none;
}

.currency-select:focus {
    outline: none;
    border-color: #00ff88;
}

.currency-select option {
    background: #2a2a2a;
    color: #fff;
}

/* Responsive adjustments for small phones (iPhone SE, small Android) */
@media (max-width: 375px) {
    body {
        padding: 20px 15px 80px 15px; /* Reduced top padding, added bottom for receipt button */
    }

    .budgie-text {
        font-size: 14px;
        letter-spacing: 0.5px;
    }

    .currency-select {
        font-size: 10px;
        padding: 5px 6px;
    }

    /* Stack ALL inline inputs vertically on very small screens */
    .inline-inputs {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* Adjust calculator padding for very small screens */
    .calculator-container {
        padding: 18px;
        margin-bottom: 20px;
        margin-left: 15px;
        margin-right: 15px;
    }

    /* Reduce input font size */
    input[type="text"],
    input[type="number"],
    input[type="date"],
    select {
        font-size: 13px;
        padding: 10px;
    }

    /* Smaller buttons */
    .calc-button {
        font-size: 13px;
        padding: 12px;
    }

    /* Reduce display font sizes for small screens */
    .display-total {
        font-size: 28px;
    }

    .display-breakdown {
        font-size: 12px;
    }

    .per-person {
        font-size: 12px;
    }

    /* Hide background receipt stack on mobile */
    .receipt-stack-background {
        display: none;
    }
}

/* Responsive adjustments for slightly larger phones */
@media (min-width: 376px) and (max-width: 480px) {
    body {
        padding: 30px 20px 80px 20px; /* Reduced top padding, added bottom for receipt button */
    }

    .budgie-text {
        font-size: 15px;
        letter-spacing: 1px;
    }

    .currency-select {
        font-size: 11px;
        padding: 6px 8px;
    }

    /* Stack trip route vertically, keep Duration/Travelers side-by-side */
    .input-group:first-of-type .inline-inputs {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* Adjust calculator padding */
    .calculator-container {
        padding: 20px;
        margin-bottom: 20px;
        margin-left: 20px;
        margin-right: 20px;
    }

    /* Slightly reduce input font size */
    input[type="text"],
    input[type="number"],
    input[type="date"],
    select {
        font-size: 13px;
    }

    /* Adjust display font sizes for medium screens */
    .display-total {
        font-size: 32px;
    }

    .display-breakdown {
        font-size: 12px;
    }

    .per-person {
        font-size: 13px;
    }

    /* Hide background receipt stack on mobile */
    .receipt-stack-background {
        display: none;
    }
}

/* Responsive adjustments for larger phones and small tablets */
@media (min-width: 481px) and (max-width: 768px) {
    /* Stack trip route inputs vertically */
    .input-group:first-of-type .inline-inputs {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* Display */
.display {
    background: #4a5f3f;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    min-height: 180px;
    border: 2px solid #3a4f2f;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px
        );
    pointer-events: none;
    animation: scanlines 8s linear infinite;
}

.display::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            90deg,
            rgba(0, 0, 0, 0.02) 0px,
            transparent 1px,
            transparent 2px,
            rgba(0, 0, 0, 0.02) 3px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.02) 0px,
            transparent 1px,
            transparent 2px,
            rgba(0, 0, 0, 0.02) 3px
        );
    pointer-events: none;
    opacity: 0.4;
    animation: dither 0.2s steps(2) infinite;
}

@keyframes scanlines {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(4px);
    }
}

@keyframes dither {
    0% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.4;
    }
    100% {
        opacity: 0.3;
    }
}

@keyframes glitch {
    0% {
        transform: translate(0);
        text-shadow: 2px 2px #ff6b6b, -2px -2px #ff0000;
    }
    25% {
        transform: translate(-2px, 2px);
        text-shadow: -2px -2px #ff6b6b, 2px 2px #ff0000;
    }
    50% {
        transform: translate(2px, -2px);
        text-shadow: 2px -2px #ff6b6b, -2px 2px #ff0000;
    }
    75% {
        transform: translate(-2px, -2px);
        text-shadow: -2px 2px #ff6b6b, 2px -2px #ff0000;
    }
    100% {
        transform: translate(0);
        text-shadow: 2px 2px #ff6b6b, -2px -2px #ff0000;
    }
}

.display-total {
    color: #00ff88;
    font-size: 36px;
    font-weight: bold;
    text-align: right;
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    position: relative;
    z-index: 1;
}

/* Fix currency symbol sizing (especially rupee symbol) */
.currency-symbol {
    font-size: 0.92em;
    display: inline-block;
    vertical-align: baseline;
    line-height: 1;
}

.display-breakdown {
    color: #88ff88;
    font-size: 13px;
    line-height: 1.8;
    font-family: 'Courier New', monospace;
    position: relative;
    z-index: 1;
}

.display-breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
}

.per-person {
    color: #66ff99;
    font-size: 14px;
    text-align: right;
    margin-top: 10px;
    font-family: 'Courier New', monospace;
    position: relative;
    z-index: 1;
}

/* Input Groups */
.input-group {
    margin-bottom: 15px;
}

.input-group:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    color: #aaa;
    font-size: 11px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Courier New', 'Courier', monospace;
}

/* Input Fields */
input, select {
    width: 100%;
    padding: 14px;
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
    border: 3px solid #1a1a1a;
    border-top-color: #4a4a4a;
    border-left-color: #3a3a3a;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Courier New', 'Courier', monospace;
    transition: box-shadow 0.2s, background 0.2s, border-color 0.2s;
    box-shadow:
        0 4px 0 #1a1a1a,
        0 5px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

input:focus, select:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow:
        0 4px 0 #1a1a1a,
        0 5px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 2px rgba(0, 255, 136, 0.2);
}

input:hover:not(:focus), select:hover:not(:focus):not(.currency-select) {
    background: linear-gradient(145deg, #444, #333);
    border-color: #2a2a2a;
    border-top-color: #555;
    border-left-color: #444;
    box-shadow:
        0 5px 0 #1a1a1a,
        0 6px 10px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
}

/* Select Dropdowns - 3D Block Style */
select:not(.currency-select) {
    cursor: pointer;
    appearance: none;
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
    border: 3px solid #1a1a1a;
    border-top-color: #4a4a4a;
    border-left-color: #3a3a3a;
    border-radius: 8px;
    padding: 14px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    box-shadow:
        0 4px 0 #1a1a1a,
        0 5px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: box-shadow 0.2s, background 0.2s, border-color 0.2s;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2300ff88' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

select:hover:not(:focus):not(.currency-select) {
    background: linear-gradient(145deg, #444, #333);
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2300ff88' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    border-color: #2a2a2a;
    border-top-color: #555;
    border-left-color: #444;
    box-shadow:
        0 5px 0 #1a1a1a,
        0 6px 10px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

select:focus:not(.currency-select) {
    outline: none;
    border-color: #00ff88;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2300ff88' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    box-shadow:
        0 4px 0 #1a1a1a,
        0 5px 8px rgba(0, 0, 0, 0.4),
        0 0 0 2px rgba(0, 255, 136, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

select:active:not(.currency-select) {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2300ff88' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    box-shadow:
        0 2px 0 #1a1a1a,
        0 3px 4px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Inline Inputs Layout */
.inline-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.inline-inputs input,
.inline-inputs select {
    width: 100%;
}

.date-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.error-message {
    color: #00ff88;
    font-size: 11px;
    margin-top: 6px;
    font-family: 'Courier New', 'Courier', monospace;
    min-height: 16px;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
}

input[type="date"] {
    color-scheme: dark;
    cursor: pointer;
    position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: auto;
    color: transparent;
    background: transparent;
}

input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-clear-button {
    z-index: 1;
}

/* Autocomplete */
.autocomplete-container {
    position: relative;
}

.autocomplete-items {
    position: absolute;
    background: #1a1a1a;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease;
}

.autocomplete-items.has-items {
    max-height: 200px;
    border: 2px solid #444;
    border-top: none;
    border-radius: 0 0 8px 8px;
    overflow-y: auto;
}

.autocomplete-items div {
    padding: 10px;
    cursor: pointer;
    color: #fff;
    border-bottom: 1px solid #333;
    font-size: 14px;
}

.autocomplete-items div:hover {
    background: #2a2a2a;
}

.autocomplete-active {
    background: #00ff88 !important;
    color: #1a1a1a !important;
}

/* Advanced Options */
.advanced-toggle {
    background: #2a2a2a;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
    border: 1px solid #333;
}

.advanced-toggle:hover {
    background: #2f2f2f;
}

.advanced-toggle-text {
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.advanced-toggle-icon {
    color: #666;
    font-size: 16px;
    transition: transform 0.3s;
}

.advanced-toggle-icon.open {
    transform: rotate(180deg);
}

.advanced-section {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.advanced-section.open {
    max-height: 300px;
}

.advanced-content {
    padding: 15px;
    background: #333;
    border-radius: 8px;
    margin-top: 10px;
    border: 2px solid #2a2a2a;
    border-top-color: #111;
    border-left-color: #1a1a1a;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(255, 255, 255, 0.05);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.checkbox-group input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    cursor: pointer;
    background: linear-gradient(145deg, #222, #1a1a1a);
    border: 2px solid #333;
    border-top-color: #111;
    border-left-color: #1a1a1a;
    border-radius: 3px;
    position: relative;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.checkbox-group input[type="checkbox"]:hover {
    border-color: #444;
    background: linear-gradient(145deg, #2a2a2a, #222);
}

.checkbox-group input[type="checkbox"]:checked {
    background: linear-gradient(145deg, #00dd77, #00bb66);
    border-color: #008844;
    border-top-color: #00ff88;
    border-left-color: #00dd77;
    box-shadow: 
        inset 0 1px 3px rgba(0, 0, 0, 0.3),
        0 1px 0 rgba(255, 255, 255, 0.2);
}

.checkbox-group input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.checkbox-group input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        0 0 0 2px rgba(0, 255, 136, 0.2);
}

.checkbox-group label {
    margin: 0;
    color: #aaa;
    font-size: 13px;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
}

/* Buttons */
.button-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

.calc-button {
    padding: 15px;
    background: linear-gradient(145deg, #4a4a4a, #3a3a3a);
    border: 2px solid #2a2a2a;
    border-top-color: #555;
    border-left-color: #4a4a4a;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 
        0 4px 0 #2a2a2a,
        0 5px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    font-family: 'Courier New', 'Courier', monospace;
}

.calc-button:hover {
    background: linear-gradient(145deg, #555, #444);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 0 #2a2a2a,
        0 7px 10px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.calc-button:active {
    transform: translateY(2px);
    box-shadow: 
        0 2px 0 #2a2a2a,
        0 3px 4px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.calc-button.save {
    background: linear-gradient(145deg, #00dd77, #00bb66);
    border-color: #008844;
    border-top-color: #00ff88;
    border-left-color: #00dd77;
    color: #1a1a1a;
    box-shadow: 
        0 4px 0 #008844,
        0 5px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.calc-button.save:hover {
    background: linear-gradient(145deg, #00ff88, #00dd77);
    box-shadow: 
        0 6px 0 #008844,
        0 7px 10px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.calc-button.save:active {
    box-shadow: 
        0 2px 0 #008844,
        0 3px 4px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.calc-button.secondary {
    background: linear-gradient(145deg, #555, #444);
    border-color: #333;
    border-top-color: #666;
    border-left-color: #555;
    color: #fff;
    box-shadow: 
        0 4px 0 #2a2a2a,
        0 5px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    grid-column: span 2;
    margin-top: 10px;
    position: relative;
}

.calc-button.secondary:hover {
    background: linear-gradient(145deg, #666, #555);
    box-shadow: 
        0 6px 0 #2a2a2a,
        0 7px 10px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.calc-button.secondary:active {
    box-shadow: 
        0 2px 0 #2a2a2a,
        0 3px 4px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.calc-button.secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.calc-button.secondary:disabled:hover {
    background: linear-gradient(145deg, #555, #444);
    box-shadow: 
        0 4px 0 #2a2a2a,
        0 5px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: none;
}

.coming-soon-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff6b6b;
    color: white;
    font-size: 9px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: bold;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.print-icon {
    opacity: 0.8;
    font-size: 18px;
}

/* Disclaimer */
.disclaimer {
    color: #888;
    font-size: 11px;
    text-align: center;
    margin-top: 20px;
    font-style: italic;
    font-family: 'Courier New', 'Courier', monospace;
}

/* Receipt */
.receipt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

.receipt-overlay.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.receipt {
    width: 320px;
    background: white;
    padding: 20px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
    font-family: 'Courier New', monospace;
    z-index: 2001;
    margin-bottom: 0;
    animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.receipt-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.receipt-close:hover {
    background: #ff6666;
    transform: scale(1.1);
}

.receipt-close:active {
    transform: scale(0.95);
}

.receipt-content {
    color: #000;
    font-size: 12px;
    line-height: 1.6;
}

.receipt-header {
    text-align: center;
    border-bottom: 2px dashed #333;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.receipt-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 5px;
    letter-spacing: 2px;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
}

.receipt-total {
    border-top: 2px solid #333;
    border-bottom: 2px solid #333;
    margin: 15px 0;
    padding: 10px 0;
    font-weight: bold;
    font-size: 14px;
}

.receipt-footer {
    text-align: center;
    margin-top: 15px;
    font-size: 10px;
    color: #666;
}

/* Footer */
.footer {
    width: 100%;
    max-width: 500px;
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 12px;
    margin-top: 20px;
    position: relative;
    z-index: 100;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.claude-logo {
    width: 20px;
    height: 20px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.claude-logo:hover {
    opacity: 1;
}

.footer-text {
    font-family: 'Courier New', 'Courier', monospace;
    letter-spacing: 0.5px;
}
/* Error Modal */
.error-modal {
    border: 3px solid #ff6b6b;
    box-shadow: 0 -10px 40px rgba(255, 107, 107, 0.4);
}

.error-modal .receipt-header {
    border-bottom-color: #ff6b6b;
}

.error-modal .receipt-title {
    color: #ff4444;
    animation: glitch 0.3s infinite;
}

/* Background Receipt Stack */
.receipt-stack-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.stacked-receipt {
    position: absolute;
    width: 280px;
    background: white;
    padding: 18px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.5;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 0 50px rgba(0, 0, 0, 0.03);
    cursor: move;
    pointer-events: all;
    transition: opacity 0.3s ease, filter 0.3s ease;
    opacity: 0.85;
    filter: contrast(0.95) brightness(0.98);
    user-select: none;
}

.stacked-receipt:hover {
    opacity: 1;
    z-index: 10;
    filter: contrast(1) brightness(1);
}

.stacked-receipt.dragging {
    opacity: 0.6;
    z-index: 1000;
    cursor: grabbing;
    transition: none;
}

.stacked-receipt-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    font-weight: bold;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    z-index: 1;
}

.stacked-receipt:hover .stacked-receipt-delete {
    display: flex;
}

.stacked-receipt-delete:hover {
    background: #ff6666;
    transform: scale(1.15);
}

.stacked-receipt-content {
    color: #000;
    pointer-events: none;
}

/* Crumpled paper texture effect - uses CSS variables for unique patterns */
.stacked-receipt::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(ellipse at var(--crumple-x1, 15%) var(--crumple-y1, 25%), rgba(0,0,0,0.08) 0%, transparent 40%),
        radial-gradient(ellipse at var(--crumple-x2, 85%) var(--crumple-y2, 75%), rgba(0,0,0,0.06) 0%, transparent 40%),
        radial-gradient(ellipse at var(--crumple-x3, 35%) var(--crumple-y3, 85%), rgba(0,0,0,0.07) 0%, transparent 40%),
        radial-gradient(ellipse at var(--crumple-x4, 65%) var(--crumple-y4, 15%), rgba(0,0,0,0.06) 0%, transparent 40%),
        radial-gradient(ellipse at var(--crumple-x5, 50%) var(--crumple-y5, 50%), rgba(0,0,0,0.04) 0%, transparent 50%),
        radial-gradient(ellipse at var(--crumple-x6, 25%) var(--crumple-y6, 60%), rgba(0,0,0,0.05) 0%, transparent 35%),
        radial-gradient(ellipse at var(--crumple-x7, 75%) var(--crumple-y7, 40%), rgba(0,0,0,0.05) 0%, transparent 35%);
    pointer-events: none;
    z-index: 1;
}

/* Additional wrinkle effect - uses CSS variables for unique angles */
.stacked-receipt::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(var(--wrinkle-angle1, 125deg), transparent 45%, rgba(0,0,0,0.04) 50%, transparent 55%),
        linear-gradient(var(--wrinkle-angle2, 65deg), transparent 45%, rgba(0,0,0,0.03) 50%, transparent 55%);
    pointer-events: none;
    z-index: 1;
}

/* Mobile optimizations for receipt stack */
@media (max-width: 767px) {
    .stacked-receipt {
        width: 200px;
        padding: 14px;
        font-size: 9px;
        line-height: 1.4;
    }

    .stacked-receipt-delete {
        width: 20px;
        height: 20px;
        font-size: 12px;
        top: 5px;
        right: 5px;
    }

    /* Reduce opacity on mobile so they don't overwhelm */
    .stacked-receipt {
        opacity: 0.7;
    }

    .stacked-receipt:hover {
        opacity: 1;
        transform: scale(1.03) !important;
    }
}

/* Mobile Receipt Viewer */
.mobile-receipt-button {
    display: none;
    width: fit-content;
    max-width: 90%;
    background: white;
    padding: 16px 32px;
    border-radius: 50px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    margin: 30px auto 20px auto;
}

.mobile-receipt-button:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
    transform: translateY(-2px);
}

.mobile-receipt-button:active {
    transform: translateY(0) scale(0.98);
}

.mobile-receipt-button-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.mobile-receipt-button-text {
    color: #333;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-receipt-button-text .material-icons {
    color: #666;
}

.mobile-receipt-count {
    background: #00ff88;
    color: #1a1a1a;
    border-radius: 50%;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-receipt-panel {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    max-height: 70vh;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    z-index: 300;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-receipt-panel.show {
    display: block;
    transform: translateY(0);
}

.mobile-receipt-panel-header {
    padding: 20px 20px 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    position: relative;
}

/* Drag handle indicator */
.mobile-receipt-panel-header::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: #d0d0d0;
    border-radius: 2px;
}

.mobile-receipt-panel-title {
    font-family: 'Courier New', monospace;
    font-size: 15px;
    font-weight: bold;
    color: #333;
    margin-top: 8px;
}

.mobile-receipt-panel-close {
    background: #f5f5f5;
    color: #666;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    font-weight: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    transition: all 0.2s;
}

.mobile-receipt-panel-close:active {
    background: #e8e8e8;
    transform: scale(0.95);
}

.mobile-receipt-list {
    overflow-y: auto;
    max-height: calc(70vh - 60px);
    padding: 16px;
}

.mobile-receipt-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-receipt-item:active {
    transform: scale(0.98);
}

.mobile-receipt-item-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #f5f5f5;
    color: #999;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    font-weight: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: all 0.2s;
}

.mobile-receipt-item-delete:active {
    background: #e8e8e8;
    color: #666;
    transform: scale(0.95);
}

.mobile-receipt-empty {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-family: 'Courier New', monospace;
}

/* Mobile receipt button visibility controlled by JavaScript */
@media (max-width: 480px) {
    .mobile-receipt-button {
        /* display controlled by JS based on receipt count */
    }
}