@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(255, 255, 255, 0.8);
  --glass-blur: blur(16px);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.05);
  --radius: 20px;
  --accent: #FF6B35;
  --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  --font: 'Poppins', 'Inter', sans-serif;
  --text-color: #333333;
  --text-dark: #111111;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg-gradient);
  font-family: var(--font);
  color: var(--text-color);
  min-height: 100vh;
  padding-bottom: 80px; /* Space for bottom nav */
  background-attachment: fixed;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Glassmorphism Classes */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  padding: 20px;
  margin-bottom: 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  margin-bottom: 15px;
}

p {
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 10px;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
  opacity: 0.9;
}

.form-control, select {
  width: 100%;
  padding: 12px 15px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.5);
  color: #333;
  font-size: 16px;
  font-family: var(--font);
  outline: none;
  transition: all 0.3s ease;
}

.form-control::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

.form-control:focus, select:focus {
  background: rgba(255, 255, 255, 0.8);
  border-color: var(--accent);
}

select option {
  background: #fff;
  color: #333;
}

/* Custom Checkbox and Radio */
input[type="checkbox"], input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--accent);
  background: rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  cursor: pointer;
  display: inline-block;
  vertical-align: middle;
  position: relative;
  transition: all 0.3s;
  margin-right: 8px;
}

input[type="radio"] {
  border-radius: 50%;
}

input[type="checkbox"]:checked, input[type="radio"]:checked {
  background: var(--accent);
}

input[type="checkbox"]:checked::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  color: white;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
}

input[type="radio"]:checked::after {
  content: '';
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  font-size: 18px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  padding: 0 20px;
  font-family: var(--font);
  font-weight: 500;
  transition: transform 0.2s ease, opacity 0.2s ease;
  width: 100%;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.btn-glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  color: #333;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.9);
}

.btn-sm {
  min-height: 36px;
  font-size: 14px;
  padding: 0 12px;
  border-radius: 10px;
  width: auto;
}

.btn-danger {
  background: rgba(220, 53, 69, 0.8);
  color: #fff;
}

/* Header */
header.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.4);
  border-bottom: 1px solid var(--glass-border);
}

header.app-header .header-title {
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

header.app-header .back-btn {
  background: rgba(255, 255, 255, 0.6);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  cursor: pointer;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  z-index: 1000;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(0, 0, 0, 0.5);
  font-size: 12px;
  min-height: 56px;
  padding: 5px;
  flex: 1;
  transition: color 0.3s;
}

.nav-item.active, .nav-item:hover {
  color: var(--accent);
}

.nav-item i {
  font-size: 20px;
  margin-bottom: 4px;
}

/* Dashboard Action Grid */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  aspect-ratio: 1 / 1;
  padding: 10px;
  text-align: center;
}

.action-btn i {
  font-size: 32px;
  color: var(--accent);
}

.action-btn span {
  font-size: 18px;
  font-weight: 500;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

table th, table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}

table th {
  font-weight: 600;
  opacity: 0.9;
  white-space: nowrap;
}

table tr:last-child td {
  border-bottom: none;
}

/* Container */
.container {
  padding: 0 20px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-3 { margin-top: 15px; }
.mb-3 { margin-bottom: 15px; }
.mt-4 { margin-top: 20px; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-2 { gap: 10px; }

/* Status Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.badge-paid { background: rgba(40, 167, 69, 0.8); }
.badge-unpaid { background: rgba(220, 53, 69, 0.8); }
.badge-pending { background: rgba(255, 193, 7, 0.8); color: #333; }

/* Summary Cards Grid */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  margin-bottom: 25px;
}
@media (min-width: 768px) {
  .summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.summary-card h3 {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 5px;
}
.summary-card p {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
}

/* POS specific */
.pos-item-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}
.pos-item-row input {
  flex: 1;
}
.pos-item-row .cost-input {
  width: 100px;
  flex: none;
}
.remove-item-btn {
  background: rgba(220, 53, 69, 0.2);
  color: #ff6b6b;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Success Message */
.alert-success {
  background: rgba(40, 167, 69, 0.8);
  color: white;
  padding: 15px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.scroll-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-bottom: 20px;
}

.scroll-card-header {
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 10px;
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.scroll-card-title {
  font-weight: 600;
  font-size: 18px;
  margin: 0;
  color: var(--accent);
}
.scroll-card-subtitle {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 5px;
  display: block;
}
.scroll-card-body p {
  margin-bottom: 8px;
  font-size: 14px;
}
.scroll-card-body strong {
  opacity: 0.9;
}
.scroll-card-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  justify-content: flex-end;
}

/* Position Relative Helper */
.position-relative {
  position: relative !important;
}

/* Badge Count for Buttons */
.badge-count {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #ff4757, #ff6b81);
  color: white;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(255, 71, 87, 0.5);
  border: 2px solid #fff;
}
