/* public/style.css (เวอร์ชันสมบูรณ์) */
body {
    font-family: 'Noto Sans Thai', sans-serif;
    -webkit-tap-highlight-color: transparent;
}
.pin-dot { transition: background-color: 0.3s ease; }
.pin-dot.active { background-color: #f97316; } /* orange-500 */
.keypad-btn { transition: background-color: 0.2s ease-in-out, transform: 0.1s ease; }
.keypad-btn:active { background-color: #f3f4f6; transform: scale(0.95); } /* gray-100 */
.mode-btn, .period-select-btn, .history-item { transition: all 0.2s ease-in-out; }
.mode-btn:active, .period-select-btn:active, .history-item:active { transform: scale(0.97); box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.shake { animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translate3d(0, -20px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translate3d(0, 20px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}
.animate-fade-in-down { animation: fadeInDown 0.5s ease-out both; }
.animate-fade-in-up { animation: fadeInUp 0.5s ease-out both; }
.animate-pop-in { animation: popIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both; }

/* Calendar Styles */
.calendar-day.has-data { position: relative; }
.calendar-day.has-data::after {
    content: attr(data-count);
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #f97316;
    color: white;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.calendar-day.selected {
    background-color: #4f46e5 !important;
    color: white !important;
}
.calendar-day.selected.has-data::after {
     background-color: white;
     color: #4f46e5;
}
.calendar-day.today {
    box-shadow: 0 0 0 2px #3b82f6;
}

/* Drag and Drop styles */
.reordering .product-row-reorder, .reordering .category-reorder-item {
    cursor: grab;
}
.reordering .product-row-reorder:active, .reordering .category-reorder-item:active {
    cursor: grabbing;
}
.dragging {
    opacity: 0.5;
    background: #e0e7ff;
}

/* Bouncing Letter Animation */
@keyframes bounce-letter {
  0%, 40%, 100% {
    transform: translateY(0);
  }
  20% {
    transform: translateY(-8px);
  }
}

.bouncing-letter-container {
  color: #f97316; 
  background-image: linear-gradient(
    to right,
    #f97316,
    #fb923c,
    #fed7aa,
    #fb923c,
    #f97316
  );
  background-size: 200% auto;
  color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
}

.bouncing-letter {
  display: inline-block;
  animation: bounce-letter 1.6s ease-in-out infinite;
  font-weight: bold;
  color: #f97316; 
  background-image: linear-gradient(
    to right,
    #f97316,
    #fb923c,
    #fed7aa,
    #fb923c,
    #f97316
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Wake Lock Animation */
@keyframes pulse-green {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

.wake-lock-active {
  animation: pulse-green 2s infinite;
}

/* Welcome Page Animations */
@keyframes fadeInOut {
  0% { opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

.animate-fade-in-out {
  animation: fadeInOut 2.5s ease-in-out forwards;
}

@keyframes slideUpFadeIn {
  from {
    opacity: 0;
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-up-fade-in {
  display: inline-block;
  animation: slideUpFadeIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  opacity: 0; /* Start hidden */
}

/* --- Calculator Styles (New Light Theme) --- */
.calculator-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.calc-btn {
    font-size: 1.5rem;
    font-weight: 500;
    padding: 1rem;
    border-radius: 1.5rem;
    background-color: #ffffff;
    color: #374151;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    transition: all 0.15s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1 / 1;
    border: 1px solid #f3f4f6;
}

.calc-btn.calc-btn-span-2 {
    grid-column: span 2;
    aspect-ratio: auto;
}

.calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.calc-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.calc-btn.calc-btn-special {
    background-color: #e5e7eb;
    color: #1f2937;
}
.calc-btn.calc-btn-special:hover { background-color: #d1d5db; }

.calc-btn.calc-btn-operator {
    background-color: #e0e7ff;
    color: #4338ca;
    font-size: 1.8rem;
}
.calc-btn.calc-btn-operator:hover { background-color: #c7d2fe; }

.calc-btn.calc-btn-equal {
    background-color: #4f46e5;
    color: #ffffff;
}
.calc-btn.calc-btn-equal:hover { background-color: #4338ca; }

