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

:root {
  --primary-color: #4F46E5; /* Indigo */
  --primary-hover: #4338ca;
  --bg-color: #0f172a; /* Slate 900 */
  --surface-color: rgba(30, 41, 59, 0.7); /* Slate 800 with opacity for glassmorphism */
  --text-primary: #f8fafc; /* Slate 50 */
  --text-secondary: #94a3b8; /* Slate 400 */
  --border-color: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  --glass-blur: blur(12px);
}

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

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* Glassmorphism utilities */
.glass {
  background: var(--surface-color);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  box-shadow: var(--glass-shadow);
  border-radius: 16px;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 5%;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
}

.navbar .logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(to right, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links a {
  margin-left: 2rem;
  font-weight: 600;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: #818cf8;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

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

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
}

/* Hero Section */
.hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 5%;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Abstract Background Glows */
.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(79,70,229,0.3) 0%, rgba(15,23,42,0) 70%);
  z-index: -1;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: -10%;
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, rgba(192,132,252,0.2) 0%, rgba(15,23,42,0) 70%);
  z-index: -1;
}

.hero-content h1 {
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

.hero-content h1 span {
  color: #818cf8;
}

.hero-content p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* Features Grid */
.features {
  padding: 5rem 5%;
  background: rgba(15, 23, 42, 0.5);
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.feature-card {
  padding: 2rem;
  text-align: center;
  transition: transform 0.3s;
}

.feature-card:hover {
  transform: translateY(-5px);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: inline-block;
  background: linear-gradient(to right, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.feature-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.feature-card p {
  color: var(--text-secondary);
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: white;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  html {
    width: 100%;
    overflow-x: hidden;
  }

  body {
    width: 100%;
    overflow-x: hidden;
  }

  img,
  video {
    max-width: 100%;
    height: auto;
  }

  .navbar {
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem;
    flex-wrap: wrap;
  }

  .navbar .logo {
    font-size: 1.2rem;
    line-height: 1.2;
  }

  .nav-links {
    display: flex;
    width: 100%;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .nav-links a {
    margin-left: 0 !important;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
  }

  .btn {
    min-height: 44px;
    text-align: center;
  }

  .hero {
    min-height: auto;
    padding: 3rem 1rem;
  }

  .hero-content h1 {
    font-size: 2.25rem;
    line-height: 1.08;
  }

  .hero-content p {
    font-size: 1rem;
    margin-bottom: 1.75rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .features {
    padding: 3rem 1rem;
  }

  .section-title {
    font-size: 1.9rem;
    margin-bottom: 2rem;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .feature-card {
    padding: 1.5rem;
  }

  body .auth-container {
    width: calc(100% - 2rem);
    max-width: none;
    margin: 2rem auto !important;
    padding: 1.25rem !important;
  }

  /* Storefront */
  body .store-header {
    padding: 3rem 1rem 1.5rem;
  }

  body .store-logo {
    width: 96px;
    height: 96px;
    margin-top: -56px;
  }

  body .store-header h1 {
    font-size: 2rem;
    line-height: 1.1;
    word-break: break-word;
  }

  body .catalog-layout {
    display: block;
    max-width: none;
  }

  body .catalog-main {
    width: 100%;
    min-width: 0;
  }

  body .catalog-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(84vw, 320px);
    min-height: 0;
    height: 100dvh;
    max-height: 100dvh;
    padding: 1rem;
    z-index: 1050;
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    box-shadow: 12px 0 30px rgba(0, 0, 0, 0.35);
  }

  body .catalog-sidebar.open {
    transform: translateX(0);
  }

  body.category-drawer-open .category-drawer-overlay {
    display: block;
  }

  body .category-drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
  }

  body .category-drawer-toggle {
    display: inline-flex;
    width: 100%;
    min-height: 44px;
    order: 2;
    position: sticky;
    top: 0.5rem;
    z-index: 48;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  }

  body .categories-nav {
    justify-content: flex-start;
    gap: 0.6rem;
    padding: 0;
    top: auto;
  }

  body .cat-btn {
    padding: 0.5rem 0.9rem;
    font-size: 0.9rem;
  }

  body .store-toolbar {
    padding: 0.85rem 1rem !important;
    position: sticky;
    top: 0;
    z-index: 47;
    backdrop-filter: blur(10px);
  }

  body .store-filters {
    gap: 0.75rem !important;
    align-items: stretch !important;
  }

  body .store-search {
    flex: 1 1 100% !important;
    min-width: 0 !important;
    order: 1;
  }

  body .store-filter-controls {
    width: 100%;
    gap: 0.5rem !important;
    order: 3;
  }

  body .store-filter-controls select {
    flex: 1 1 0;
    min-width: 0;
    max-width: none !important;
    font-size: 0.9rem;
  }

  body .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    padding: 1.25rem 1rem 2rem;
  }

  body .catalog-summary {
    align-items: flex-start;
    flex-direction: column;
    padding: 1rem 1rem 0;
    gap: 0.5rem;
  }

  body .catalog-summary h2 {
    font-size: 1.35rem;
  }

  body .catalog-summary-count {
    align-self: flex-start;
  }

  body .product-card {
    border-radius: 12px;
  }

  body .product-img {
    height: 145px;
  }

  body .product-details {
    padding: 0.85rem;
  }

  body .product-title {
    font-size: 1rem;
  }

  body .product-price {
    font-size: 1rem;
  }

  body .btn-buy {
    width: 100%;
    min-height: 42px;
    padding: 0.55rem 0.65rem;
    font-size: 0.9rem;
  }

  body .modal-content {
    width: calc(100% - 1rem);
    max-height: 92dvh;
    border-radius: 12px;
  }

  body .modal-img {
    min-height: 220px;
    border-right: 0;
    border-bottom: 1px solid var(--border-color);
  }

  body .modal-info {
    padding: 1.25rem;
  }

  body .cart-float-btn {
    right: 1rem;
    bottom: 1rem;
    width: 56px;
    height: 56px;
    font-size: 1.25rem;
  }

  body .cart-sidebar {
    max-width: none;
    height: 100dvh;
  }

  body .cart-sidebar-header,
  body .cart-footer {
    padding: 1rem;
  }

  body .cart-items-container {
    padding: 1rem;
  }

  /* Admin */
  body .admin-layout {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
  }

  body .admin-layout .sidebar {
    width: 100%;
    max-width: 100%;
    padding: 0.75rem;
    border-right: 0;
    border-bottom: 1px solid var(--border-color);
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body .admin-layout .sidebar > div:first-child {
    flex: 0 0 auto;
    padding: 0 0.5rem 0 0 !important;
    border-bottom: 0 !important;
    margin-bottom: 0 !important;
  }

  body .admin-layout .sidebar > div[style*="flex:1"] {
    display: none !important;
  }

  body .admin-layout .sidebar .logo {
    font-size: 1rem !important;
    white-space: nowrap;
  }

  body .admin-layout .nav-item {
    flex: 0 0 auto;
    padding: 0.65rem 0.8rem;
    border-right: 0 !important;
    border-bottom: 2px solid transparent;
    border-radius: 8px;
    white-space: nowrap;
    font-size: 0.9rem;
  }

  body .admin-layout .nav-item.active,
  body .admin-layout .nav-item:hover {
    border-right: 0 !important;
    border-bottom-color: var(--primary-color);
  }

  body .main-content {
    width: 100%;
    padding: 1rem !important;
  }

  body .dashboard-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  body .dashboard-header .btn,
  body .page-actions .btn {
    width: 100%;
  }

  body .page-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 1rem;
  }

  body .stat-card {
    padding: 1.25rem;
    align-items: flex-start;
  }

  body .stat-icon {
    font-size: 1.6rem;
    padding: 0.75rem;
  }

  body .stat-info div {
    font-size: 1.4rem;
  }

  body .card,
  body .form-card {
    max-width: none;
    padding: 1.25rem !important;
    border-radius: 10px;
  }

  body .card form[style*="display: flex"],
  body .card form[style*="display:flex"],
  body .form-card form > div[style*="display: flex"],
  body .form-card form > div[style*="display:flex"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
  }

  body .card form .btn,
  body .form-card form .btn {
    width: 100%;
    margin-top: 0.5rem;
  }

  body .list-item {
    align-items: stretch;
    flex-direction: column;
    gap: 0.75rem;
  }

  body .list-item > div:last-child {
    width: 100%;
    flex-wrap: wrap;
  }

  body .list-item form,
  body .list-item .btn {
    flex: 1 1 130px;
  }

  body .table-wrapper {
    margin-top: 1rem;
    border-radius: 10px;
  }

  body .table-wrapper table {
    min-width: 620px;
  }

  body th,
  body td {
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  .nav-links a:not(.btn) {
    display: none;
  }

  .navbar {
    align-items: center;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  body .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  body .product-img {
    height: 128px;
  }

  body .product-details {
    padding: 0.75rem;
  }

  body .product-title,
  body .product-price {
    font-size: 0.95rem;
  }

  body .btn-buy {
    font-size: 0.85rem;
  }

  body .store-filter-controls {
    flex-wrap: wrap;
  }

  body .store-filter-controls i {
    display: none;
  }

  body .store-filter-controls select {
    flex-basis: calc(50% - 0.25rem);
  }
}

@media (max-width: 340px) {
  body .products-grid {
    grid-template-columns: 1fr;
  }
}
