/* ========================================
   CSS Variables & Reset
   ======================================== */
:root {
  /* สีหลักตาม Logo FRD Fund - เหลืองทองและเขียว */
  --primary-color: #2E7D32;
  --primary-dark: #1B5E20;
  --primary-light: #4CAF50;
  --secondary-color: #F9A825;
  --secondary-dark: #F57F17;
  --secondary-light: #FDD835;
  --accent-color: #FFB300;
  --danger-color: #D32F2F;
  --success-color: #2E7D32;
  --warning-color: #F9A825;
  --info-color: #1976D2;
  
  /* สีข้อความ */
  --text-primary: #1B5E20;
  --text-secondary: #616161;
  --text-light: #FFFFFF;
  
  /* สีพื้นหลัง */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F1F8E9;
  --bg-accent: #FFFDE7;
  --bg-dark: #1B5E20;
  
  /* สีอื่นๆ */
  --border-color: #C5E1A5;
  --shadow-sm: 0 2px 4px rgba(46,125,50,0.1);
  --shadow-md: 0 4px 6px rgba(46,125,50,0.15);
  --shadow-lg: 0 10px 20px rgba(46,125,50,0.2);
  
  --border-radius: 8px;
  --transition: all 0.3s ease;
  
  --header-height: 70px;
  --nav-height: 50px;
  --bottom-nav-height: 60px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

ul, ol {
  list-style: none;
}

/* ========================================
   Container & Layout
   ======================================== */
.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  width: 100%;
}

/* ========================================
   Header
   ======================================== */
.header {
  background: linear-gradient(135deg, #2E7D32, #1B5E20);
  color: var(--text-light);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1000;
  box-shadow: var(--shadow-md);
  border-bottom: 3px solid var(--secondary-color);
}

.header .container {
  padding: 0;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: 100%;
  max-width: 100%;
  padding: 0 8px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex-direction: row;
  flex-shrink: 0;
}

.logo-image {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.logo-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.logo h1 {
  margin: 0;
  line-height: 1.1;
  color: var(--secondary-color);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
  font-size: 1.4rem;
}

.logo .subtitle {
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.95;
  color: var(--secondary-light);
  line-height: 1;
  margin-top: 2px;
}

.logo i {
  font-size: 1.8rem;
  color: var(--secondary-color);
}

@media (min-width: 768px) {
  .logo-image {
    height: 52px;
  }
  
  .logo h1 {
    font-size: 1.5rem;
  }
}

.search-bar {
  flex: 1;
  max-width: 600px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-bar i {
  position: absolute;
  left: 15px;
  color: var(--text-secondary);
  pointer-events: none;
}

.search-bar input {
  width: 100%;
  padding: 12px 15px 12px 45px;
  border: none;
  border-radius: 25px;
  font-size: 0.95rem;
  outline: none;
  background: rgba(255, 255, 255, 0.95);
  transition: var(--transition);
}

.search-bar input:focus {
  background: var(--bg-primary);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-light);
  transition: var(--transition);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.08);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.icon-btn i {
  font-size: 1.15rem;
}

/* QR Code Button Special Style */
#shareInstallBtn {
  background: linear-gradient(135deg, rgba(249, 168, 37, 0.3), rgba(245, 127, 23, 0.3));
  border: 2px solid rgba(249, 168, 37, 0.5);
  animation: qrPulse 2s ease-in-out infinite;
}

#shareInstallBtn:hover {
  background: linear-gradient(135deg, rgba(249, 168, 37, 0.5), rgba(245, 127, 23, 0.5));
  border-color: rgba(249, 168, 37, 0.8);
}

@keyframes qrPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(249, 168, 37, 0.5);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(249, 168, 37, 0);
  }
}

.badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
  color: var(--text-primary);
  border-radius: 10px;
  padding: 2px 5px;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ========================================
   Navigation
   ======================================== */
.nav {
  background: var(--bg-primary);
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 999;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  height: 100%;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
}

.nav-item {
  padding: 6px 16px;
  border-radius: 18px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.85rem;
}

.nav-item i {
  font-size: 0.95rem;
}

.nav-item:hover {
  background: var(--bg-secondary);
  color: var(--primary-color);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--text-light);
  box-shadow: 0 2px 8px rgba(46,125,50,0.3);
}

/* ========================================
   Banner
   ======================================== */
.banner {
  margin-top: calc(var(--header-height) + var(--nav-height) + 20px);
  margin-bottom: 30px;
}

.banner-slider {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.banner-slide {
  background: linear-gradient(135deg, #2E7D32, #F9A825);
  padding: 60px 40px;
  text-align: center;
  color: var(--text-light);
}

.banner-content h2 {
  font-size: 2.5rem;
  margin-bottom: 15px;
  font-weight: 700;
}

.banner-content p {
  font-size: 1.2rem;
  margin-bottom: 25px;
  opacity: 0.95;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  padding: 12px 30px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
  color: var(--text-primary);
  font-weight: 700;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--secondary-dark), var(--secondary-color));
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--secondary-color);
  color: var(--text-light);
}

