
/* ================================
   CUSTOM STYLES - Project Specific Overrides
   ================================ */

/* ===== MULTI-SHOP THEMES ===== */
:root {
  --shop-blue-primary: #4361ee;
  --shop-blue-dark: #3a0ca3;
  --shop-blue-light: #e8ecff;
  --shop-green-primary: #10b981;
  --shop-green-dark: #059669;
  --shop-green-light: #d1fae5;
}

/* Shop theme classes - apply to body */
body.shop-chettikulam {
  --current-shop-primary: var(--shop-blue-primary);
  --current-shop-dark: var(--shop-blue-dark);
  --current-shop-light: var(--shop-blue-light);
}

body.shop-ozhignasary {
  --current-shop-primary: var(--shop-green-primary);
  --current-shop-dark: var(--shop-green-dark);
  --current-shop-light: var(--shop-green-light);
}

/* Override primary colors when shop theme is active */
body.shop-ozhignasary .bg-primary { background-color: var(--shop-green-primary) !important; }
body.shop-ozhignasary .text-primary { color: var(--shop-green-primary) !important; }
body.shop-ozhignasary .border-primary { border-color: var(--shop-green-primary) !important; }
body.shop-ozhignasary .btn-primary { background-color: var(--shop-green-primary) !important; }
body.shop-ozhignasary .btn-primary:hover { background-color: var(--shop-green-dark) !important; }
body.shop-ozhignasary #app-header { border-bottom-color: var(--shop-green-light) !important; }
body.shop-ozhignasary .shop-selector { background: linear-gradient(135deg, var(--shop-green-primary), var(--shop-green-dark)) !important; }

/* ===== SHOP SELECTION SCREEN ===== */
.shop-card {
  position: relative;
  border-radius: 1rem;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
}

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

.shop-card-blue {
  background: linear-gradient(135deg, #4361ee, #3a0ca3);
  color: white;
}

.shop-card-green {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.shop-card .shop-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 3rem;
  opacity: 0.2;
}

.shop-card-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

.shop-stat-box {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  border-radius: 0.5rem;
  padding: 0.75rem;
  text-align: center;
}

.shop-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
}

.shop-stat-label {
  font-size: 0.7rem;
  opacity: 0.85;
}

.enter-shop-btn {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 0.5rem;
  color: white;
  font-weight: 600;
  transition: all 0.2s ease;
}

.enter-shop-btn:hover {
  background: rgba(255,255,255,0.3);
  border-color: white;
}

/* ===== MULTI-SHOP SELECTOR ===== */
.shop-selector-wrapper {
  margin: 0;
}

.shop-selector-wrapper select {
  appearance: none;
  padding-right: 2.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.shop-selector-wrapper select:focus {
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

body.shop-ozhignasary .shop-selector-wrapper select:focus {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.shop-selector-wrapper select option {
  background: white;
  color: #1f2937;
  padding: 0.5rem;
}

.shop-badge {
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Shop indicator colors */
.shop-chettikulam .shop-badge { background: rgba(67, 97, 238, 0.2) !important; color: #4361ee !important; }
.shop-ozhignasary .shop-badge { background: rgba(16, 185, 129, 0.2) !important; color: #10b981 !important; }

/* Billing page shop accent */
body.shop-ozhignasary #order-sidebar { border-left-color: var(--shop-green-light) !important; }
body.shop-ozhignasary .cart-header { background: linear-gradient(135deg, var(--shop-green-primary), var(--shop-green-dark)) !important; }

/* Green shop comprehensive overrides */
body.shop-ozhignasary .form-control:focus { 
  border-color: var(--shop-green-primary) !important;
  box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.25) !important;
}
body.shop-ozhignasary .nav-item:hover,
body.shop-ozhignasary .nav-item.active { 
  background-color: rgba(16, 185, 129, 0.1) !important;
  color: var(--shop-green-primary) !important;
}
body.shop-ozhignasary .nav-item.active i { color: var(--shop-green-primary) !important; }
body.shop-ozhignasary #mobile-cart-total { color: var(--shop-green-primary) !important; }
body.shop-ozhignasary .checkout-btn { background-color: var(--shop-green-primary) !important; }
body.shop-ozhignasary .checkout-btn:hover { background-color: var(--shop-green-dark) !important; }
body.shop-ozhignasary .animate-spin { border-bottom-color: var(--shop-green-primary) !important; }
body.shop-ozhignasary .stat-card { border-left-color: var(--shop-green-primary) !important; }
body.shop-ozhignasary .card-accent { border-left-color: var(--shop-green-primary) !important; }
body.shop-ozhignasary a.text-primary:hover { color: var(--shop-green-dark) !important; }
body.shop-ozhignasary .bg-primary-light { background-color: var(--shop-green-light) !important; }
body.shop-ozhignasary .ring-primary { --tw-ring-color: var(--shop-green-primary) !important; }

/* Mobile checkout button for green shop */
body.shop-ozhignasary #mobile-checkout-btn-summary {
  background-color: var(--shop-green-primary) !important;
}
body.shop-ozhignasary #mobile-checkout-btn-summary:hover {
  background-color: var(--shop-green-dark) !important;
}

/* Toast notifications */
.toast {
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
  transform: translateX(100%);
  opacity: 0;
  width: 100%;
  max-width: 320px;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

/* Loading spinner */
@keyframes spinner {
  to { transform: rotate(360deg); }
}

/* Desktop layout with cart sidebar */
@media (min-width: 768px) {
  /* Only apply sidebar spacing on billing page */
  .page-billing #main-content,
  .page-billing .container {
    margin-right: 384px; 
    width: auto;
    max-width: none;
  }
  
  /* For all other pages, allow full width to fill empty space */
  body:not(.page-billing) .container {
     max-width: 100%;
     width: 100%;
  }
  
  #order-sidebar {
    border-left: 1px solid #e5e7eb;
    display: block !important;
  }
}

/* Form styles */
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  border-color: #4361ee;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25);
}

/* Dark mode form control */
.dark .form-control {
  background-color: #374151;
  border-color: #4b5563;
  color: #e5e7eb;
}

.dark .form-control:focus {
  border-color: #4361ee;
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25);
}

/* Active navigation button */
.nav-btn.active {
  color: #4361ee !important;
}

/* ================================
   ADDITIONAL UTILITY CLASSES
   ================================ */

/* Focus ring utilities */
.focus\:ring-opacity-50:focus {
  --ring-opacity: 0.5;
}

/* Border color utilities */
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }

