﻿/* -------------------------
   General Dark Theme
------------------------- */
body, html {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: #1e1e1e;
    color: #fff;
    overflow:hidden;
    height: 100%;
}

.pos-root {
    display: flex;
    flex-direction: column;
    height: 100vh; /* keep full screen */
}
/* Header */
.pos-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #111;
    color: #fff;
    padding: 0.5rem 1rem;
  
}

.pos-header a {
    color: #fff;
    text-decoration: none;
}

.pos-title {
    font-weight: bold;
    font-size: 1.2rem;
}

/* POS Body */
.pos-body {
    display: flex;
    flex: 1;
    overflow: hidden;

}

/* Left: Products */
.pos-products {
    flex: 2;
    background: #1b1b1b;
    overflow-y: auto;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* totals at bottom */
}

.table-header, .product-row, .totals div {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr;
    gap: 0.5rem;
    align-items: center;
    padding: 0.25rem 0;
}

.table-header {
    font-weight: bold;
    border-bottom: 1px solid #333;
}

.product-row {
    border-bottom: 1px dashed #333;
}

.totals {
    margin-top: 1rem;
}

.totals div {
    display: flex;
    justify-content: space-between;
    color: #fff;
}

.totals .total {
    border-top: 1px dashed #555;
    font-weight: bold;
}

/* Right: Actions */
.pos-actions {
    flex: 1;
    background: #222;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  
}

/* Keep top-actions fixed at top */
.top-actions {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.fkey {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.fkey i {
    font-size: 1rem;
}

/* Payment Tabs */
.pay-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.pay-tabs button {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 0;
    background: #333;
    color: #fff;
    font-weight: bold;
}

.pay-tabs button.active {
    background: #007bff;
}

/* Logo Area */
.logo-area {
    text-align: center;
    font-weight: bold;
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: #666;
}

/* Mid Action Buttons */
.mid-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
    margin-top: auto; /* push down */
    margin-bottom: 0.25rem;
}

.skey {
    background: #333;
    color: #fff;
    border: none;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
}

/* Bottom Payment Buttons */
.button-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
    margin-bottom: 2.5rem;
}

.button-group .pay {
    background: #28a745;
    color: #fff;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    padding: 0.5rem;
    cursor: pointer;
}

.button-group .void {
    background: #dc3545;
    color: #fff;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    padding: 0.5rem;
    cursor: pointer;
}

/* Scrollbars */
.pos-products::-webkit-scrollbar,
.pos-actions::-webkit-scrollbar {
    width: 8px;
}

.pos-products::-webkit-scrollbar-thumb,
.pos-actions::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}
/* -------------------------
   Header Layout Fix
------------------------- */
.pos-header {
    display: flex;
    align-items: center;
    justify-content: start;
    background: #111;
    color: #fff;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #333;

}

/* Left section (Exit button) */
.pos-header > .d-flex:first-child {
    display: flex;
    align-items: center;
}

/* Center section (Title) */
.pos-header .pos-title {
    flex: 1;
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Right section (Settings + Search) */
.pos-header .right-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Search input in header */
.pos-header input {
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    border: none;
    outline: none;
    font-size: 0.9rem;
    background: #333;
    color: #fff;
    min-width: 65%;
}

/* Search icon inside header */
.pos-header i.bi-search {
    margin-right: 0.3rem;
}
.product-row:hover {
    background:#0096FF;
    color:white;
}
.del:hover {
    background:red;
    color:white;
}
.search:hover {
    background:green;
    color:white;
}
.qty:hover {
    background:#0096FF;
    color:white;
}
.sale:hover {
     background:red;
     color:white;
}

/* -------------------------
   Mobile Responsive
------------------------- */
@media (max-width: 768px) {
    .pos-body {
        flex-direction: column;
    }

    /* Left panel scroll only */
    .pos-products {
        flex: unset;
        width: 100%;
        max-height: 50vh;
    }

    /* Right panel fixed buttons */
    .pos-actions {
        flex: unset;
        width: 100%;
        max-height: none;
        position: sticky;
        bottom: 0;
        background: #222;
        padding: 0.5rem;
        z-index: 10;
    }

    .top-actions, .mid-actions, .button-group {
        flex-wrap: wrap;
    }

    .top-actions .fkey, .mid-actions .skey, .button-group button, .pay-tabs button {
        font-size: 0.7rem;
        padding: 0.4rem;
    }

    .mid-actions {
        grid-template-columns: repeat(2, 1fr);
        margin-top: 0.25rem;
    }

    .button-group {
        grid-template-columns: repeat(2, 1fr);
        margin-bottom: 0.25rem;
    }

    .logo-area {
        font-size: 0.8rem;
    }

    .table-header, .product-row, .totals div {
        grid-template-columns: 2fr 1fr 1fr 1fr; /* keep all columns visible */
    }
}

/* Modal overlay */
.modal {
  display: none; /* hidden by default */
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7); /* semi-transparent dark */
  justify-content: center;
  align-items: center;
}

