/* style.css - Main Stylesheet for PriyoBazar */

/* Tailwind CSS CDN */
@import url('https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css');

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Hind+Siliguri:wght@300;400;500;600;700&display=swap');

/* CSS Variables */
:root {
  --primary: #0F766E;
  --primary-dark: #0B4F4A;
  --primary-light: #14B8A6;
  --accent: #F59E0B;
  --accent-dark: #D97706;
  --background: #F8FAFC;
  --text-primary: #1F2937;
  --text-secondary: #4B5563;
  --text-light: #9CA3AF;
  --white: #FFFFFF;
  --success: #16A34A;
  --error: #DC2626;
  --warning: #EA580C;
  --border: #E5E7EB;
  --shadow: 0 1px 3px rgba(0,0,0,0.12);
  --shadow-lg: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-xl: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: 'Inter', 'Hind Siliguri', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--background);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
  margin: 0;
  padding: 0;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* App Container */
#app {
  max-width: 480px;
  margin: 0 auto;
  background: var(--white);
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 30px rgba(0,0,0,0.05);
}

/* App Layout */
.app-header {
  background: var(--primary);
  color: var(--white);
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.app-content {
  padding: 16px;
  padding-bottom: 100px;
  min-height: calc(100vh - 200px);
}

.app-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  max-width: 480px;
  width: 100%;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 8px 0 calc(8px + var(--safe-area-bottom));
  z-index: 100;
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

/* Buttons */
.btn-primary {
  background: var(--primary);
  color: var(--white);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-weight: 600;
  border: none;
  transition: all 0.3s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-accent {
  background: var(--accent);
  color: var(--white);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-weight: 600;
  border: none;
  transition: all 0.3s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-accent:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-weight: 600;
  border: 2px solid var(--primary);
  transition: all 0.3s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-product {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  border: 1px solid var(--border);
}

.card-product:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* Search Bar */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--white);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  border: 2px solid var(--border);
  transition: all 0.3s ease;
}

.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.search-bar input {
  border: none;
  outline: none;
  background: transparent;
  flex: 1;
  padding: 8px;
  font-size: 16px;
  color: var(--text-primary);
}

.search-bar input::placeholder {
  color: var(--text-light);
}

.search-bar button {
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-bar button:hover {
  background: var(--primary-dark);
}

/* Bottom Navigation Items */
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-light);
  font-size: 10px;
  transition: all 0.3s ease;
  padding: 4px 8px;
  position: relative;
  min-width: 56px;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item .nav-icon {
  font-size: 24px;
  margin-bottom: 2px;
  transition: all 0.3s ease;
}

.nav-item.active .nav-icon {
  transform: scale(1.1);
}

.nav-item .nav-label {
  font-size: 10px;
  font-weight: 500;
}

/* Badge */
.badge {
  background: var(--error);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  text-align: center;
  animation: pulse 2s infinite;
}

/* FAB - Floating Action Button */
.fab {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  border: none;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.4);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  margin-top: -16px;
}

.fab:hover {
  transform: scale(1.1) translateY(-4px);
  box-shadow: 0 6px 20px rgba(15, 118, 110, 0.5);
}

.fab:active {
  transform: scale(0.95);
}

.fab-accent {
  background: var(--accent);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.fab-accent:hover {
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-image {
  width: 100%;
  height: 200px;
  border-radius: 8px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-text {
  height: 12px;
  margin: 8px 0;
  border-radius: 4px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-text-sm {
  height: 8px;
  width: 60%;
}

.skeleton-text-lg {
  height: 16px;
  width: 80%;
}

/* Page Transitions */
.page-transition {
  animation: pageFadeIn 0.3s ease forwards;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-transition-slide {
  animation: pageSlideIn 0.3s ease forwards;
}

@keyframes pageSlideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Toast Notification */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 480px;
  width: calc(100% - 32px);
  z-index: 9999;
  pointer-events: none;
}

.toast {
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--text-primary);
  color: var(--white);
  margin-bottom: 10px;
  box-shadow: var(--shadow-xl);
  transform: translateY(-100px);
  opacity: 0;
  transition: all 0.4s ease;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success {
  background: var(--success);
}

.toast-error {
  background: var(--error);
}

.toast-warning {
  background: var(--warning);
}

.toast-info {
  background: var(--primary);
}

/* Modal / Bottom Sheet */
.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  max-width: 480px;
  width: 100%;
  background: var(--white);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 20px;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  max-height: 80vh;
  overflow-y: auto;
}

.bottom-sheet.open {
  transform: translateX(-50%) translateY(0);
}

.sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.sheet-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  margin: 0 auto 16px;
}

/* Responsive Breakpoints */
@media (min-width: 640px) {
  #app {
    max-width: 600px;
  }
  
  .app-bottom-nav {
    max-width: 600px;
  }
}

@media (min-width: 768px) {
  #app {
    max-width: 768px;
  }
  
  .app-bottom-nav {
    max-width: 768px;
  }
}

@media (min-width: 1024px) {
  #app {
    max-width: 1024px;
    padding: 0 20px;
  }
  
  .app-bottom-nav {
    max-width: 1024px;
    padding: 8px 40px calc(8px + var(--safe-area-bottom));
  }
  
  .app-content {
    padding: 20px;
    padding-bottom: 100px;
  }
}

@media (min-width: 1280px) {
  #app {
    max-width: 1280px;
  }
  
  .app-bottom-nav {
    max-width: 1280px;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --background: #0F172A;
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --white: #1E293B;
    --border: #334155;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
  }
  
  .card {
    background: var(--white);
  }
  
  .search-bar {
    background: var(--white);
  }
  
  .app-bottom-nav {
    background: var(--white);
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}