/* assets/css/style.css */
/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
  font-size: 16px;
}

/* Mobile-first container */
.container {
  width: 100%;
  padding: 0 15px;
  margin: 0 auto;
}

/* For tablets and above */
@media (min-width: 768px) {
  .container {
    max-width: 720px;
    padding: 0;
  }
}

/* For desktops */
@media (min-width: 992px) {
  .container {
    max-width: 960px;
  }
}

/* For large desktops */
@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
}

/* Add this to the mobile section of style.css */
@media (max-width: 767px) {
  /* Ensure mobile menu has proper styling when shown */
  .nav-links.show,
  .business-nav.show {
    display: flex !important;
    flex-direction: column;
    background: rgba(102, 126, 234, 0.98);
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    margin-top: 10px;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    max-height: 80vh;
    overflow-y: auto;
  }

  .nav-links.show li,
  .business-nav.show li {
    width: 100%;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav-links.show li:last-child,
  .business-nav.show li:last-child {
    border-bottom: none;
  }

  .nav-links.show a,
  .business-nav.show a {
    padding: 15px;
    justify-content: flex-start;
    border-radius: 0;
    font-size: 1rem;
  }

  /* Make hamburger menu more visible */
  .mobile-menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
  }
}

/* Header */
header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo {
  font-size: 1.2rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.logo i {
  font-size: 1.5rem;
}

/* Navigation */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
  flex-wrap: wrap;
}

/* Business Navigation */
.business-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 10px 0 0 0;
  padding: 0;
  width: 100%;
}

.business-nav li {
  flex: 1 1 auto;
  min-width: 120px;
}

.business-nav li a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: white;
  text-decoration: none;
  transition: all 0.3s;
  text-align: center;
  font-size: 0.9rem;
}

.business-nav li a:hover,
.business-nav li a.active {
  background: white;
  color: #667eea;
}

/* Original nav-links for manager panel */
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 10px 0 0 0;
  padding: 0;
  width: 100%;
}

.nav-links li {
  flex: 1 1 auto;
  min-width: 120px;
}

.nav-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.3s;
  text-align: center;
  font-size: 0.9rem;
}

.nav-links a:hover {
  background: white;
  color: #667eea;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
}

/* Auth container */
.auth-container {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-box {
  background: white;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  width: 100%;
  max-width: 400px;
}

.auth-box h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #333;
  font-size: 1.5rem;
}

.auth-box h2 i {
  margin-right: 10px;
  color: #667eea;
}

