/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600&display=swap');

:root {
    --bg-color: #f9f9f9;
    --primary-purple: #DCD0FF;
    /* Pastel Purple */
    --primary-green: #C1E1C1;
    /* Pastel Green */
    --dark-text: #4a4a4a;
    --white: #ffffff;
    --danger: #ffb3b3;
}

body {
    font-family: 'Prompt', sans-serif;
    background-color: var(--bg-color);
    color: var(--dark-text);
    margin: 0;
    padding: 0;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.card {
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-bottom: 20px;
}

.card .title {
    margin-top: 0;
    color: #6a5acd;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Prompt', sans-serif;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
}

.login {
    width: 100%;
}

.btn-purple {
    background-color: var(--primary-purple);
    color: #5a4b8a;
}

.btn-red {
    background-color: #ffd0d0;
    color: #8a4b4b;
}

.btn-green {
    background-color: var(--primary-green);
    color: #3d6e3d;
}

.btn-danger {
    background-color: var(--danger);
    color: #7a2e2e;
}

/* Forms */
input,
select {
    width: 100%;
    padding: 10px;
    margin: 5px 0 15px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: 'Prompt', sans-serif;
}

/* Mobile Specific */
.mobile-menu {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.mobile-btn {
    padding: 30px;
    text-align: center;
    font-size: 1.2rem;
    border-radius: 20px;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: var(--primary-purple);
    color: #5a4b8a;
}

/* style.css */
.error-banner {
    background-color: #ffb3b3;
    /* Pastel Red */
    color: #7a2e2e;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    border-left: 5px solid #ff4d4d;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* พื้นหลังสีดำจางๆ */
.modal-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: 1000;
    backdrop-filter: blur(2px);
    /* เบลอฉากหลังนิดๆ */
    animation: fadeIn 0.2s ease;
}

/* กล่อง Modal ตรงกลาง */
.modal-card {
    background: #fff;
    width: 90%;
    max-width: 400px;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(0);
    animation: slideUp 0.3s ease;
}

.modal-card .action {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-direction: column;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 0.9rem;
    color: #666;
}

.form-group .form-qty {
    display: flex;
    gap: 0.5rem;
}

.form-group .form-qty .input-qty {
    text-align: center;
}


@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.input-pastel {
    width: 100%;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 12px;
    background-color: #fcfcfc;
    font-family: 'Prompt', sans-serif;
    font-size: 1rem;
    color: var(--dark-text);
    outline: none;
    transition: all 0.3s ease;
}

.input-pastel:focus {
    border-color: var(--primary-purple);
    /* สีม่วงพาสเทล */
    box-shadow: 0 0 8px rgba(220, 208, 255, 0.5);
}


/* Notification */
.toast-container {
    width: 70%;
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    /* สูงกว่า Modal ปกติ */
    animation: fadeInDown 0.4s ease;
}

.toast-content {
    background: #28a745;
    /* สีเขียว Pastel */
    color: white;
    padding: 12px 25px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    justify-content: center;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes fadeOutUp {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    to {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
}


/* Summary List */
.floating-basket {
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 65px;
    height: 65px;
    background: #6a5acd;
    /* ม่วงเข้มพาสเทล */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(106, 90, 205, 0.4);
    cursor: pointer;
    z-index: 999;
    transition: transform 0.2s;
}

.floating-basket:active {
    transform: scale(0.9);
}

.basket-icon {
    font-size: 2.8rem;
}

.basket-icon img {
    width: 2rem;
}

.basket-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4d4d;
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-weight: bold;
    border: 2px solid white;
}

.product-scanned {
    background-color: #e8f5e9 !important;
    border: 1px solid #28a745;
    border-radius: 10px;
}