/* ============================================
   GreatStore - Premium Modern UI Styles
   Theme: Flipkart-level Professional Experience
   Primary Accent: Refined Orange (#FB641B / #F97316)
   Typography: Inter / Poppins
   Cards: 16-20px Radius | Soft Micro-interactions
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@400;500;600;700&display=swap');

:root {
  /* Colors */
  --primary: #fb641b;
  --primary-dark: #e05213;
  --primary-light: #fff0e7;
  --dark: #1f2937;
  --dark-bg: #121212;
  --white: #ffffff;
  
  /* Backgrounds */
  --bg-body: #f1f3f6;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  
  /* Grays */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Accents */
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* UI Tokens */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow: 0 6px 16px rgba(0,0,0,0.06);
  --shadow-hover: 0 12px 28px rgba(0,0,0,0.1);
  --shadow-primary: 0 8px 20px rgba(251, 100, 27, 0.25);
  
  /* Animation */
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Tokens */
[data-theme="dark"] {
  --bg-body: #0f172a;
  --bg-surface: #1e293b;
  --bg-card: #1e293b;
  --dark: #f8fafc;
  --white: #f8fafc;
  --gray-50: #111827;
  --gray-100: #334155;
  --gray-200: #475569;
  --gray-300: #64748b;
  --gray-400: #94a3b8;
  --gray-500: #94a3b8;
  --gray-600: #cbd5e1;
  --gray-800: #f1f5f9;
  --gray-900: #f8fafc;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow: 0 6px 16px rgba(0,0,0,0.5);
  --shadow-hover: 0 12px 28px rgba(0,0,0,0.6);
  --primary-light: rgba(251, 100, 27, 0.15);
  --bg-light: #334155;
}

[data-theme="dark"] .text-dark { color: #f8fafc !important; }
[data-theme="dark"] .text-muted { color: #94a3b8 !important; }
[data-theme="dark"] .bg-light { background-color: #334155 !important; }
[data-theme="dark"] .bg-white { background-color: #1e293b !important; }
[data-theme="dark"] .btn-link { color: #f8fafc !important; }
[data-theme="dark"] .card { background-color: var(--bg-card); border-color: var(--gray-100); }
[data-theme="dark"] .modal-content { background-color: var(--bg-surface); color: var(--dark); border: 1px solid var(--gray-100); }
[data-theme="dark"] .form-control { background-color: var(--gray-50); border-color: var(--gray-100); color: var(--dark); }
[data-theme="dark"] .form-control:focus { background-color: var(--gray-100); color: var(--dark); }
[data-theme="dark"] .breadcrumb-item.active { color: #f8fafc; }
[data-theme="dark"] .btn-outline-secondary { border-color: var(--gray-300); color: var(--gray-300); }
[data-theme="dark"] .table { color: var(--dark); border-color: var(--gray-100); }
[data-theme="dark"] .table thead th { border-bottom-color: var(--gray-200); color: var(--gray-600); }
[data-theme="dark"] .table td { border-color: var(--gray-100); }
[data-theme="dark"] tr:hover { background-color: rgba(255,255,255,0.05) !important; }

/* Global resets & Typograpy */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Poppins', -apple-system, sans-serif;
  background-color: var(--bg-body);
  color: var(--dark);
  margin: 0;
  min-height: 100vh;
  transition: background-color var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.auth-page {
  background-color: var(--bg-body);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  text-decoration: none;
  color: var(--primary-dark);
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--dark);
}

[data-theme="dark"] h1, 
[data-theme="dark"] h2, 
[data-theme="dark"] h3, 
[data-theme="dark"] h4, 
[data-theme="dark"] h5, 
[data-theme="dark"] h6 {
  color: #fff;
}

.text-muted {
  color: var(--gray-500) !important;
}

/* Navbar - Sleek Sticky */
.navbar-great {
  background: var(--bg-surface) !important;
  box-shadow: var(--shadow-sm);
  padding: 0.8rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all var(--transition);
  border-bottom: 1px solid var(--gray-100);
}

.navbar-great .logo-text {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--primary);
  letter-spacing: -0.03em;
  transition: all var(--transition);
}

.navbar-brand:hover .logo-text {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.navbar-brand:active .logo-text {
  transform: scale(0.95);
}

.navbar-great .logo-text span {
  color: var(--dark);
}

.navbar-great .search-input {
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
  padding: 0.65rem 1.2rem 0.65rem 2.8rem;
  font-size: 0.95rem;
  color: var(--dark);
  max-width: 550px;
  transition: all var(--transition);
}

.navbar-great .search-input:focus {
  background: var(--bg-surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
  outline: none;
}

.navbar-great .btn-nav {
  border-radius: var(--radius-sm);
  padding: 0.5rem 1.1rem;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all var(--transition);
  color: var(--gray-800) !important;
}

.navbar-great .btn-nav:hover {
  background: var(--gray-100);
  color: var(--primary) !important;
}

.navbar-great .btn-cart {
  background: var(--bg-surface);
  color: var(--gray-800);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-weight: 600;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition);
}

.navbar-great .btn-cart:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.navbar-great .cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.4);
  border: 2px solid var(--bg-surface);
}

/* Buttons */
.btn-great {
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.01em;
  transition: all var(--transition);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-great:active {
  transform: scale(0.97);
}

.btn-great-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-great-primary:hover, .btn-great-primary:focus {
  background: var(--primary-dark);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary);
}

.btn-great-outline {
  background: transparent;
  border: 1.5px solid var(--gray-300);
  color: var(--gray-800);
}

.btn-great-outline:hover {
  background: var(--gray-50);
  border-color: var(--gray-500);
  color: var(--gray-800);
  transform: translateY(-1px);
}

/* Cards & Surfaces */
.card-great {
  background: var(--bg-surface);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  overflow: hidden;
}

.card-great:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--gray-200);
}

[data-theme="dark"] .card-great {
  border-color: var(--gray-200);
}

[data-theme="dark"] .card-great:hover {
  border-color: var(--gray-500);
}

/* Product Card - Enhanced Hierarchy */
.product-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 0.75rem;
  border: 1px solid var(--gray-200);
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
  transition: all var(--transition);
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--gray-300);
}

