/* Custom Styles untuk Sistem Manajemen Stok */

/* Import Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

* {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Tab Active State */
.tab-button.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  background-color: #eff6ff;
}

/* Tab Content Animation */
.tab-content {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Table Hover Effect */
tbody tr {
  transition: background-color 0.2s ease;
}

tbody tr:hover {
  background-color: #f8fafc;
}

/* Badge Styles */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background-color: #dcfce7;
  color: #166534;
}

.badge-danger {
  background-color: #fee2e2;
  color: #991b1b;
}

.badge-warning {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-info {
  background-color: #dbeafe;
  color: #1e40af;
}

/* Modal Animation */
#modalStock.flex,
#modalPrintLabel.flex {
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

#modalStock .bg-white,
#modalPrintLabel .bg-white {
  animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Toast Animation */
#toast.show {
  transform: translateY(0) !important;
  opacity: 1 !important;
}

/* Scanner Input Highlight */
#scanInputIn:focus,
#scanInputOut:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Barcode Container */
.barcode-container {
  background: white;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 2px dashed #cbd5e1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Print Label Styles */
@media print {
  body * {
    visibility: hidden;
  }

  #printArea,
  #printArea * {
    visibility: visible;
  }

  #printArea {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }

  .label-item {
    page-break-inside: avoid;
    break-inside: avoid;
  }
}

/* Label Item - Enhanced for Print */
.label-item {
  border: 2px solid #1e293b;
  border-radius: 6px;
  padding: 0;
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow: hidden;
  height: 180px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.label-content {
  width: 100%;
  height: 100%;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.label-nama {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
  color: #0f172a;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 8px;
  max-height: 36px;
}

.label-barcode-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 6px 0;
  min-height: 70px;
}

.label-barcode-img {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  width: auto;
  display: block;
}

.label-info {
  width: 100%;
  font-size: 11px;
  color: #475569;
  line-height: 1.4;
  margin-top: 6px;
}

.label-kode {
  font-family: "Courier New", monospace;
  font-weight: 700;
  font-size: 12px;
  color: #0f172a;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.label-details {
  font-size: 9px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.label-item svg {
  margin: 0.5rem 0;
}

.label-item .label-info {
  font-size: 0.75rem;
  color: #475569;
  margin-top: 0.5rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Loading Spinner */
.spinner {
  border: 3px solid #f3f4f6;
  border-top: 3px solid #2563eb;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Button Hover Effects */
button {
  transition: all 0.2s ease;
}

button:active {
  transform: scale(0.98);
}

/* Input Focus Effects */
input:focus,
select:focus,
textarea:focus {
  outline: none;
}

/* Card Hover Effect */
.card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Status Indicator */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.5rem;
}

.status-dot.active {
  background-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.status-dot.inactive {
  background-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #94a3b8;
}

.empty-state svg {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  opacity: 0.5;
}

/* Responsive Table */
@media (max-width: 768px) {
  table {
    font-size: 0.75rem;
  }

  th,
  td {
    padding: 0.5rem !important;
  }
}

/* Gradient Background */
.gradient-bg {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Glass Morphism Effect */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Pulse Animation for Scanner */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.scanner-active {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Success Animation */
@keyframes successPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.scan-success {
  animation: successPulse 0.6s ease-out;
}

/* Error Animation */
@keyframes errorShake {
  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}

.scan-error {
  animation: errorShake 0.5s ease-out;
}

/* Number Input Arrows */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
}

/* Checkbox Custom Style */
input[type="checkbox"]:checked {
  background-color: #2563eb;
  border-color: #2563eb;
}

/* Select Arrow */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* Utility Classes */
.text-currency::before {
  content: "Rp ";
}

.font-mono {
  font-family: "Courier New", Courier, monospace;
}

/* Print Styles */
@page {
  margin: 1cm;
}

/* Barcode SVG Styling */
svg[id^="barcode"] {
  max-width: 100%;
  height: auto;
}

/* Transition for all interactive elements */
a,
button,
input,
select,
textarea {
  transition: all 0.2s ease;
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* ===== NAVBAR IMPROVEMENTS ===== */

/* Header Styling */
header {
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.15);
}

/* Navigation Tab Styling */
.tab-button {
  position: relative;
  overflow: hidden;
}

/* Tab Active State */
.tab-button.active {
  color: #2563eb;
  background-color: #eff6ff;
}

.tab-button.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
}

/* Underline Animation */
.tab-button .absolute {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Alert Badge */
#stockAlertCount {
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

/* Dropdown Alert Styling */
#stockAlertDropdown {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scrollbar Hide Utility */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* Responsive Navbar */
@media (max-width: 768px) {
  header {
    padding: 0.75rem 1rem;
  }

  header h1 {
    font-size: 1.5rem;
  }

  header p {
    font-size: 0.75rem;
  }

  .tab-button {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }

  .tab-button svg {
    width: 1.25rem;
    height: 1.25rem;
  }
}