.btn-secondary:hover {
  background: var(--secondary-dark);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-color);
  border: 2px solid rgba(255, 255, 255, 0.5);
  font-weight: 600;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, #4CAF50, #2E7D32);
  color: var(--text-light);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
  animation: pulse 2s infinite;
}

.btn-success:hover {
  background: linear-gradient(135deg, #66BB6A, #388E3C);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
  transform: translateY(-2px) scale(1.05);
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
  }
  50% {
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.5);
  }
}

.btn-danger {
  background: var(--danger-color);
  color: var(--text-light);
}

.btn-outline {
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  background: transparent;
}

.btn-text {
  background: transparent;
  color: var(--text-secondary);
}

.btn-sm {
  padding: 8px 20px;
  font-size: 0.9rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* ========================================
   Filter Section
   ======================================== */
.filter-section {
  margin-bottom: 20px;
}

.filter-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

.filter-select {
  padding: 10px 15px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
  background: var(--bg-primary);
}

.view-toggle {
  display: flex;
  gap: 5px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.view-btn {
  padding: 10px 15px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.view-btn.active {
  background: var(--primary-color);
  color: var(--text-light);
}

/* ========================================
   Products Section
   ======================================== */
.main {
  padding-bottom: 100px;
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--text-primary);
  font-weight: 700;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.product-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  background: var(--bg-secondary);
}

.product-info {
  padding: 15px;
}

.product-category {
  font-size: 0.8rem;
  color: var(--primary-color);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.product-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.product-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-color);
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
  color: var(--warning-color);
}

.add-to-cart-btn {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
  color: var(--text-primary);
  border-radius: 8px;
  font-weight: 700;
  transition: var(--transition);
}

.add-to-cart-btn:hover {
  background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.loading {
  text-align: center;
  padding: 50px;
  color: var(--text-secondary);
}

.loading i {
  font-size: 3rem;
  margin-bottom: 15px;
  color: var(--primary-color);
}

/* ========================================
   Modal
   ======================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(27, 94, 32, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  animation: fadeIn 0.3s ease;
  overflow-y: auto;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-primary);
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-large {
  max-width: 900px;
}

.modal-large .modal-body {
  max-height: 75vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) var(--bg-secondary);
}

.modal-large .modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-large .modal-body::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

.modal-large .modal-body::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

.modal-large .modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

.modal-header {
  padding: 24px;
  border-bottom: 2px solid rgba(46, 125, 50, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(241, 248, 233, 0.5), rgba(220, 237, 200, 0.3));
}

.modal-header h2 {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--primary-color);
  font-weight: 600;
}

.close-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--text-secondary);
  font-size: 1.4rem;
  background: rgba(255, 255, 255, 0.5);
}

.close-btn:hover {
  background: var(--danger-color);
  color: white;
  transform: rotate(90deg) scale(1.1);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 20px;
  border-top: 1px solid var(--border-color);
}

/* ========================================
   Cart
   ======================================== */
.cart-item {
  display: flex;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-weight: 600;
  margin-bottom: 5px;
}

.cart-item-price {
  color: var(--primary-color);
  font-weight: 700;
  margin-bottom: 5px;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.quantity-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.quantity-btn:hover {
  background: var(--primary-color);
  color: var(--text-light);
  border-color: var(--primary-color);
}

.quantity-value {
  min-width: 40px;
  text-align: center;
  font-weight: 600;
}

.remove-btn {
  color: var(--danger-color);
  padding: 5px;
  transition: var(--transition);
}

.remove-btn:hover {
  background: rgba(244, 67, 54, 0.1);
  border-radius: 5px;
}

.cart-empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-secondary);
}

.cart-empty i {
  font-size: 4rem;
  margin-bottom: 15px;
  opacity: 0.5;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.3rem;
  margin-bottom: 15px;
}

.cart-total strong {
  color: var(--primary-color);
}

/* ========================================
   Bottom Navigation
   ======================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--bg-primary);
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 20px;
  color: var(--text-secondary);
  transition: var(--transition);
  flex: 1;
}

.bottom-nav-item i {
  font-size: 1.3rem;
}

.bottom-nav-item span {
  font-size: 0.75rem;
  font-weight: 500;
}

.bottom-nav-item.active {
  color: var(--primary-color);
}

/* ========================================
   Toast Notification
   ======================================== */
.toast {
  display: none;
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(150%);
  background: var(--bg-dark);
  color: var(--text-light);
  padding: 15px 25px;
  border-radius: 25px;
  box-shadow: var(--shadow-lg);
  z-index: 3000;
  transition: transform 0.3s ease;
}

.toast.show {
  display: block;
  transform: translateX(-50%) translateY(0);
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-content i {
  font-size: 1.2rem;
  color: var(--success-color);
}

/* ========================================
   Install Prompt
   ======================================== */
.install-prompt {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 10px);
  left: 10px;
  right: 10px;
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  padding: 15px;
  z-index: 1500;
  animation: slideUp 0.3s ease;
}

.install-prompt-content {
  display: flex;
  align-items: center;
  gap: 15px;
}

.install-prompt-content i {
  font-size: 2rem;
  color: var(--primary-color);
}

.install-prompt-text {
  flex: 1;
}

.install-prompt-text strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 3px;
}