/* Modal content box */
.modal-content {
  background: #1c1c1c; /* dark theme */
  color: #fff;
  padding: 20px;
  border-radius: 15px;
  width: 90%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

/* Modal headings */
.modal-content h3 {
  margin-bottom: 5px;
  font-size: 1.4rem;
}
.modal-content p {
  margin-bottom: 15px;
  font-size: 1rem;
  color: #ccc;
}

/* Quantity input */
#qtyInput {
  width: 80%;
  padding: 12px;
  font-size: 1.5rem;
  text-align: right;
  border-radius: 8px;
  border: none;
  margin-bottom: 15px;
  background: #2b2b2b;
  color: #fff;
  outline: none;
  -moz-appearance: textfield; /* Firefox */
}
#qtyInput::-webkit-inner-spin-button,
#qtyInput::-webkit-outer-spin-button {
  -webkit-appearance: none; /* remove arrows Chrome/Safari */
  margin: 0;
}

.calculator .remove,
.calculator .enter {
  grid-column: span 2; /* This will make the button span all columns */
}

/* Calculator grid */
.calculator {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
}

/* Calculator buttons */
.calculator button {
  padding: 18px 0;
  font-size: 1.2rem;
  border: none;
  border-radius: 10px;
  background: #333;
  color: #fff;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.2s;
}



/* Special buttons */
.calculator .esc {
  background: #f44336;
  color: #fff;
  font-weight: bold;
  width: 100%;
}

.calculator .remove {
  background: #ff9800;
  color: #fff;
  width: 100%; /* full width */
}

.calculator .enter {
  background: #4caf50;
  color: #fff;
  font-size: 1.3rem;
  width: 100%; /* full width */
}
/* Close button */
.close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.5rem;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  transition: color 0.2s;
}

.close-modal:hover {
  color: #f44336; /* red on hover */
}
.discount-panel {
  position: relative;
}

.close-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 22px;
  cursor: pointer;
  color: #aaa;
}

.close-btn:hover {
  color: #fff;
}
/* ===== Modal overlay ===== */
.discount-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;              /* JS দিয়ে show/hide */
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* ===== Panel ===== */
.discount-panel {
  background: #1e1e1e;
  color: #fff;
  width: 95%;
  max-width: 380px;
  border-radius: 16px;
  padding: 16px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

/* ===== Close button ===== */
.close-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 1.6rem;
  cursor: pointer;
  color: #bbb;
}
.close-btn:hover {
  color: #ff5252;
}

/* ===== Tabs ===== */
.discount-tabs {
  display: flex;
  background: #2b2b2b;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.discount-tabs .tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  color: #bbb;
}

.discount-tabs .tab.active {
  background: #4caf50;
  color: #fff;
  font-weight: 600;
}

/* ===== Heading ===== */
.discount-panel h3 {
  text-align: center;
  margin: 10px 0 12px;
  font-size: 1.2rem;
}

