/* Premium Light Theme & Modern Design System */

:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --secondary-color: #0ea5e9;
  --accent-color: #10b981;
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.25rem;
  --radius-full: 9999px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
}

/* Modern Navbar */
.navbar {
  background-color: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 0.85rem 1.5rem;
  sticky: top;
}

.navbar-brand {
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--primary-color) !important;
}

.navbar-brand img {
  filter: drop-shadow(0 2px 4px rgba(79, 70, 229, 0.3));
}

.nav-link {
  font-weight: 500;
  color: var(--text-secondary) !important;
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-color) !important;
  background-color: var(--primary-light);
}

.badge-pill-custom {
  background-color: var(--primary-color) !important;
  color: white;
  font-weight: 600;
  padding: 0.3em 0.7em;
  border-radius: var(--radius-full);
  margin-left: 0.35rem;
  font-size: 0.75rem;
}

/* Modern Glass / Card Containers */
.card-modern {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.card-modern:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(79, 70, 229, 0.25);
}

/* Product Card Improvements */
.product-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(79, 70, 229, 0.3);
}

.product-img-wrapper {
  background-color: #ffffff;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 220px;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.product-img-wrapper img {
  max-height: 180px;
  object-fit: contain;
  transition: transform 0.4s ease;
}

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

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

.product-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.product-desc {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.4;
  margin-bottom: 1rem;
}

.product-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

/* Buttons */
.btn-primary-custom {
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.btn-primary-custom:hover {
  background-color: var(--primary-hover);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
  transform: translateY(-1px);
}

.btn-outline-custom {
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.btn-outline-custom:hover {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
}

/* Square Icon Buttons for Edit/Delete Action Icons */
.btn-action-square {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md) !important;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.btn-action-square:hover {
  transform: translateY(-2px);
}

/* Table Description 2-Lines Clamp */
.desc-two-lines {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
  line-height: 1.4;
  white-space: normal !important;
}

/* Modern Tables & DataTables Styling Fixes */
.table-modern-wrapper {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  overflow: hidden;
}

.table-modern {
  margin-bottom: 0;
  width: 100% !important;
}

.table-modern th {
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  text-align: center !important;
}

.table-modern td {
  padding: 1rem 1.25rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.table-modern tbody tr:last-child td {
  border-bottom: none;
}

.table-modern tbody tr:hover {
  background-color: rgba(248, 250, 252, 0.8);
}

/* DataTables Control Elements (Search, Length, Info, Pagination) Padding & Clean Styling */
div.dt-container {
  padding: 0.5rem 0;
}

div.dt-container .dt-length,
div.dt-container .dt-search {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

div.dt-container .dt-search input {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.85rem;
  margin-left: 0.5rem;
  outline: none;
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
}

div.dt-container .dt-search input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

div.dt-container .dt-length select {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.75rem;
  margin-right: 0.5rem;
  outline: none;
  font-size: 0.9rem;
}

div.dt-container .dt-info {
  margin-top: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding-top: 0.5rem;
}

div.dt-container .dt-paging {
  margin-top: 1.25rem;
  padding-top: 0.5rem;
}

div.dt-container .dt-paging .dt-paging-button {
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  background: var(--bg-surface) !important;
  color: var(--text-secondary) !important;
  padding: 0.4rem 0.85rem !important;
  margin: 0 0.15rem !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
}

div.dt-container .dt-paging .dt-paging-button.current,
div.dt-container .dt-paging .dt-paging-button:hover {
  background: var(--primary-color) !important;
  color: white !important;
  border-color: var(--primary-color) !important;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.25) !important;
}

/* Auth Cards */
.auth-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  max-width: 440px;
  margin: 3rem auto;
}

.form-control-custom {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.form-control-custom:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
  outline: none;
}

/* Footer Styling */
footer {
  background-color: var(--bg-surface) !important;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background-color: var(--bg-subtle);
  color: var(--text-secondary) !important;
  transition: all 0.2s ease;
  margin-right: 0.5rem;
}

.social-link:hover {
  background-color: var(--primary-color);
  color: white !important;
  transform: translateY(-2px);
}

/* Mobile Navbar Responsiveness */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background: #ffffff;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
  }

  .nav-link {
    padding: 0.75rem 1rem !important;
    border-radius: var(--radius-sm);
  }

  .dropdown-menu {
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-md) !important;
    margin-top: 0.5rem !important;
  }
}