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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f5f5;
  min-height: 100vh;
}

/* Navigation Bar */
.navbar {
  padding: 1rem 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: bold;
}

.nav-link {
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  transition: background-color 0.3s;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
  background-color: rgba(255, 255, 255, 0.2);
  font-weight: bold;
}

/* Page Header */
.page-header {
  background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
  color: white;
  padding: 1.5rem 2rem;
  margin-bottom: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-header.bg-success {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.page-header.bg-info {
  background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.page-header.bg-warning {
  background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
}

.page-header h2 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
}

/* Content Cards */
.content-card,
.invoice-card {
  background: white;
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

/* Business Information */
.business-info {
  padding: 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  color: white;
  margin-bottom: 2rem;
}

.business-name {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
  color: #ffffff;
}

.business-address {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.business-contact {
  font-size: 1rem;
  margin-bottom: 0;
}

/* Invoice Input Section */
.invoice-input-section,
.add-product-section,
.add-stock-section,
.add-expense-section {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

/* Invoice Items Table */
.invoice-items-section .table {
  margin-bottom: 0;
}

.invoice-items-section .table th {
  background-color: #e9ecef;
  font-weight: 600;
}

/* Invoice Summary */
.invoice-summary {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  border: 2px solid #dee2e6;
}

.invoice-summary hr {
  margin: 1rem 0;
}

/* Buttons */
.btn {
  border-radius: 5px;
  padding: 0.5rem 1.5rem;
  font-weight: 500;
  transition: all 0.3s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-success {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  border: none;
}

.btn-danger {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  border: none;
}

.btn-warning {
  background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
  border: none;
  color: #212529;
}

.btn-whatsapp {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  border: none;
  color: white;
  font-weight: 500;
}

.btn-whatsapp:hover {
  background: linear-gradient(135deg, #128c7e 0%, #075e54 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(37, 211, 102, 0.3);
}

/* Tables */
.table {
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th {
  background-color: #e9ecef;
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.table tbody tr {
  transition: background-color 0.2s;
}

.table tbody tr:hover {
  background-color: #f8f9fa;
}

.table-bordered {
  border: 1px solid #dee2e6;
}

.table-bordered th,
.table-bordered td {
  border: 1px solid #dee2e6;
}

/* Print Styles */
@media print {
  @page {
    size: A4;
    margin: 15mm;
  }

  body * {
    visibility: hidden;
  }

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

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

  .print-content {
    padding: 0;
    font-size: 12px;
  }

  .print-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    padding-bottom: 10px;
  }

  .shop-address {
    flex: 1;
    text-align: left;
  }

  .shop-address p:first-child {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 3px;
  }

  .shop-address p {
    margin: 2px 0;
    font-size: 11px;
    line-height: 1.4;
  }

  .invoice-info {
    text-align: right;
    flex: 1;
  }

  .invoice-info p {
    margin: 2px 0;
    font-size: 11px;
    line-height: 1.4;
  }

  .print-divider {
    border: none;
    border-top: 1px solid #333;
    margin: 10px 0;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 11px;
  }

  .print-table thead th {
    background-color: #f0f0f0;
    border: 1px solid #333;
    padding: 6px 4px;
    text-align: left;
    font-weight: bold;
    font-size: 10px;
  }

  .print-table tbody td {
    border: 1px solid #333;
    padding: 5px 4px;
    text-align: left;
  }

  .print-table tbody tr:nth-child(even) {
    background-color: #fafafa;
  }

  .print-total {
    text-align: right;
    margin-top: 10px;
    padding-top: 10px;
    font-size: 13px;
  }

  .print-total p {
    margin: 0;
  }

  .table {
    page-break-inside: auto;
  }

  .table tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }
}

/* Print area preview styles (for screen display) */
#printArea {
  font-size: 12px;
}

.print-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.shop-address {
  flex: 1;
  text-align: left;
}

.shop-address p:first-child {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 3px;
}

.shop-address p {
  margin: 2px 0;
  font-size: 11px;
  line-height: 1.4;
}

.invoice-info {
  text-align: right;
  flex: 1;
}

.invoice-info p {
  margin: 2px 0;
  font-size: 11px;
  line-height: 1.4;
}

.print-divider {
  border: none;
  border-top: 1px solid #333;
  margin: 10px 0;
}

.print-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 11px;
}

.print-table thead th {
  background-color: #f0f0f0;
  border: 1px solid #333;
  padding: 6px 4px;
  text-align: left;
  font-weight: bold;
  font-size: 10px;
}

.print-table tbody td {
  border: 1px solid #333;
  padding: 5px 4px;
  text-align: left;
}

.print-table tbody tr:nth-child(even) {
  background-color: #fafafa;
}

.print-total {
  text-align: right;
  margin-top: 10px;
  padding-top: 10px;
  font-size: 13px;
}

.print-total p {
  margin: 0;
}

/* Modal Styles */
.modal-content {
  border-radius: 10px;
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 10px 10px 0 0;
}

.modal-header .btn-close {
  filter: invert(1);
}

/* Empty State */
.text-muted {
  color: #6c757d !important;
}

/* Form Controls */
.form-control:focus,
.form-select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Connection Status Badge Styles */
.badge {
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  font-weight: 500;
}

.navbar .badge {
  margin: 0 0.25rem;
}

/* Dropdown Menu Styles */
.dropdown-menu {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: none;
  border-radius: 8px;
}

.dropdown-item:hover {
  background-color: #f8f9fa;
}

.dropdown-item.text-danger:hover {
  background-color: #dc3545;
  color: white !important;
}

/* Navigation Mobile Styles */
@media (max-width: 991px) {
  .navbar-nav {
    flex-direction: column;
    width: 100%;
    margin-top: 1rem;
  }

  .navbar-nav .nav-link {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .navbar-nav .nav-link:last-child {
    border-bottom: none;
  }

  .navbar-top-controls {
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
  }

  .navbar-top-controls .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }

  .navbar-top-controls .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
}

@media (max-width: 576px) {
  .navbar-top-controls {
    flex-direction: column;
    width: 100%;
    align-items: stretch !important;
  }

  .navbar-top-controls .badge,
  .navbar-top-controls .dropdown {
    width: 100%;
    text-align: center;
  }

  .navbar-top-controls .dropdown .btn {
    width: 100%;
  }
}

/* Responsive - Mobile First Approach */
@media (max-width: 768px) {
  .navbar {
    padding: 0.75rem 1rem;
  }

  .navbar-brand {
    font-size: 1.2rem;
  }

  .navbar .d-flex {
    flex-wrap: wrap;
    gap: 0.5rem !important;
    font-size: 0.85rem;
  }

  .navbar .nav-link {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
  }

  .page-header {
    padding: 1rem;
  }

  .page-header h2 {
    font-size: 1.3rem;
  }

  .business-info {
    padding: 1.5rem 1rem;
  }

  .business-name {
    font-size: 1.75rem;
  }

  .business-address,
  .business-contact {
    font-size: 0.9rem;
  }

  .content-card,
  .invoice-card {
    padding: 1rem;
    border-radius: 8px;
  }

  .invoice-input-section,
  .add-product-section,
  .add-stock-section,
  .add-expense-section {
    padding: 1rem;
  }

  .invoice-summary {
    margin-top: 1.5rem;
    padding: 1rem;
  }

  /* Table responsiveness */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
    width: 100%;
  }

  .table {
    font-size: 0.85rem;
    min-width: 600px; /* Ensure minimum width for readability */
  }

  .table th,
  .table td {
    padding: 0.5rem 0.4rem;
    white-space: nowrap;
  }

  /* Button adjustments */
  .btn {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
  }

  .action-buttons {
    flex-direction: column;
    gap: 0.3rem;
  }

  .action-buttons .btn {
    width: 100%;
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
  }

  /* Form inputs */
  .form-control,
  .form-select {
    font-size: 0.9rem;
    padding: 0.5rem;
  }

  /* Invoice items table */
  .invoice-items-section .table td {
    font-size: 0.85rem;
    padding: 0.5rem;
  }

  /* Hide icons in buttons on very small screens */
  @media (max-width: 480px) {
    .btn i {
      margin-right: 0.25rem;
    }

    .navbar .nav-link i {
      display: inline-block; /* Keep icons in collapsed menu */
    }

    .business-name {
      font-size: 1.5rem;
    }

    .page-header h2,
    .page-header h3,
    .page-header h4,
    .page-header h5 {
      font-size: 1.1rem;
    }

    .page-header h2 i,
    .page-header h3 i,
    .page-header h4 i,
    .page-header h5 i {
      display: inline-block; /* Keep icons, just smaller */
      font-size: 0.9rem;
    }
  }
}

/* Better table handling on very small screens */
@media (max-width: 576px) {
  .table {
    font-size: 0.75rem;
    min-width: 500px;
  }

  .table th,
  .table td {
    padding: 0.4rem 0.3rem;
  }
}

@media (max-width: 576px) {
  .container-fluid {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  /* Stack form fields vertically */
  .invoice-input-section .row > div,
  .add-product-section .row > div,
  .add-stock-section .row > div,
  .add-balance-section .row > div {
    margin-bottom: 0.75rem;
  }

  /* Make buttons full width on mobile */
  .invoice-input-section .d-flex,
  .add-product-section .d-flex,
  .add-stock-section .d-flex,
  .add-balance-section .d-flex {
    flex-direction: column;
  }

  .invoice-input-section .d-flex .btn,
  .add-product-section .d-flex .btn,
  .add-stock-section .d-flex .btn,
  .add-balance-section .d-flex .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  /* Invoice summary full width */
  .invoice-summary {
    width: 100%;
    margin-top: 1.5rem;
  }

  /* Action buttons stack */
  .d-flex.gap-2,
  .d-flex.gap-3 {
    flex-direction: column;
  }

  .d-flex.gap-2 .btn,
  .d-flex.gap-3 .btn {
    width: 100%;
    margin-bottom: 0.5rem;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Invoice action buttons */
  .invoice-input-section .d-flex.gap-2,
  .invoice-input-section .d-flex.gap-3 {
    flex-direction: column;
    width: 100%;
  }

  /* Balance cards stack on mobile */
  .row.mb-4 > .col-md-4,
  .row.mb-4 > .col-md-3 {
    margin-bottom: 1rem;
  }
}

/* Action Buttons in Tables */
.action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.action-buttons .btn {
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
}

/* Inline editing styles */
.table-warning {
  background-color: #fff3cd !important;
}

.table-warning input.form-control-sm {
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
}

/* Ensure tables are scrollable on mobile */
.table-responsive {
  -webkit-overflow-scrolling: touch;
  position: relative;
}

/* Add shadow indicators for scrollable tables on mobile */
@media (max-width: 768px) {
  .table-responsive::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
  }

  .table-responsive.scrollable::after {
    opacity: 1;
  }
}

/* Improve table header visibility on scroll */
@media (max-width: 768px) {
  .table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #e9ecef;
  }
}

/* Balance Summary Cards */
.card {
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Card responsive improvements */
@media (max-width: 768px) {
  .card-body {
    padding: 1rem;
  }

  .card-body h3 {
    font-size: 1.5rem;
  }

  .card-body h5 {
    font-size: 1rem;
  }
}

@media (max-width: 576px) {
  .card-body h3 {
    font-size: 1.25rem;
  }

  .card-body h5 {
    font-size: 0.95rem;
  }
}

.card-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.add-balance-section {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

/* Balance page responsive styles */
@media (max-width: 768px) {
  .card-body h3 {
    font-size: 1.5rem;
  }

  .add-balance-section .row > div {
    margin-bottom: 0.75rem;
  }

  .add-balance-section .d-flex .btn {
    width: 100%;
    margin-top: 0.5rem;
  }
}

/* Searchable Dropdown Styles - Custom Dropdown */
.searchable-dropdown-wrapper {
  position: relative;
  width: 100%;
}

.searchable-dropdown-input {
  width: 100%;
  cursor: pointer;
}

.searchable-dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ced4da;
  border-top: none;
  border-radius: 0 0 0.375rem 0.375rem;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1000;
  margin: 0;
  padding: 0;
  list-style: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.searchable-dropdown-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s;
  font-size: 0.875rem;
}

.searchable-dropdown-item:last-child {
  border-bottom: none;
}

.searchable-dropdown-item:hover {
  background-color: #f8f9fa;
}

.searchable-dropdown-item:active {
  background-color: #e9ecef;
}

.searchable-dropdown-item.no-results {
  color: #6c757d;
  font-style: italic;
  cursor: default;
  background-color: #f8f9fa;
}

.searchable-dropdown-item.no-results:hover {
  background-color: #f8f9fa;
}

/* Ensure input looks like select */
.searchable-dropdown-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
  outline: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .searchable-dropdown-input {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .searchable-dropdown-list {
    max-height: 250px;
  }

  .searchable-dropdown-item {
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
  }
}

/* Scrollbar styling for dropdown */
.searchable-dropdown-list::-webkit-scrollbar {
  width: 8px;
}

.searchable-dropdown-list::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.searchable-dropdown-list::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.searchable-dropdown-list::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Invoice Search Bar Styles */
.invoice-search-section {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.invoice-search-section .form-control {
  border-radius: 8px;
}

.invoice-search-section .form-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
  .invoice-search-section {
    padding: 0.75rem;
  }

  .invoice-search-section .form-control {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Total Amount Display */
.total-amount-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 10px;
  margin-top: 1.5rem;
  box-shadow: 0 4px 6px rgba(209, 200, 200, 0.1);
}

.total-amount-section h4 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.total-amount-section .amount {
  font-size: 2rem;
  font-weight: bold;
  margin-top: 0.5rem;
  color: white; /* Same color for both total sales and total profit/loss */
}

/* Stock Summary Box */
.stock-summary-box {
  margin-top: 2rem;
}

.summary-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.summary-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.summary-header i {
  font-size: 1.3rem;
}

.summary-amount {
  font-size: 2rem;
  font-weight: bold;
  color: white;
}

/* Profit/Loss Styling in Table */
.table .text-success {
  color: #28a745 !important;
  font-weight: 600;
}

.table .text-danger {
  color: #dc3545 !important;
  font-weight: 600;
}

@media (max-width: 768px) {
  .total-amount-section {
    padding: 1rem;
  }

  .total-amount-section h4 {
    font-size: 1.2rem;
  }

  .total-amount-section .amount {
    font-size: 1.5rem;
  }

  .summary-card {
    padding: 1rem;
  }

  .summary-header {
    font-size: 1rem;
  }

  .summary-header i {
    font-size: 1.1rem;
  }

  .summary-amount {
    font-size: 1.5rem;
  }
}

/* Footer Styles */
.footer {
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  color: white;
  padding: 1.5rem 0;
  margin-top: 3rem;
  text-align: center;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
  border-top: 3px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.8px;
}

.footer-creator-image {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.footer-creator-image:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.footer-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-text i {
  color: #ffd700;
  font-size: 1.2rem;
}

.footer-name {
  font-weight: 600;
  color: #ffd700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .footer {
    padding: 1.2rem 0.5rem;
    margin-top: 2rem;
  }

  .footer-content {
    font-size: 0.95rem;
    gap: 0.75rem;
    flex-wrap: wrap;
  }

  .footer-creator-image {
    width: 40px;
    height: 40px;
  }

  .footer-text i {
    font-size: 1rem;
  }
}

@media (max-width: 576px) {
  .footer-content {
    font-size: 0.85rem;
    gap: 0.5rem;
  }

  .footer-creator-image {
    width: 35px;
    height: 35px;
  }
}

/* PWA Install Button Styles */
.pwa-install-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  background-color: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pwa-install-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.pwa-install-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pwa-install-btn i {
  font-size: 18px;
  line-height: 1;
}

.pwa-install-btn.d-none {
  display: none !important;
}

/* Responsive adjustments for PWA install button */
@media (max-width: 768px) {
  .pwa-install-btn {
    width: 34px;
    height: 34px;
    font-size: 16px;
    border-radius: 6px;
  }

  .pwa-install-btn i {
    font-size: 16px;
  }
}

@media (max-width: 576px) {
  .pwa-install-btn {
    width: 32px;
    height: 32px;
    font-size: 15px;
    border-radius: 6px;
  }

  .pwa-install-btn i {
    font-size: 15px;
  }
}

/* Mobile Navigation Toggle Button */
.navbar-toggler {
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Ensure navbar collapse works properly */
.navbar-collapse {
  background-color: rgba(0, 0, 0, 0.1);
  margin-top: 0.5rem;
  padding: 0.5rem;
  border-radius: 0.25rem;
}

@media (min-width: 992px) {
  .navbar-collapse {
    background-color: transparent;
    margin-top: 0;
    padding: 0;
  }
}

/* Improve modal responsiveness */
@media (max-width: 768px) {
  .modal-dialog {
    margin: 0.5rem;
  }

  .modal-xl {
    max-width: calc(100% - 1rem);
  }

  .modal-lg {
    max-width: calc(100% - 1rem);
  }

  .modal-content {
    border-radius: 0.5rem;
  }

  .modal-body {
    padding: 1rem;
  }

  .modal-footer {
    flex-direction: column;
    gap: 0.5rem;
  }

  .modal-footer .btn {
    width: 100%;
    margin: 0;
  }
}

/* Better card layout on mobile */
@media (max-width: 768px) {
  .row .col-md-3,
  .row .col-md-4,
  .row .col-md-6 {
    margin-bottom: 1rem;
  }
}

/* Improve form input responsiveness */
@media (max-width: 768px) {
  .invoice-input-section .row,
  .add-product-section .row,
  .add-stock-section .row,
  .add-balance-section .row {
    margin-left: 0;
    margin-right: 0;
  }

  .invoice-input-section .row > div,
  .add-product-section .row > div,
  .add-stock-section .row > div,
  .add-balance-section .row > div {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

/* Action buttons in tables - better mobile handling */
@media (max-width: 576px) {
  .action-buttons {
    flex-direction: column;
    gap: 0.25rem;
  }

  .action-buttons .btn {
    width: 100%;
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
  }
}

/* Page header improvements for mobile */
@media (max-width: 768px) {
  .page-header h3,
  .page-header h4,
  .page-header h5 {
    font-size: 1.2rem;
  }
}

@media (max-width: 576px) {
  .page-header h3,
  .page-header h4,
  .page-header h5 {
    font-size: 1rem;
  }

  .page-header h3 i,
  .page-header h4 i,
  .page-header h5 i {
    font-size: 0.9rem;
  }
}

/* Business info section mobile improvements */
@media (max-width: 576px) {
  .business-info {
    padding: 1rem 0.75rem;
  }

  .business-name {
    font-size: 1.5rem;
    line-height: 1.2;
  }

  .business-address,
  .business-contact {
    font-size: 0.85rem;
    line-height: 1.4;
  }
}
