/* =========================================
HIGH CONTRAST, RETRO, AND 70s DISCO THEME STYLES
========================================= */

:root {
    --bg: #f4f4f0;
    --text: #1a1a1a;
    --border: #000;
    --accent: #ff4747;
    --panel: #fff;
    --header-bg: #e5e5df;
}

body {
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

h1,
h2,
h3 {
    margin-top: 0;
    text-transform: uppercase;
}

.logo {
    font-family: 'Georgia', serif;
    font-weight: 900;
    color: var(--bg);
    text-shadow: 2px 2px 0px var(--accent), 4px 4px 0px #ffb3ba, 6px 6px 0px var(--border);
    letter-spacing: -2px;
    transform: rotate(-3deg);
    margin: 0;
    cursor: default;
}

.btn {
    background: var(--panel);
    border: 3px solid var(--border);
    box-shadow: 4px 4px 0px var(--border);
    font-family: inherit;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.05s ease-in-out;
    text-transform: uppercase;
    padding: 10px 20px;
}

.btn:active {
    box-shadow: 0px 0px 0px var(--border);
    transform: translate(4px, 4px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: 0px 0px 0px var(--border);
    transform: translate(4px, 4px);
}

/* Public Landing Page & Auth Screens */
#loadingScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

#authScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
}

.lp-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 4px solid var(--border);
    background: var(--panel);
}

.lp-hero {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 60px;
    padding: 60px 40px;
    border-bottom: 4px solid var(--border);
    background: var(--header-bg);
    min-height: 70vh;
}

.lp-hero-text {
    max-width: 500px;
}

.lp-hero-text h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.lp-hero-text p {
    font-size: 1.2rem;
    line-height: 1.5;
    margin-bottom: 30px;
}

.lp-badge {
    display: inline-block;
    background: #baffc9;
    padding: 5px 10px;
    border: 2px solid var(--border);
    font-weight: bold;
    margin-bottom: 20px;
    box-shadow: 2px 2px 0px var(--border);
}

.lp-section {
    padding: 60px 40px;
    border-bottom: 4px solid var(--border);
}

.lp-section h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 40px;
}

.lp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.lp-card {
    background: var(--panel);
    border: 4px solid var(--border);
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.lp-card-price {
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: auto;
    padding-top: 15px;
}

/* Landing Page Hero Image Container */
.lp-hero-img-container {
    border: 4px solid var(--border);
    background: var(--panel);
    box-shadow: 12px 12px 0px var(--border);
    max-width: 550px;
    width: 100%;
    flex: 1 1 400px;
    display: flex;
    flex-direction: column;
    transform: rotate(1deg);
    transition: transform 0.1s ease-in-out;
}

.lp-hero-img-container:hover {
    transform: rotate(0deg);
}

.lp-hero-img-header {
    background: #d4d4d0;
    border-bottom: 4px solid var(--border);
    padding: 8px 12px;
    font-weight: bold;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lp-hero-img-header::before {
    content: "■ ■ ■";
    letter-spacing: 2px;
    font-size: 0.8rem;
}

.lp-hero-img {
    width: 100%;
    max-width: 100%;
    /* Ensures it never breaks the container width */
    height: auto;
    /* Allows proportional shrinking */
    display: block;
    border: none;
    background: var(--bg);
    object-fit: cover;
}

/* Landing Page Image Container */
.lp-img-container {
    border: 4px solid var(--border);
    background: var(--panel);
    box-shadow: 12px 12px 0px var(--border);
    width: 100%;
    max-width: 300px;
    flex: 1 1 100px;
    display: flex;
    flex-direction: column;
    transform: rotate(1deg);
    transition: transform 0.1s ease-in-out;
}

.lp-img-container:hover {
    transform: rotate(0deg);
}

.lp-img-header {
    background: #d4d4d0;
    border-bottom: 4px solid var(--border);
    padding: 8px 12px;
    font-weight: bold;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lp-img-header::before {
    content: "■ ■ ■";
    letter-spacing: 2px;
    font-size: 0.7rem;
}

.footer-badge-1 {
    position: absolute;
    left: 40px; /* Matches the padding of your container */
    top: 50%;
    transform: translateY(-50%); /* Vertically centers the image */
    
    max-width: 100px; /* Keep it small, adjust as needed */
    height: auto;
}

.footer-badge-1 {
    border: 3px solid var(--border);
    box-shadow: 4px 4px 0px var(--border);
}

.footer-badge-2 {
    position: absolute;
    right: 40px; /* Matches the padding of your container */
    top: 50%;
    transform: translateY(-50%); /* Vertically centers the image */
    
    max-width: 100px; /* Keep it small, adjust as needed */
    height: auto;
}

.footer-badge-2 {
    border: 3px solid var(--border);
    box-shadow: 4px 4px 0px var(--border);
}

.auth-box {
    background: var(--panel);
    border: 4px solid var(--border);
    padding: 40px;
    width: 350px;
    text-align: center;
    box-shadow: 12px 12px 0px var(--accent);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-input {
    padding: 12px;
    font-family: inherit;
    font-size: 1rem;
    border: 2px solid var(--border);
    background: var(--bg);
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

#appContainer {
    display: none;
    height: 100%;
    flex-direction: column;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: var(--header-bg);
    border-bottom: 4px solid var(--border);
}

/* PIN Pad Screen */
#pinScreen {
    display: none;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--bg);
    z-index: 50;
}

.pin-btn {
    font-size: 1.5rem;
    padding: 20px;
}

.main-workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.grid-section {
    flex: 2;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    align-content: start;
    overflow-y: auto;
}

.cart-section {
    flex: 1;
    background: var(--panel);
    border-left: 4px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.product-btn {
    height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    border: 2px solid var(--border);
    padding: 10px;
    margin-bottom: 20px;
    background: var(--bg);
}

.cart-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 2px dashed #ccc;
    font-weight: bold;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 50;
}

.modal {
    background: var(--panel);
    border: 4px solid var(--border);
    padding: 30px;
    width: 500px;
    max-width: 90vw;
    box-shadow: 12px 12px 0px var(--accent);
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
}

.crud-list {
    max-height: 200px;
    overflow-y: auto;
    border: 2px solid var(--border);
    background: var(--bg);
    padding: 5px;
    margin-bottom: 15px;
}

.crud-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    border-bottom: 1px solid #ccc;
}

#receiptPrintArea {
    display: none;
}