.product-card img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  padding: 1rem;
  transition: transform var(--transition-slow);
}

.product-card:hover img {
  transform: scale(1.04);
}

.product-card .card-body {
  padding: 1rem 0.5rem 0.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-card .card-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gray-800);
  margin-bottom: 0.5rem;
  line-height: 1.4;
  height: 2.8em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
}

.product-card .price-block {
  margin-top: auto;
  margin-bottom: 0.75rem;
}

.product-card .price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark);
}

.product-card .mrp {
  font-size: 0.85rem;
  color: var(--gray-500);
  text-decoration: line-through;
  margin-left: 0.5rem;
}

.product-card .badge-discount {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--danger);
  color: #fff;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 2;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.product-card .btn-add-cart {
  width: 100%;
  border-radius: 8px;
  font-weight: 600;
  padding: 0.55rem;
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid transparent;
}

.product-card .btn-add-cart:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

[data-theme="dark"] .product-card .btn-add-cart {
  background: rgba(251, 100, 27, 0.1);
}
[data-theme="dark"] .product-card .btn-add-cart:hover {
  background: var(--primary);
  color: #fff;
}

/* Category Grid (Circles) */
.category-circle {
  width: 85px;
  height: 85px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.category-circle img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  transition: transform var(--transition);
}

.category-circle:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 16px var(--primary-light);
  transform: translateY(-4px);
}

.category-circle:hover img {
  transform: scale(1.1);
}

.category-text {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--gray-800);
}

/* Hero Banner */
.hero-banner {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: linear-gradient(135deg, var(--primary) 0%, #ff8c42 100%);
  color: #fff;
  padding: 3rem;
  min-height: 380px;
  display: flex;
  align-items: center;
  position: relative;
}

.hero-banner::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="100" cy="100" r="80" fill="rgba(255,255,255,0.1)"/></svg>') no-repeat bottom right;
  background-size: 60%;
  pointer-events: none;
}

.hero-banner h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.1);
  color: #fff;
}

.hero-banner .lead {
  font-size: 1.15rem;
  font-weight: 400;
  opacity: 0.9;
  margin-bottom: 2rem;
}

.hero-banner .btn-great {
  background: #fff;
  color: var(--primary-dark);
  font-size: 1.05rem;
  padding: 0.8rem 2rem;
  border-radius: 30px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.hero-banner .btn-great:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 25px rgba(0,0,0,0.2);
  background: var(--gray-50);
}

/* Forms & Inputs */
.form-label {
  font-weight: 500;
  color: var(--gray-800);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.form-control-great {
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-300);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  color: var(--dark);
  background: var(--bg-surface);
  transition: all var(--transition);
}

.form-control-great::placeholder {
  color: var(--gray-500);
}