/* Dark mode border utilities */
.dark .border-gray-600 { border-color: #4b5563; }
.dark .border-gray-700 { border-color: #374151; }

/* Max height for modals */
.max-h-\[70vh\] { max-height: 70vh; }
.max-h-\[40vh\] { max-height: 40vh; }

/* Specific width for sidebar */
.w-\[280px\] { width: 280px; }

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

/* ================================
   MOBILE UI/UX IMPROVEMENTS
   ================================ */

/* 1. Safe Area Insets for Modern Phones */
@media (max-width: 767px) {
  #bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
  }
  #mobile-cart-fab {
    bottom: calc(5rem + env(safe-area-inset-bottom));
  }
}

/* 2. Improved Mobile Touch Targets */
@media (max-width: 640px) {
  .form-control, 
  button,
  select,
  input[type="text"],
  input[type="number"] {
    min-height: 44px;
  }
  
  .increment-btn, .decrement-btn {
    min-width: 44px;
  }

  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* 3. Active State Feedback for Touch Devices */
@media (hover: none) {
  button:active {
    opacity: 0.8;
    transform: scale(0.98);
    transition: transform 0.1s ease-out;
  }
}

/* ================================
   CRUD TABLE ENHANCEMENTS
   ================================ */

/* Action buttons in tables */
.action-btn {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  transition: all 0.15s ease;
}

.action-btn:hover {
  opacity: 0.8;
}

/* Empty state styling */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}

.empty-state i {
  font-size: 3rem;
  opacity: 0.5;
  margin-bottom: 1rem;
  display: block;
}

/* Table row hover effects */
.data-table tbody tr:hover {
  background-color: #f9fafb;
}

.dark .data-table tbody tr:hover {
  background-color: #374151;
}

/* Form validation states */
.form-control.is-invalid {
  border-color: #e63946;
}

.form-control.is-valid {
  border-color: #2a9d8f;
}

/* ================================
   BUTTON ENHANCEMENTS
   ================================ */

/* Button loading state */
.btn.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spinner 0.6s linear infinite;
}

/* Icon buttons */
.btn-icon {
  padding: 0.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ================================
   CARD ENHANCEMENTS
   ================================ */

/* Card with hover effect */
.card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

/* Stat cards */
.stat-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1rem;
  border-left: 4px solid;
}

.dark .stat-card {
  background: #1f2937;
}

/* ================================
   MODAL ENHANCEMENTS
   ================================ */

/* Modal backdrop blur effect */
.modal-backdrop {
  backdrop-filter: blur(2px);
}

/* Modal animations */
.modal-enter {
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ================================
   SCROLLBAR STYLING
   ================================ */

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

.dark ::-webkit-scrollbar-track {
  background: #374151;
}

.dark ::-webkit-scrollbar-thumb {
  background: #4b5563;
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}