/* Enhanced styles for Customer Khata with modern design */

:root {
  --primary-color: #4361ee;
  --secondary-color: #3f37c9;
  --success-color: #4cc9f0;
  --danger-color: #f72585;
  --warning-color: #f8961e;
  --info-color: #4895ef;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --gray-color: #6c757d;
  --border-radius: 12px;
  --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
}

body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
  color: var(--dark-color);
  min-height: 100vh;
  padding-bottom: 80px;
}

/* Navigation */
.navbar {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar-brand {
  font-weight: 700;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.5rem;
}

.nav-link {
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-link:hover {
  color: var(--primary-color) !important;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary-color);
  border-radius: 3px 3px 0 0;
}

/* Cards */
.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.card-header {
  background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  font-weight: 600;
  padding: 1rem 1.5rem;
}

.card-body {
  padding: 1.5rem;
}

/* Stat Cards */
.stat-card {
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  overflow: hidden;
  position: relative;
  border: none;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
}

.stat-card.customer-card::before {
  background: linear-gradient(90deg, #007bff, #00bcd4);
}

.stat-card.due-card::before {
  background: linear-gradient(90deg, #dc3545, #fd7e14);
}

.stat-card.advance-card::before {
  background: linear-gradient(90deg, #28a745, #20c997);
}

.stat-card .card-body {
  padding: 1.5rem;
}

.stat-card h2 {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.stat-card .card-title {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--gray-color);
}

/* Buttons */
.btn {
  border-radius: 8px;
  font-weight: 500;
  padding: 0.5rem 1.2rem;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(120deg, var(--secondary-color), var(--primary-color));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.btn-success {
  background: linear-gradient(120deg, #28a745, #20c997);
}

.btn-success:hover {
  background: linear-gradient(120deg, #20c997, #28a745);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-danger {
  background: linear-gradient(120deg, #dc3545, #fd7e14);
}

.btn-danger:hover {
  background: linear-gradient(120deg, #fd7e14, #dc3545);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-outline-primary {
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline-primary:hover {
  background: var(--primary-color);
  color: white;
}

/* Forms */
.form-control {
  border-radius: 8px;
  padding: 0.75rem 1rem;
  border: 1px solid #e1e5eb;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(67, 97, 238, 0.25);
}

.form-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--dark-color);
}

/* Badges */
.badge {
  padding: 0.5em 0.75em;
  border-radius: 20px;
  font-weight: 500;
}

.badge.bg-danger {
  background: linear-gradient(120deg, #dc3545, #fd7e14) !important;
}

.badge.bg-success {
  background: linear-gradient(120deg, #28a745, #20c997) !important;
}

.badge.bg-secondary {
  background: linear-gradient(120deg, #6c757d, #495057) !important;
}

/* Modals */
.modal-content {
  border-radius: var(--border-radius);
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
  background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
  border: none;
}

.modal-title {
  font-weight: 600;
}

/* Alerts */
.alert {
  border-radius: 8px;
  border: none;
  font-weight: 500;
}

.alert-success {
  background: linear-gradient(120deg, #d4edda, #c3e6cb);
  color: #155724;
}

.alert-danger {
  background: linear-gradient(120deg, #f8d7da, #f1b0b7);
  color: #721c24;
}

/* Transaction Bubbles */
.transaction-bubble {
  border-radius: 15px;
  padding: 15px;
  margin-bottom: 15px;
  max-width: 85%;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}

.transaction-bubble:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.given-bubble {
  background: linear-gradient(120deg, #fff5f5, #ffecec);
  border: 1px solid #fed7d7;
  margin-right: auto;
}

.received-bubble {
  background: linear-gradient(120deg, #f0fff4, #e8f5e9);
  border: 1px solid #c6f6d5;
  margin-left: auto;
}

.transaction-bubble strong {
  font-size: 1.1rem;
  font-weight: 600;
}

.transaction-bubble small {
  font-size: 0.75rem;
}

.transaction-bubble p {
  margin-bottom: 10px;
  font-size: 0.9rem;
}

/* Transaction Photos */
.transaction-photo {
  max-width: 100%;
  max-height: 200px;
  border-radius: 10px;
  margin-top: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.transaction-photo:hover {
  transform: scale(1.02);
}

/* Fixed Bottom Buttons */
.fixed-bottom-buttons {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 15px;
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.add-customer-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 24px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  transition: var(--transition);
}

.add-customer-btn:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Pagination */
.pagination {
  margin-bottom: 0;
}

.page-link {
  border-radius: 8px !important;
  margin: 0 3px;
  border: 1px solid #e1e5eb;
  color: var(--primary-color);
  transition: var(--transition);
}

.page-link:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.page-item.active .page-link {
  background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
  border-color: var(--primary-color);
}


/* Mobile Bottom Navigation */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  border-top: 1px solid #eee;
}

.nav-item-bottom {
  text-align: center;
  flex: 1;
  padding: 5px 0;
  color: #6c757d;
  text-decoration: none;
  font-size: 0.8rem;
}

.nav-item-bottom.active {
  color: var(--primary-color);
  font-weight: 600;
}

.nav-item-bottom i {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 3px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .fixed-bottom-buttons {
    padding: 10px;
  }
  
  .add-customer-btn {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
  
  .transaction-bubble {
    max-width: 90%;
  }
  

  
  /* Hide desktop navigation on mobile */
  .navbar-nav {
    display: none;
  }
}

@media (min-width: 769px) {
  /* Hide mobile navigation on desktop */
  .mobile-bottom-nav {
    display: none;
  }
}

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 5px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}