@media print {
    body {
        background: #fff;
        color: #000;
    }

    #loadingScreen,
    #authScreen,
    #appContainer,
    .modal-overlay,
    #lockoutScreen {
        display: none !important;
    }

    #receiptPrintArea {
        display: block !important;
        width: 58mm;
        font-family: 'Courier New', Courier, monospace;
        font-size: 12px;
        color: #000;
        padding: 10px;
        margin: 0 auto;
    }

    .receipt-line {
        border-bottom: 1px dashed #000;
        margin: 5px 0;
    }

    .receipt-flex {
        display: flex;
        justify-content: space-between;
    }
}



/* =========================================
RESPONSIVE DESIGN REVAMP (MOBILE & TABLET)
========================================= */
@media (max-width: 768px) {

    /* 1. Main Workspace - Stack Grid & Cart Vertically */
    .main-workspace {
        flex-direction: column;
        overflow-y: auto;
    }

    .grid-section {
        flex: none;
        height: 50vh;
        /* Gives the product grid half the screen */
        overflow-y: auto;
    }

    .cart-section {
        flex: none;
        border-left: none;
        border-top: 4px solid var(--border);
        height: auto;
    }

    /* 2. Fluid Modals - Remove Hardcoded Widths */
    .modal,
    .modal[style*="width"] {
        /* Targets inline styles overriding widths */
        width: 95% !important;
        max-width: 500px;
        padding: 20px;
        box-sizing: border-box;
    }

    /* 3. Authentication & Login Box */
    .auth-box {
        width: 90%;
        padding: 20px;
        box-sizing: border-box;
    }

    /* 4. Header & Navigation Wrap */
    header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        padding: 15px;
    }

    header>div {
        justify-content: center;
        flex-wrap: wrap;
    }

    .btn {
        font-size: 0.9rem;
        /* Prevents button text from blowing out */
        padding: 8px 12px;
    }

    /* 5. Landing Page Adjustments */
    .lp-hero {
        padding: 30px 20px;
        gap: 30px;
    }

    .lp-hero-text h1 {
        font-size: 2.2rem;
    }

    .lp-nav {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .lp-hero-img-container {
        width: 100%;
        flex: 1 1 100%;
        max-width: none;
    }
    .footer-badge {
        display: none;
    }
}

/* =========================================
EASTER EGG ANIMATIONS
========================================= */

@keyframes spin { 100% { transform: rotate(360deg); } }
        @keyframes boogie { 
            0% { transform: translateY(0px) rotate(-15deg) scale(1); } 
            100% { transform: translateY(-30px) rotate(15deg) scale(1.2); } 
        }
        @keyframes colorHustle {
            0% { background-color: #ff00ff; }
            25% { background-color: #00ffff; }
            50% { background-color: #ffff00; }
            75% { background-color: #ff4747; }
            100% { background-color: #4ade80; }
        }
        .groovy-text {
            font-family: 'Georgia', serif;
            font-size: 3rem;
            font-weight: 900;
            color: #fff;
            text-transform: uppercase;
            text-shadow: 4px 4px 0px #000, 8px 8px 0px #ff00ff;
            letter-spacing: 2px;
            margin-bottom: 20px;
        }