/* ===== % / ₹ toggle ===== */
.toggle {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.toggle button {
  flex: 1;
  padding: 8px 0;
  border-radius: 8px;
  border: none;
  background: #333;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}

.toggle button.active {
  background: #2196f3;
}

/* ================= MODAL ================= */
.discount-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  z-index: 9999;
}

.discount-modal.show {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ================= PANEL ================= */
.discount-panel {
  background: #1f1f1f;
  color: #fff;
  width: 95%;
  max-width: 380px;
  border-radius: 18px;
  padding: 10px;
  position: relative;
  box-shadow: 0 15px 40px rgba(0,0,0,0.6);
}

/* ================= CLOSE ================= */
.close-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 1.6rem;
  cursor: pointer;
  color: #aaa;
}
.close-btn:hover {
  color: #ff4d4d;
}

/* ================= TABS ================= */
.discount-tabs {
  display: flex;
  background: #2b2b2b;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 5px;
}

.discount-tabs .tab {
  flex: 1;
  text-align: center;
  padding: 5px;
  font-size: 0.95rem;
  cursor: pointer;
  color: #bbb;
}

.discount-tabs .tab.active {
  background: #4caf50;
  color: #fff;
  font-weight: 600;
}

/* ================= HEADING ================= */
.discount-panel h3 {
  text-align: center;
  margin: 10px 0 14px;
  font-size: 1.25rem;
}

/* ================= TOGGLE ================= */
.toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.toggle button {
  flex: 1;
  padding: 5px 0;
  border-radius: 10px;
  border: none;
  background: #333;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}

.toggle button.active {
  background: #2196f3;
}

/* ================= DISPLAY ================= */
.discount-display {
  background: #2b2b2b;
  border-radius: 12px;
  padding: 8px;
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 14px;
}

.discount-display .value {
  font-size: 2.2rem;
  font-weight: bold;
  line-height: 1;
}

.discount-display .unit {
  font-size: 1.2rem;
  color: #bbb;
  align-self: flex-end;
}

/* ================= KEYPAD ================= */
.calculator {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-bottom: 10px;
}

.calculator button {
  padding: 8px 0;
  border: none;
  border-radius: 12px;
  background: #333;
  color: #fff;
  font-size: 1.15rem;
  cursor: pointer;
}


/* ===== Special Keys ===== */
.calculator .remove {
  background: #ff9800;
  font-size: 1.3rem;
  grid-column: span 2;
}

.calculator .esc {
  background: #f44336;
  text-transform: uppercase;
}

.calculator .enter {
  background: #4caf50;
  font-size: 1.4rem;
  grid-column: span 3;
}

/* ================= CLEAR ================= */
.clear {
  width: 100%;
  padding: 7px;
  border-radius: 12px;
  border: none;
  background: #555;
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
}

/* ===== KEYPAD SPAN FIX ===== */

/* Backspace (orange) – 2 columns */
.calculator .remove {
  grid-column: span 2;
  background: #ff9800;
  font-size: 1.3rem;
}

/* ESC – 1 column */
.calculator .esc {
  grid-column: span 1;
  background: #f44336;
  text-transform: uppercase;
}

/* ENTER – FULL WIDTH like image */
.calculator .enter {
  grid-column: span 2;   /* 🔥 THIS WAS THE ISSUE */
  background: #4caf50;
  font-size: 1.5rem;
}

/* Improve button height like POS */
.calculator button {
  padding: 18px 0;
  border-radius: 12px;
}

/* ================= MOBILE ================= */
@media (max-width: 360px) {
  .discount-panel {
    padding: 14px;
  }

  .calculator button {
    padding: 14px 0;
    font-size: 1rem;
  }

  .discount-display .value {
    font-size: 2rem;
  }
}

.customer-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.customer-modal.show {
  display: flex;
}

.customer-box {
  background: #3a3a3a;
  padding: 40px 50px;
  border-radius: 6px;
  text-align: center;
  min-width: 420px;
  color: #fff;
}

.customer-icon i {
  font-size: 64px;
  margin-bottom: 20px;
}

.customer-box h2 {
  font-weight: 300;
  margin-bottom: 20px;
}

.input-wrap {
  position: relative;
  margin-bottom: 25px;
}

.input-wrap input {
  width: 100%;
  padding: 12px 40px 12px 12px;
  background: #2b2b2b;
  border: 1px solid #2196f3;
  color: #fff;
  font-size: 16px;
  outline: none;
}

.input-wrap i {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  opacity: .7;
}

.customer-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.btn-green {
  background: #4caf50;
  border: none;
  padding: 10px 28px;
  color: #fff;
  cursor: pointer;
}

.btn-red {
  background: #c62828;
  border: none;
  padding: 10px 28px;
  color: #fff;
  cursor: pointer;
}

/* ===== Overlay ===== */
.refund-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.refund-modal.show {
  display: flex;
}

/* ===== Panel ===== */
.refund-right {
  width: 420px;
  max-width: 95%;
  background: #2f2f2f;
  border-radius: 14px;
  padding: 28px 24px 80px;
  color: #ddd;
  position: relative;
  text-align: center;
}

/* ===== Close ===== */
.refund-close {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 18px;
  cursor: pointer;
}

/* ===== Icon ===== */
.refund-icon i {
  font-size: 44px;
  margin-bottom: 10px;
}

/* ===== Text ===== */
.refund-text {
  font-size: 14px;
  color: #bbb;
  margin-bottom: 20px;
}

/* ===== Input ===== */
.refund-input {
  width: 100%;
  padding: 12px;
  background: #1f1f1f;
  border: 1px solid #2196f3;
  color: #fff;
  border-radius: 6px;
  margin: 8px 0 20px;
  font-size: 16px;
}

/* ===== Payment types ===== */
.refund-types {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.ptype {
  padding: 14px 0;
  background: #3a3a3a;
  border: 1px solid #555;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.ptype.active {
  background: #2196f3;
  border-color: #2196f3;
  position: relative;
}

.ptype.active::before {
  content: "✓";
  position: absolute;
  top: -8px;
  left: -8px;
  background: #2196f3;
  color: #fff;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 12px;
}

/* ===== Bottom actions ===== */
.refund-actions {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-ok {
  background: #4caf50;
  border: none;
  padding: 14px 0;
  color: #fff;
  font-size: 16px;
  border-radius: 8px;
}

.btn-cancel {
  background: #c62828;
  border: none;
  padding: 14px 0;
  color: #fff;
  font-size: 16px;
  border-radius: 8px;
}

/* ===== Mobile ===== */
@media (max-width: 480px) {
  .refund-right {
    width: 100%;
    height: 100%;
    max-width: none;
    border-radius: 0;
    padding: 20px 16px 90px;
  }

  .refund-icon i {
    font-size: 38px;
  }

  .ptype {
    padding: 16px 0;
    font-size: 15px;
  }
}
