/* css/shadcn.css – shadcn/ui inspired component styles */
:root {
  --font-sans: 'Inter', 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 0rem; /* Lyra sharp style */
  --border: 1px solid var(--color-border);
  --shadow: 0 2px 10px rgba(0,0,0,0.05);
  --primary: var(--color-primary);
  --primary-foreground: #fafafa;
  --secondary: var(--color-surface-2);
  --secondary-foreground: var(--color-text);
  --destructive: var(--color-danger);
  --destructive-foreground: #fff;
  --muted: var(--color-surface-2);
  --muted-foreground: var(--color-text-3);
  --accent: var(--color-primary-light);
  --accent-foreground: var(--color-primary);
  --background: var(--color-bg);
  --foreground: var(--color-text);
}

[data-theme='dark'] {
  --background: var(--color-bg);
  --foreground: var(--color-text);
  --primary: var(--color-primary);
  --primary-foreground: #09090b;
  --destructive: var(--color-danger);
  --destructive-foreground: #fff;
  --muted: var(--color-surface-2);
  --muted-foreground: var(--color-text-3);
  --accent: var(--color-primary-light);
  --accent-foreground: var(--color-primary);
}

/* Card */
.shadcn-card {
  background: var(--background);
  border: var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease;
}
.shadcn-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.shadcn-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--foreground);
}

/* Button */
.shadcn-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.shadcn-button-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
}
.shadcn-button-primary:hover {
  background: var(--color-primary-hover);
}
.shadcn-button-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
  border: none;
}
.shadcn-button-secondary:hover {
  background: var(--color-surface-2);
}
.shadcn-button-destructive {
  background: var(--destructive);
  color: var(--destructive-foreground);
  border: none;
}
.shadcn-button-destructive:hover {
  opacity: 0.9;
}
.shadcn-button-ghost {
  background: transparent;
  color: var(--foreground);
  border: none;
}
.shadcn-button-ghost:hover {
  background: var(--secondary);
}

/* Badge */
.shadcn-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
}
.shadcn-badge-primary { background: var(--primary); color: var(--primary-foreground); }
.shadcn-badge-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.shadcn-badge-destructive { background: var(--destructive); color: var(--destructive-foreground); }
.shadcn-badge-muted { background: var(--muted); color: var(--muted-foreground); }

/* Avatar */
.shadcn-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  overflow: hidden;
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.shadcn-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Tooltip */
.shadcn-tooltip {
  position: relative;
  display: inline-block;
}
.shadcn-tooltip .tooltip-content {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--foreground);
  color: var(--background);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 10;
  transition: opacity 0.2s;
}
.shadcn-tooltip:hover .tooltip-content {
  visibility: visible;
  opacity: 1;
}

/* Utility Classes (reuse existing maybe) */
.mt-4 { margin-top:1rem; }
.mt-8 { margin-top:2rem; }
.text-center { text-align:center; }
.text-muted { color: var(--color-text-3); }

/* Hero */
.shadcn-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #7d87d9 100%);
  color: var(--primary-foreground);
  padding: 4rem 2rem;
  text-align: center;
  border-radius: var(--radius);
}
.shadcn-hero h1 { font-size: 2.5rem; font-weight: 700; margin-bottom:1rem; }
.shadcn-hero p { font-size: 1.125rem; margin-bottom:1.5rem; opacity:0.9; }

/* Feature Grid */
.shadcn-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.shadcn-feature-card {
  text-align:center;
  padding:1.5rem;
}
.shadcn-feature-card svg { width:2.5rem; height:2.5rem; margin-bottom:0.75rem; }

/* Carousel */
.shadcn-carousel {
  overflow-x:auto;
  scroll-snap-type:x mandatory;
  display:flex;
  gap:1rem;
}
.shadcn-carousel > * {
  scroll-snap-align:center;
  flex:0 0 80%;
}

/* Section */
.shadcn-section { padding:3rem 1rem; }

/* Global Layout */
#topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  border-bottom: var(--border);
  background: rgba(var(--color-bg-rgb), 0.8);
  backdrop-filter: blur(8px);
  height: 3.5rem;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--foreground);
  text-decoration: none;
}

.nav-tagline {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  display: none;
}
@media (min-width: 768px) {
  .nav-tagline { display: block; }
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--foreground);
  text-decoration: none;
}

.nav-logo .logo-b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #EC4899, #8B5CF6);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.85rem;
  border-radius: 6px;
  margin-right: 2px;
  letter-spacing: 0;
  vertical-align: middle;
}

.nav-links {
  align-items: center;
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  transition: all var(--transition);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  height: 2.25rem;
  padding: 0 0.75rem;
  border: none;
}

.nav-link:hover {
  color: var(--foreground);
}

.nav-link.active {
  background: var(--primary);
  color: var(--primary-foreground) !important;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-foreground) !important;
  border-radius: var(--radius);
  padding: 0 1rem;
  color: var(--foreground);
  border-bottom-color: var(--primary);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Footer */
.shadcn-footer {
  border-top: var(--border);
  padding: 2.5rem 24px;
  background: var(--background);
  margin-top: 4rem;
}

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

.footer-section h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section ul li a {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-section ul li a:hover {
  color: var(--foreground);
}

.footer-bottom {
  max-width: 1280px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-bottom p {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

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

.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

/* Toasts */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 9999;
}

.toast {
  min-width: 300px;
  max-width: 400px;
  background: var(--background);
  color: var(--foreground);
  border: var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  animation: slideIn 0.3s ease-out forwards;
}

.toast-success { border-left: 4px solid var(--color-success); }
.toast-error { border-left: 4px solid var(--destructive); }
.toast-info { border-left: 4px solid var(--primary); }
.toast-warning { border-left: 4px solid var(--color-warning); }

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

.toast.fade-out {
  animation: slideOut 0.3s ease-in forwards;
}

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

/* Modals */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}

#modal-box {
  background: var(--background);
  border: var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 500px;
  padding: 1.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  animation: modalIn 0.2s ease-out forwards;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

#modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.025em;
}

#modal-body {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

#modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.hidden { display: none !important; }

/* Loading Overlay */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  z-index: 11000;
}

#loading-overlay #loading-text {
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.spinner {
  width: 2.75rem;
  height: 2.75rem;
  border: 3.5px solid rgba(255, 255, 255, 0.25);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}



.shadcn-button:active, .btn:active { transform: scale(0.96); opacity: 0.8; }

.nav-link:active { transform: scale(0.96); }

.shadcn-button-secondary:active, .shadcn-button-ghost:active, .shadcn-button-outline:active {
  background: var(--primary) !important;
  color: var(--primary-foreground) !important;
}

.shadcn-button.active { background: var(--primary) !important; color: var(--primary-foreground) !important; }