.install-prompt-text p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
  .header-content {
    gap: 8px;
    padding: 10px 12px;
  }
  
  .logo {
    gap: 8px;
  }
  
  .logo-image {
    height: 42px;
  }
  
  .logo h1 {
    font-size: 1.15rem;
  }
  
  .logo .subtitle {
    font-size: 0.65rem;
  }
  
  .icon-btn {
    width: 38px;
    height: 38px;
  }
  
  .icon-btn i {
    font-size: 1.05rem;
  }
  
  .header-actions {
    gap: 6px;
  }
  
  .nav-item {
    padding: 5px 12px;
    font-size: 0.8rem;
  }
  
  .nav-item i {
    font-size: 0.9rem;
  }
  
  .banner-content h2 {
    font-size: 1.8rem;
  }
  
  .banner-content p {
    font-size: 1rem;
  }
  
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }
  
  .product-image {
    height: 180px;
  }
  
  .product-info {
    padding: 12px;
  }
  
  .product-name {
    font-size: 0.95rem;
  }
  
  .product-price {
    font-size: 1.1rem;
  }
  
  .product-detail-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  
  .modal-large {
    max-width: 95% !important;
  }
  
  .modal-content {
    max-height: 95vh !important;
  }
}

@media (min-width: 769px) {
  .bottom-nav {
    display: none;
  }
  
  .main {
    padding-bottom: 40px;
  }
  
  .toast {
  display: none;
    bottom: 20px;
  }
  
  .install-prompt {
    bottom: 10px;
    left: auto;
    right: 10px;
    max-width: 400px;
  }
}

@media (max-width: 480px) {
  .nav-item {
    padding: 8px 15px;
    font-size: 0.85rem;
  }
  
  .filter-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .view-toggle {
    justify-content: center;
  }
}

/* ========================================
   User Menu
   ======================================== */
.header-actions {
  position: relative;
}

.user-menu {
  position: absolute;
  top: 60px;
  right: 0;
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  min-width: 250px;
  z-index: 2000;
  animation: slideDown 0.3s ease;
}

.user-info {
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.user-info i {
  font-size: 1.5rem;
  color: var(--primary-color);
}

.user-role {
  padding: 5px 15px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.menu-item {
  width: 100%;
  padding: 12px 15px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
  border-bottom: 1px solid var(--border-color);
}

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

.menu-item:hover {
  background: var(--bg-secondary);
  color: var(--primary-color);
}

/* ========================================
   Auth Forms
   ======================================== */
.auth-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
}

.auth-tab {
  flex: 1;
  padding: 12px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
  cursor: pointer;
}

.auth-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.auth-form {
  animation: fadeIn 0.3s ease;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.form-group label i {
  color: var(--primary-color);
  width: 20px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
  background: var(--bg-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  display: block;
  margin-top: 5px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

/* ========================================
   Product Form
   ======================================== */
.product-form .location-input {
  display: flex;
  gap: 10px;
}

.product-form .location-input input {
  flex: 1;
}

.image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.image-preview img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--border-color);
}

/* ========================================
   Dashboard
   ======================================== */
.modal-xl {
  max-width: 1200px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.8rem;
}

.stat-info h3 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.stat-info p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.9rem;
}

.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.chart-container {
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.chart-container h3 {
  margin-bottom: 15px;
  color: var(--text-primary);
}

.chart-content {
  min-height: 300px;
}

.dashboard-tables {
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.table-responsive {
  overflow-x: auto;
  margin-top: 15px;
}

/* ========================================
   Product Card with Location
   ======================================== */
.product-location {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
}

.product-location i {
  color: var(--primary-color);
}

.product-seller {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
}

.product-seller i {
  color: var(--accent-color);
}

/* ========================================
   Additional Animations
   ======================================== */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 768px) {
  .user-menu {
    right: -10px;
    min-width: 200px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-charts {
    grid-template-columns: 1fr;
  }
  
  .modal-xl {
    max-width: 100%;
  }
}

/* iOS Install Guide Animation */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px); }
  60% { transform: translateY(-3px); }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Quick Actions Responsive */
@media (max-width: 600px) {
    .quick-actions-section > div {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Quick Actions Responsive */
@media (max-width: 600px) {
    .quick-actions-section > div {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* In-App Notification Toast Animation */
@keyframes slideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes slideUp {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* Notification Toast Animations */
@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-15deg); }
  75% { transform: rotate(15deg); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(30px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Product image fallback */
.product-image {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image::before {
    content: '🌿';
    font-size: 3rem;
    position: absolute;
    z-index: 0;
}

.product-image img {
    position: relative;
    z-index: 1;
}
