/* ==========================================================================
   Castro Workspace Hub - Styles
   Modern Dark Glassmorphism UI
   ========================================================================== */

:root {
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --bg-primary: #07090e;
  --bg-secondary: #0d121d;
  --bg-card: rgba(18, 24, 38, 0.7);
  --bg-card-hover: rgba(24, 33, 52, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.2);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.35);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background Atmospheric Glows & Grid */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

.bg-glow-1 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #6366f1, #3b82f6);
  top: -150px;
  right: -100px;
}

.bg-glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #ec4899, #8b5cf6);
  bottom: -180px;
  left: -150px;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

/* App Container */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* Header */
.hub-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 48px;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 0.825rem;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 24px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 10px #22c55e;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.hub-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.gradient-text {
  background: linear-gradient(135deg, #a5b4fc 0%, #6366f1 40%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hub-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 32px;
}

.stats-bar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 24, 38, 0.6);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  padding: 12px 28px;
  gap: 24px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stat-divider {
  width: 1px;
  height: 28px;
  background: var(--border-color);
}

/* Controls: Search & Category Pills */
.controls-section {
  max-width: 900px;
  margin: 0 auto 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 20px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition-fast);
}

.search-box input {
  width: 100%;
  padding: 16px 48px 16px 54px;
  border-radius: var(--radius-md);
  background: rgba(18, 24, 38, 0.7);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--transition-normal);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), 0 8px 24px rgba(0, 0, 0, 0.3);
  background: rgba(22, 30, 48, 0.9);
}

.search-box:focus-within .search-icon {
  color: var(--accent-primary);
}

.clear-search {
  position: absolute;
  right: 18px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: color var(--transition-fast);
}

.clear-search:hover {
  color: var(--text-primary);
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.pill {
  padding: 8px 18px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.pill.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 28px;
  margin-bottom: 60px;
}

/* Project Card */
.project-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal), background-color var(--transition-normal);
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-6px);
  background-color: var(--bg-card-hover);
  border-color: var(--border-hover);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5), 0 0 30px -10px var(--card-color, rgba(99, 102, 241, 0.2));
}

.card-glow {
  position: absolute;
  top: -80px;
  right: -80px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--card-color, #6366f1), transparent 70%);
  opacity: 0.15;
  pointer-events: none;
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.project-card:hover .card-glow {
  opacity: 0.35;
  transform: scale(1.2);
}

/* Card Header */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--icon-bg, rgba(99, 102, 241, 0.15));
  color: var(--icon-color, #818cf8);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform var(--transition-bounce);
}

.project-card:hover .card-icon-wrapper {
  transform: scale(1.1) rotate(2deg);
}

.card-status-badge {
  font-size: 0.725rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid transparent;
}

.card-status-badge.live {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.25);
}

.card-status-badge.hardware {
  background: rgba(217, 70, 239, 0.12);
  color: #f0abfc;
  border-color: rgba(217, 70, 239, 0.25);
}

.card-status-badge.event {
  background: rgba(234, 179, 8, 0.12);
  color: #fde047;
  border-color: rgba(234, 179, 8, 0.25);
}

/* Card Body */
.card-body {
  flex: 1;
  margin-bottom: 24px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.card-tagline {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--card-color, #818cf8);
  margin-bottom: 12px;
}

.card-description {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 20px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Card Footer & Launch Button */
.card-footer {
  margin-top: auto;
}

.launch-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-primary:hover {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
  box-shadow: 0 4px 18px rgba(255, 255, 255, 0.2);
}

.btn-primary svg {
  transition: transform var(--transition-fast);
}

.btn-primary:hover svg {
  transform: translateX(4px);
}

/* Empty State */
.no-results {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 60px;
}

.no-results-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.no-results h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.no-results p {
  color: var(--text-secondary);
}

/* Footer */
.hub-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 32px;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.footer-brand {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.footer-note {
  font-size: 0.825rem;
  color: var(--text-muted);
}

.footer-right {
  display: flex;
  gap: 10px;
}

.badge-tech {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

/* Utility classes */
.hidden {
  display: none !important;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .app-container {
    padding: 24px 16px 60px;
  }

  .hub-title {
    font-size: 2.2rem;
  }

  .stats-bar {
    gap: 16px;
    padding: 10px 18px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}
