/* ============================================================
   संस्कृत सेतु — Component Styles (Large Platform)
   Clean cards, sidebars, headers, buttons, inputs
   ============================================================ */

/* ── Clean Card (replacing glass card) ── */
.glass-card, .clean-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out),
              border-color var(--duration-fast);
}
.glass-card:hover, .clean-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--saffron-light);
}

/* ── Cream Card (for important content) ── */
.cream-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

/* ── Stat Card ── */
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  text-align: center;
  transition: all var(--duration-normal) var(--ease-out);
}
.stat-card:hover {
  border-color: var(--saffron);
  box-shadow: var(--shadow-glow);
}
.stat-card .stat-value {
  font-family: var(--font-mono);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--saffron);
  line-height: 1.2;
}
.stat-card .stat-label {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  margin-top: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: var(--fw-semi);
  font-size: var(--fs-sm);
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--saffron);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--saffron-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
}
.btn-secondary:hover {
  border-color: var(--saffron);
  color: var(--saffron);
}

.btn-maroon {
  background: var(--maroon);
  color: var(--text-inverse);
}
.btn-maroon:hover {
  background: var(--maroon-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: var(--fs-xs);
}
.btn-lg {
  padding: 14px 28px;
  font-size: var(--fs-base);
}
.btn-full {
  width: 100%;
}

/* ── Input Fields ── */
.input-field, .search-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--fs-sm);
  transition: all var(--duration-fast) ease;
}
.input-field:focus, .search-input:focus {
  border-color: var(--saffron);
  box-shadow: 0 0 0 3px rgba(255, 153, 51, 0.15);
  outline: none;
}
textarea.input-field {
  resize: vertical;
  min-height: 100px;
}
.search-bar-container {
  position: relative;
  width: 300px;
  max-width: 100%;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.search-input {
  padding-left: 36px;
  border-radius: var(--radius-pill);
}

/* ── Modals ── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  animation: fadeIn 0.2s ease-out;
}
.modal-content {
  background: var(--bg-elevated);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 400px;
  animation: slideUp 0.3s var(--ease-spring);
  border: 1px solid var(--border-light);
}

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

/* ── Sidebar ── */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  transition: transform 0.3s ease;
}
.sidebar-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  height: var(--header-height);
  display: flex;
  align-items: center;
}
.sidebar-nav {
  padding: var(--space-md);
  overflow-y: auto;
  flex: 1;
}
.nav-section {
  margin-bottom: var(--space-lg);
}
.nav-section-title {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: var(--fw-bold);
  margin-bottom: var(--space-sm);
  padding-left: var(--space-sm);
  letter-spacing: 0.5px;
}
.nav-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--duration-fast);
  margin-bottom: 4px;
}
.nav-item:hover {
  background: var(--bg-deep);
  color: var(--saffron);
}
.nav-item.active {
  background: rgba(255, 153, 51, 0.1);
  color: var(--saffron);
  font-weight: var(--fw-bold);
}

/* ── Top Header ── */
.app-header {
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  padding: 0 var(--space-lg);
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.menu-toggle {
  display: none;
  font-size: 24px;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.header-brand .header-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.header-brand .brand-name {
  font-family: var(--font-hindi);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
}
.header-actions {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}
.header-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--maroon);
  color: var(--text-inverse);
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Badge ── */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
}
.badge-gold, .badge-saffron {
  background: rgba(255, 153, 51, 0.15);
  color: var(--saffron);
}
.badge-maroon {
  background: rgba(122, 46, 46, 0.15);
  color: var(--maroon);
}
.badge-green {
  background: rgba(43, 147, 72, 0.15);
  color: var(--green);
}

/* ── Section Title ── */
.section-title {
  font-size: var(--fs-lg);
  font-family: var(--font-hindi);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  margin-top: var(--space-xl);
}

/* ── Toast Notification ── */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-md);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}
.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  pointer-events: auto;
  animation: toastIn 0.4s var(--ease-spring), toastOut 0.3s ease 2.7s forwards;
  max-width: 360px;
}
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-msg { font-size: var(--fs-sm); color: var(--text-primary); }
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--blue); }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--text-muted);
}
.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

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

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--space-lg) 0;
}

/* ── Animations ── */
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* ── Responsive Mobile ── */
@media (max-width: 768px) {
  .app-sidebar {
    position: fixed;
    transform: translateX(-100%);
  }
  .sidebar-open .app-sidebar {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .menu-toggle {
    display: block;
  }
  .search-bar-container {
    display: none; /* Hide search bar on mobile for space, can add a search icon instead */
  }
}