.form-control-great:focus {
  border-color: var(--primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.input-group-text {
  background: var(--gray-50);
  border: 1px solid var(--gray-300);
  color: var(--gray-600);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important;
  font-weight: 500;
}

[data-theme="dark"] .input-group-text {
  background: var(--gray-100);
  border-color: var(--gray-300);
  color: var(--gray-500);
}

/* Auth Pages (Login/Signup) */
.auth-page-wrap {
  min-height: calc(100vh - 160px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}

.auth-card {
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 15px 50px rgba(0,0,0,0.08);
  background: var(--bg-surface);
  border: 1px solid var(--gray-100);
}

.auth-card .auth-header {
  padding: 2.5rem 2rem 1rem;
}

.auth-card .auth-subtitle {
  color: var(--gray-500);
  font-size: 0.95rem;
}

.auth-card .nav-tabs {
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 0.3rem;
  margin: 0 2rem 1rem;
  border: none;
}

[data-theme="dark"] .auth-card .nav-tabs {
  background: var(--gray-100);
}

.auth-card .nav-tabs .nav-link {
  border: none;
  border-radius: 8px;
  font-weight: 600;
  color: var(--gray-500);
  padding: 0.6rem 1rem;
  transition: all var(--transition);
}

.auth-card .nav-tabs .nav-link.active {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.auth-card .card-body {
  padding: 1rem 2rem 2.5rem;
}

.auth-footer-link {
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 500;
}

/* Skeleton Loaders */
.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Toasts */
.toast-great {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
  padding: 1rem 1.25rem;
  min-width: 300px;
  font-weight: 500;
  background: var(--bg-surface);
  color: var(--dark);
  border-left: 4px solid var(--primary);
}

/* Dashboards & Admin */
.dashboard-sidebar, .admin-sidebar {
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: var(--bg-surface);
  padding: 1.5rem 0;
  border: 1px solid var(--gray-200);
}

.admin-sidebar {
  background: var(--gray-800);
  border: none;
  border-radius: 0;
}

.dashboard-sidebar .nav-link {
  border-radius: 8px;
  margin: 0.3rem 1rem;
  font-weight: 500;
  color: var(--gray-600);
  padding: 0.65rem 1rem;
}

.dashboard-sidebar .nav-link:hover, .dashboard-sidebar .nav-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.admin-sidebar .nav-link {
  color: var(--gray-300);
  border-radius: 8px;
  margin: 0.2rem 1rem;
}

.admin-sidebar .nav-link:hover, .admin-sidebar .nav-link.active {
  background: var(--primary);
  color: #fff;
}

/* Cart & Checkout */
.cart-item-card {
  border-radius: var(--radius);
  background: var(--bg-surface);
  border: 1px solid var(--gray-200);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  transition: box-shadow var(--transition);
}

.cart-item-card:hover {
  box-shadow: var(--shadow-sm);
}

.summary-card {
  border-radius: var(--radius);
  background: var(--bg-surface);
  border: 1px solid var(--gray-200);
  padding: 1.5rem;
  position: sticky;
  top: 100px;
  box-shadow: var(--shadow-sm);
}

/* Footer */
.footer-great {
  background: var(--bg-surface);
  color: var(--gray-800);
  padding: 4rem 0 2rem;
  margin-top: 5rem;
  border-top: 1px solid var(--gray-200);
}

[data-theme="dark"] .footer-great {
  background: var(--bg-surface);
  color: var(--gray-500);
}

.footer-great .logo-text {
  color: var(--primary);
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
}

.footer-great a {
  color: var(--gray-600);
  font-weight: 400;
}

.footer-great a:hover {
  color: var(--primary);
}

/* Success Animation */
.success-check {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin: 0 auto 1.5rem;
  animation: popupScale 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 10px 30px rgba(22, 163, 74, 0.3);
}

@keyframes popupScale {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Theme Toggle */
.theme-toggle {
  background: var(--gray-100);
  color: var(--gray-800);
  border: 1px solid var(--gray-200);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.theme-toggle:hover {
  background: var(--gray-200);
  transform: rotate(15deg);
}

/* Utilities */
.text-primary-great { color: var(--primary) !important; }
.bg-primary-great { background: var(--primary) !important; }
.rounded-great { border-radius: var(--radius) !important; }

/* Responsive Adjustments */
@media (max-width: 768px) {
  .navbar-great { padding: 0.75rem 1rem; }
  .navbar-great .search-input { max-width: 100%; border-radius: var(--radius-sm); }
  .hero-banner { min-height: 280px; padding: 2rem 1.5rem; text-align: center; }
  .hero-banner h1 { font-size: 2.2rem; }
  .category-circle { width: 70px; height: 70px; }
  .category-circle img { width: 40px; height: 40px; }
  .auth-page-wrap { padding: 1.5rem 0.5rem; }
  .auth-card .card-body { padding: 1.5rem; }
  .summary-card { position: static; margin-top: 1.5rem; }
  .product-card { padding: 0.5rem; }
  .product-card img { padding: 0.5rem; }
}