/* Form styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #555;
  font-size: 0.95rem;
}

.form-group label i {
  margin-right: 8px;
  color: #667eea;
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.3s;
  -webkit-appearance: none;
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  text-decoration: none;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn:active {
  transform: translateY(0);
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-secondary {
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

/* Alert messages */
.alert {
  padding: 12px 15px;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.95rem;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert i {
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* Dashboard */
.dashboard-header {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  margin: 1rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dashboard-header h1 {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 0.5rem;
}

.business-badge {
  display: inline-block;
  background: white;
  color: #667eea;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  margin-left: 10px;
  font-weight: 600;
}

.dashboard-header-top {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

@media (min-width: 768px) {
  .dashboard-header-top {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

.plan-badge {
  display: inline-block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  align-self: flex-start;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 2rem 0;
}

@media (min-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

.card {
  background: white;
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  margin-bottom: 20px;
  margin-top: 20px;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
}

.card-header i {
  font-size: 1.5rem;
  color: #667eea;
}

.card-header h3 {
  font-size: 1.3rem;
  color: #333;
}

/* Table styles */
.table-container {
  background: white;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.data-table th,
.data-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
  font-size: 0.9rem;
}

.data-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #495057;
  white-space: nowrap;
}

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

/* Mobile-specific improvements */
@media (max-width: 767px) {
  /* Navigation improvements */
  .mobile-menu-toggle {
    display: block;
  }

  .nav-links,
  .business-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-top: 15px;
  }

  .nav-links.show,
  .business-nav.show {
    display: flex;
  }

  .nav-links li,
  .business-nav li {
    width: 100%;
    margin-bottom: 5px;
  }

  .nav-links a,
  .business-nav a {
    justify-content: flex-start;
    padding: 12px 15px;
    font-size: 1rem;
  }

  /* Auth improvements */
  .auth-box {
    padding: 1rem;
  }

  .auth-box h2 {
    font-size: 1.3rem;
  }

  /* Dashboard improvements */
  .dashboard-header {
    padding: 1rem;
  }

  .dashboard-header h1 {
    font-size: 1.3rem;
  }

  .card {
    padding: 1rem;
  }

  .card-header h3 {
    font-size: 1.1rem;
  }

  /* Form improvements */
  .form-control {
    padding: 10px 12px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .btn {
    padding: 14px 20px; /* Larger touch target */
    font-size: 16px;
  }

  /* Table improvements */
  .table-container {
    padding: 0.5rem;
    margin: 0 -15px;
    border-radius: 0;
  }

  .data-table th,
  .data-table td {
    padding: 8px 10px;
    font-size: 0.85rem;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn:hover {
    transform: none;
    box-shadow: none;
  }

  .card:hover {
    transform: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }

  .nav-links a:hover,
  .business-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
  }

  .nav-links a.active,
  .business-nav a.active {
    background: white;
    color: #667eea;
  }
}

/* Utility classes */
.text-center {
  text-align: center;
}

.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mt-3 {
  margin-top: 1.5rem;
}
.mt-4 {
  margin-top: 2rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}
.mb-2 {
  margin-bottom: 1rem;
}
.mb-3 {
  margin-bottom: 1.5rem;
}
.mb-4 {
  margin-bottom: 2rem;
}

.hidden {
  display: none;
}

/* Field error */
.field-error {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Small text helper */
.text-muted {
  color: #6c757d;
  font-size: 0.875rem;
}

/* Flex utilities */
.flex {
  display: flex;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 1rem;
}

.gap-4 {
  gap: 1.5rem;
}

/* Width utilities */
.w-full {
  width: 100%;
}

/* Touch feedback */
.touch-active {
  opacity: 0.8;
  transform: scale(0.98);
}

/* Prevent text selection on buttons */
.btn {
  user-select: none;
  -webkit-user-select: none;
}

/* Improve scrolling on mobile */
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* Better form inputs on iOS */
input,
select,
textarea,
button {
  font-size: 16px; /* Prevents zoom on iOS */
}

/* Text colors */
.text-error {
  color: #dc3545;
}
.text-warning {
  color: #ffc107;
}
.text-success {
  color: #28a745;
}
.text-info {
  color: #17a2b8;
}

/* Flex utilities for responsive layouts */
@media (min-width: 768px) {
  .md\:flex-row {
    flex-direction: row;
  }

  .md\:w-64 {
    width: 16rem;
  }
}

/* Search form in products */
.search-form .flex {
  display: flex;
}

.search-form .flex-col {
  flex-direction: column;
}

.search-form .gap-3 {
  gap: 1rem;
}

.search-form .flex-1 {
  flex: 1;
}

.search-form .w-full {
  width: 100%;
}

/* Add this to your style.css at the very end */
@media (max-width: 767px) {
  .business-nav:not(.show) {
    display: none !important;
  }

  .business-nav.show {
    display: flex !important;
    animation: slideDown 0.3s ease;
  }

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

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  overflow: auto;
  padding: 20px;
}

.modal-content {
  position: relative;
  background-color: white;
  margin: 5% auto;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  animation: modalFadeIn 0.3s;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
}

.modal-header h4 {
  margin: 0;
  color: #333;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-close:hover {
  background-color: #f8f9fa;
  color: #333;
}

.modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

/* Loading spinner */
.fa-spinner.fa-spin {
  animation: fa-spin 1s infinite linear;
}

@keyframes fa-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.unit-actions {
  display: flex;
  gap: 5px;
  align-items: center;
}

.unit-actions .btn-sm {
  padding: 4px 8px;
  font-size: 0.8rem;
  min-width: 30px;
}

/* Add to your existing styles */
.settings-section {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.settings-section h4 {
  margin-bottom: 20px;
  color: #333;
  border-bottom: 2px solid #667eea;
  padding-bottom: 10px;
  font-size: 1.2rem;
}

.settings-section h5 {
  margin-bottom: 15px;
  color: #555;
  font-size: 1rem;
}

.units-management {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 10px;
  background: #f8f9fa;
}

/* Add to your existing styles */
.variants-container .btn-sm {
  padding: 5px 10px;
  font-size: 0.875rem;
}

.alert.alert-success .btn-sm {
  margin-top: 0;
}

.code-generation {
  position: relative;
}

#variantProductCodeStatus {
  min-height: 20px;
}

/* Highlight focused section */
.variant-focus-highlight {
  animation: highlight-pulse 2s ease-in-out;
  border-left: 4px solid #667eea;
  padding-left: 10px;
}

@keyframes highlight-pulse {
  0% {
    background-color: #f0f8ff;
  }
  50% {
    background-color: #e6f0ff;
  }
  100% {
    background-color: #f0f8ff;
  }
}

/* Dropdown Menu Styles - Updated */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 220px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
  padding: 8px 0;
  margin-top: 10px;
  z-index: 1000;
  list-style: none;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-menu li {
  width: 100%;
  min-width: auto !important;
}

.dropdown-menu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: #333 !important; /* Force dark text color */
  text-decoration: none;
  transition: all 0.2s;
  font-size: 0.95rem;
  background: transparent;
  border-radius: 0;
  justify-content: flex-start;
  white-space: nowrap;
}

.dropdown-menu li a i {
  width: 20px;
  color: #667eea;
}

.dropdown-menu li a:hover {
  background: #f8f9fa !important;
  color: #667eea !important;
}

.dropdown-menu li a.text-danger {
  color: #dc3545 !important;
}

.dropdown-menu li a.text-danger i {
  color: #dc3545;
}

.dropdown-menu .dropdown-divider {
  height: 1px;
  background: #e0e0e0;
  margin: 8px 0;
}

/* Mobile styles */
@media (max-width: 767px) {
  .dropdown-menu {
    position: static;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: none;
    margin-top: 5px;
    margin-left: 15px;
    width: calc(100% - 30px);
  }

  .dropdown-menu li a {
    color: white !important; /* White text for mobile */
  }

  .dropdown-menu li a i {
    color: rgba(255, 255, 255, 0.8);
  }

  .dropdown-menu li a:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
  }

  .dropdown-menu li a.text-danger {
    color: #ff6b6b !important;
  }

  .dropdown-menu li a.text-danger i {
    color: #ff6b6b;
  }

  .dropdown-menu .dropdown-divider {
    background: rgba(255, 255, 255, 0.1);
  }
}

/* Dropdown container - add this */
.nav-item.dropdown {
  position: relative;
}

/* Active state for dropdown menu items */
.dropdown-menu li a.active {
  background: #667eea !important;
  color: white !important;
}

.dropdown-menu li a.active i {
  color: white !important;
}

/* Mobile styles for active items */
@media (max-width: 767px) {
  .dropdown-menu li a.active {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
  }

  .dropdown-menu li a.active i {
    color: white !important;
  }
}
