/* Retro Cart Styles */
.cart-button {
    position: fixed;
    top: 20px;
    right: 24px; /* Position next to session tracker */
    background: #fff;
    border: 2px solid #000;
    padding: 10px 15px;
    cursor: pointer;
    font-family: 'VT323', monospace;
    font-size: 16px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 5px;
}

.cart-button:hover {
    transform: translateY(-2px);
    box-shadow: 7px 7px 0px #8B4513;
    cursor: url('../cursors/circle-filled.svg') 12 12, default;
}

.cart-icon {
    font-size: 24px;
    margin-right: 10px;
}

.cart-count {
    background: #000;
    color: #fff;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 14px;
    min-width: 20px;
    text-align: center;
    display: inline-block;
}

@keyframes countBlink {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.pulse-once {
    animation: pulse 0.5s ease-in-out;
}

/* Checkout Modal */
.checkout-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.checkout-modal.visible {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
}

.checkout-content {
    position: relative;
    width: 90%;
    max-width: 400px;
    margin: 0 auto;
    background: transparent;
}

.receipt-paper {
    background: #fff;
    font-family: 'VT323', monospace;
    padding: 20px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.4;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.store-header {
    text-align: center;
    margin-bottom: 20px;
    white-space: pre-line;
}

.checkout-items {
    margin: -20px 20px 20px 20px;
    font-family: 'VT323', monospace;
    white-space: pre-wrap;
}

.calculate-total-btn {
    width: 100%;
    padding: 10px;
    background: #000;
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: 'VT323', monospace;
    font-size: 14px;
    margin: 20px 0;
}

.calculate-total-btn {
    font-family: 'VT323', monospace;
    font-size: 20px;
    padding: 10px 20px;
    margin: 20px 0;
    background: #fff;
    border: 2px solid #000;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #000;
}

.calculate-total-btn:hover {
    transform: translateY(-2px);
    box-shadow: 7px 7px 0px #8B4513;
    cursor: url('../cursors/circle-filled.svg') 12 12, default;
}

.calculate-total-btn.close-cart-btn {
    background: #f8f8f8;
}

.loading-animation {
    display: none;
    text-align: center;
    margin: 20px 0;
    transform: translateY(-50%);
}

.loading-dots {
    display: inline-block;
    font-size: 24px;
    letter-spacing: 4px;
    margin-bottom: 8px;
    transform: translateY(-50%);
}

.loading-dots span {
    display: inline-block;
    animation: blink 1s infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0%, 20% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.loading-message {
    font-family: monospace;
    font-size: 14px;
    letter-spacing: 1px;
    opacity: 0.8;
}

.checkout-info {
    text-align: center;
    margin: 15px 0;
    font-family: monospace;
    line-height: 1.5;
}

.checkout-message {
    font-size: 14px;
    margin-bottom: 8px;
    opacity: 0.9;
    font-style: italic;
}

.remaining-checkouts {
    font-size: 13px;
    opacity: 0.8;
}

.remaining-count {
    font-weight: bold;
    color: #000;
}

.poem-container {
    white-space: pre-wrap;
    font-family: 'VT323', monospace;
    line-height: 1.3;
    text-align: left;
    padding: 20px 40px;
    font-size: 16px;
    max-width: 350px;
    margin: 0 auto;
}

.poem-container strong {
    font-weight: bold;
    font-size: 1.1em;
    color: #000;
    display: block;
    margin: 10px 0;
    text-align: center;
    font-family: 'VT323', monospace;
}

.poem-container:first-child {
    text-align: center;
}

.poem-container p {
    margin: 8px 0;
    padding: 0;
}

.receipt-divider {
    margin: 5px 0;
    white-space: nowrap;
    width: 100%;
    text-align: center;
}

.receipt-footer {
    text-align: center;
    margin-top: 20px;
    white-space: pre-line;
}

.share-container {
    margin: 20px 0;
    text-align: center;
}

.share-container button {
    margin: 0 10px;
    font-family: 'VT323', monospace;
}

.print-twitter-btn,
.print-photos-btn {
    background: none;
    border: none;
    color: #000;
    cursor: pointer;
    font-family: 'VT323', monospace;
    font-size: 14px;
    margin: 10px 0;
    padding: 5px 10px;
    text-align: center;
    width: 100%;
}

.print-twitter-btn:hover,
.print-photos-btn:hover {
    background-color: #f0f0f0;
}

.print-twitter-btn {
    background: none;
    color: #000;
    border: none;
    padding: 10px 20px;
    font-family: 'VT323', monospace;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.print-twitter-btn:hover {
    opacity: 0.7;
}

.receipt-section {
    white-space: pre;
    font-family: 'VT323', monospace;
    text-align: center;
    margin: 20px 0;
}

/* Preview Overlay */
.preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.preview-content {
    background: white;
    padding: 10px 20px 5px;
    border-radius: 4px;
    max-width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.preview-content .receipt-paper {
    margin: 0;
    padding: 0;
    transform: scale(0.7);
    transform-origin: top center;
    margin-bottom: -60px;  /* Pull up the buttons more */
}

.preview-content .receipt-paper > * {
    margin: 2px 0;
}

.preview-content .receipt-paper > *:first-child {
    margin-top: 0;
}

.preview-content .receipt-paper > *:last-child {
    margin-bottom: 0;
}

.preview-content .print-photos-btn {
    margin-top: 5px;
}

.preview-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.preview-buttons {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.preview-button {
    background: none;
    border: none;
    color: #000;
    cursor: pointer;
    font-family: 'VT323', monospace;
    font-size: 1.2em;
    font-weight: 300;
    padding: 10px 20px;
    transition: all 0.2s ease;
}

.preview-button:hover {
    background-color: #f0f0f0;
}

.preview-button:last-of-type {
    background: #000;
    color: #fff;
    border: 2px solid #000;
    box-shadow: 5px 5px 0px #8B4513;
}

.preview-button:last-of-type:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 7px 7px 0px #8B4513;
}

.preview-header {
    font-family: 'VT323', monospace;
    text-align: center;
    margin-bottom: 20px;
    color: #000;
}

.preview-header .store-header {
    font-size: 14px;
    line-height: 1.5;
}

.preview-header .receipt-divider {
    margin-top: 10px;
    font-size: 14px;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    70% {
        transform: translateY(-2px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.preview-button {
    opacity: 0;
}

.preview-button.animate {
    animation: fadeInUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Stagger the animations */
.preview-button:nth-child(1).animate {
    animation-delay: 0.3s;
}

.preview-button:nth-child(2).animate {
    animation-delay: 0.4s;
}

.preview-button:nth-child(3).animate {
    animation-delay: 0.5s;
}

/* Print styles */
@media print {
    .checkout-modal {
        position: static;
        background: white;
    }
    
    .checkout-content {
        border: none;
        box-shadow: none;
    }
    
    .action-buttons,
    .close-button,
    .calculate-total-btn {
        display: none;
    }
}

.modal-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
    padding-bottom: 20px;
}

.clear-cart-btn,
.close-modal-btn {
    background: none;
    border: none;
    color: #000;
    cursor: pointer;
    font-family: 'VT323', monospace;
    font-size: 1.2em;
    padding: 5px 10px;
    transition: opacity 0.3s ease;
}

.clear-cart-btn:hover,
.close-modal-btn:hover {
    opacity: 0.7;
}

.clear-cart-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: none;
    border: none;
    color: #666;
    padding: 15px;
    margin: 20px 0;
    font-family: 'VT323', monospace;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}

.clear-cart-btn:hover {
    color: #000;
    text-decoration: none;
}

.cart-clear-confirm {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 10px 20px;
    border: 2px solid #000;
    font-family: 'VT323', monospace;
    font-size: 1.2em;
    animation: slideUp 2s ease-out forwards;
    z-index: 1000;
}

@keyframes slideUp {
    0% {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    10% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    90% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
}

/* Clear cart styles */
.modal-buttons {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    padding-bottom: 20px;
}

.clear-cart-btn {
    background: none;
    border: none;
    color: #000;
    cursor: pointer;
    font-family: 'VT323', monospace;
    font-size: 1.2em;
    padding: 5px 10px;
    transition: opacity 0.3s ease;
}

.clear-cart-btn:hover {
    opacity: 0.7;
}

.cart-clear-confirm {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 10px 20px;
    border: 2px solid #000;
    font-family: 'VT323', monospace;
    font-size: 1.2em;
    animation: slideUp 2s ease-out forwards;
    z-index: 1000;
}

@keyframes slideUp {
    0% {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    10% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    90% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
}

/* Menu styles */
.menu-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 30px 0;
    padding: 20px;
}

.menu-btn {
    background: none;
    border: none;
    color: #000;
    cursor: pointer;
    font-family: 'VT323', monospace;
    font-size: 1.5em;
    padding: 10px 20px;
    transition: all 0.3s ease;
    position: relative;
}

.menu-btn:hover {
    opacity: 0.7;
    transform: translateX(5px);
}

.menu-btn::before {
    content: '>';
    position: absolute;
    left: -20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-btn:hover::before {
    opacity: 1;
}

.back-to-menu-btn {
    background: none;
    border: none;
    color: #000;
    cursor: pointer;
    font-family: 'VT323', monospace;
    font-size: 1.2em;
    padding: 5px 10px;
    transition: opacity 0.3s ease;
    margin-top: 20px;
}

.back-to-menu-btn:hover {
    opacity: 0.7;
}

.save-indicator {
    position: fixed;
    z-index: 2000;
    background: #000;
    color: #fff;
    padding: 4px 8px;
    border-radius: 2px;
    font-family: 'VT323', monospace;
    font-size: 12px;
    pointer-events: none;
    transform-origin: center;
    will-change: transform, left, top;
}

.cart-confirm-dialog,
.cart-cleared-msg {
    background-color: #000;
    color: #fff;
    padding: 15px;
    border-radius: 4px;
    z-index: 1000;
    font-family: 'VT323', monospace;
    font-size: 1.2em;
    text-align: center;
}

.cart-confirm-dialog .confirm-buttons {
    margin-top: 10px;
}

.cart-confirm-dialog .menu-btn {
    margin: 0 5px;
    font-size: 1em;
}

.cart-cleared-msg {
    opacity: 1;
}

.hidden {
    display: none !important;
}

.print-btn-container {
    text-align: center;
    margin-top: 20px;
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.checkout-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2100;
}

.dialog-content {
    background: white;
    padding: 20px;
    font-family: 'VT323', monospace;
    text-align: center;
    line-height: 1.5;
    min-width: 300px;
}

.dialog-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.dialog-content .store-header {
    margin-bottom: 10px;
}

.dialog-content .receipt-divider {
    margin: 10px 0;
    opacity: 0.7;
}

.cart-empty-msg {
    position: absolute;
    transform: translateX(-110%);
    padding: 10px 20px;
    font-family: 'VT323', monospace;
    z-index: 1001;
    white-space: nowrap;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(10px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}

.guest-info {
    font-family: 'VT323', monospace;
    text-align: center;
    margin: 0px 0;
    opacity: 0.9;
}

.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1002;
}

.dialog-content {
    background: #fff;
    border: 2px solid #000;
    box-shadow: 5px 5px 0px #8B4513;
    padding: 20px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    font-family: 'VT323', monospace;
    animation: fadeInUp 0.3s ease-out;
}

.dialog-title {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #000;
}

.dialog-message {
    margin-bottom: 20px;
    color: #000;
    font-size: 1.2em;
}

.dialog-input {
    width: 100%;
    padding: 8px;
    margin-bottom: 20px;
    border: 2px solid #000;
    font-family: 'VT323', monospace;
    font-size: 1.1em;
}

.dialog-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.dialog-button {
    background: #000;
    color: #fff;
    border: 2px solid #000;
    padding: 8px 16px;
    cursor: pointer;
    font-family: 'VT323', monospace;
    font-size: 1.1em;
    transition: all 0.2s ease;
}

.dialog-button:hover {
    background: #fff;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 3px 3px 0px #8B4513;
}

.dialog-button.cancel {
    background: #fff;
    color: #000;
}

.dialog-button.cancel:hover {
    background: #f0f0f0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading-warning {
    font-family: 'VT323', monospace;
    font-size: 0.8em;
    color: #999;
    margin-top: 4px;
    font-style: italic;
}

/* Hide all buttons when generating receipt */
.generating-receipt .menu-btn,
.generating-receipt .clear-cart-btn,
.generating-receipt .print-btn,
.generating-receipt .print-btn-container,
.generating-receipt button {
    display: none !important;
}

/* Cart Display Styles */
#session-data {
    font-family: 'VT323', monospace;
    font-size: 16px;
    line-height: 1.3;
    white-space: pre-wrap;
    text-align: left;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    margin: 20px auto;
    max-width: 400px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#session-data:empty {
    display: none;
}
