/* Custom CSS untuk POS Toko Sembako */

:root {
  --primary-color: #4f46e5;
  --secondary-color: #6b7280;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --info-color: #3b82f6;
  --light-color: #f8fafc;
  --dark-color: #1f2937;
  --sidebar-width: 250px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--light-color);
  overflow-x: hidden;
}

/* Sidebar Styles */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(135deg, var(--primary-color), #6366f1);
  color: white;
  z-index: 1000;
  transition: all 0.3s ease;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.sidebar-header h4 {
  margin: 0;
  font-weight: 600;
}

.sidebar .nav {
  padding: 1rem 0;
  height: calc(100vh - 100px);
  overflow-y: auto;
}

.sidebar .nav-link {
  color: rgba(255, 255, 255, 0.8);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  text-decoration: none;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateX(5px);
}

.sidebar .nav-link i {
  margin-right: 0.75rem;
  font-size: 1.1rem;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  padding: 2rem;
  min-height: 100vh;
  transition: all 0.3s ease;
}

/* Page Transitions */
.page {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Card Styles */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  margin-bottom: 1.5rem;
}

.card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.card-header {
  background-color: white;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 12px 12px 0 0 !important;
  padding: 1rem 1.5rem;
}

.card-body {
  padding: 1.5rem;
}

/* Stat Cards */
.stat-card {
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.stat-card .card-body {
  padding: 1.5rem;
}

.stat-card h3 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
}

.stat-card h6 {
  font-size: 0.875rem;
  opacity: 0.9;
  margin-bottom: 0.5rem;
}

/* Form Styles */
.form-control {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0.75rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Button Styles */
.btn {
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), #6366f1);
}

.btn-success {
  background: linear-gradient(135deg, var(--success-color), #059669);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning-color), #d97706);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger-color), #dc2626);
}

/* Table Styles */
.table {
  border-radius: 8px;
  overflow: hidden;
}

.table thead th {
  background-color: #f8fafc;
  border: none;
  font-weight: 600;
  color: var(--dark-color);
  padding: 1rem;
}

.table tbody td {
  padding: 1rem;
  border-color: #f1f5f9;
  vertical-align: middle;
}

.table-hover tbody tr:hover {
  background-color: #f8fafc;
}

/* Product Suggestions */
#productSuggestions {
  max-height: 200px;
  overflow-y: auto;
  border-radius: 8px;
}

.list-group-item {
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: all 0.2s ease;
}

.list-group-item:hover {
  background-color: #f8fafc;
  transform: translateX(5px);
}

/* Cart Styles */
#cartItems tr {
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Receipt Styles */
.receipt {
  font-family: "Courier New", monospace;
  max-width: 300px;
  margin: 0 auto;
  padding: 1rem;
  border: 1px dashed #ccc;
}

.receipt-header {
  text-align: center;
  margin-bottom: 1rem;
  border-bottom: 1px dashed #ccc;
  padding-bottom: 1rem;
}

.receipt-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.receipt-total {
  border-top: 1px dashed #ccc;
  padding-top: 0.5rem;
  margin-top: 1rem;
  font-weight: bold;
}

/* Modal Styles */
.modal-content {
  border-radius: 12px;
  border: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
  border-radius: 12px 12px 0 0;
  background: linear-gradient(135deg, var(--primary-color), #6366f1);
  color: white;
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 1rem;
  }

  .stat-card {
    margin-bottom: 1rem;
  }

  .card-body {
    padding: 1rem;
  }
}

/* Print Styles */
@media print {
  .sidebar,
  .modal-header,
  .modal-footer,
  .btn {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
  }

  .receipt {
    border: none;
    box-shadow: none;
  }
}

/* Barcode Label Print */
@media print {
  body.barcode-print {
    margin: 0;
    padding: 0;
  }
  .barcode-print .label {
    border: none !important;
    page-break-inside: avoid;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #6366f1;
}

/* Utility Classes */
.text-primary {
  color: var(--primary-color) !important;
}

.bg-primary {
  background-color: var(--primary-color) !important;
}

.border-primary {
  border-color: var(--primary-color) !important;
}

.shadow-sm {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

.shadow {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

.shadow-lg {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

.slide-in {
  animation: slideIn 0.3s ease-in-out;
}

.bounce-in {
  animation: bounceIn 0.6s ease-in-out;
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
