/* ==========================================================================
   SIMPLE LIGHT SHOWCASE PORTFOLIO SYSTEM
   Aesthetic: Ultra-clean Light Theme, Modern Typography, Fully Mobile Responsive
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* --- Root Variables --- */
:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-modal: #ffffff;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-accent: #2563eb;

  --accent-blue: #2563eb;
  --accent-purple: #7c3aed;
  --accent-cyan: #0891b2;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;

  --gradient-brand: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  
  --border-color: #e2e8f0;
  --border-color-hover: #93c5fd;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Toggle Variables */
[data-theme="dark"] {
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-tertiary: #1e293b;
  --bg-card: #0f172a;
  --bg-card-hover: #1e293b;
  --bg-modal: #0f172a;

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

  --accent-blue: #3b82f6;
  --border-color: rgba(255, 255, 255, 0.1);
  --border-color-hover: rgba(59, 130, 246, 0.5);

  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.6);
}

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

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Container */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  touch-action: manipulation;
  min-height: 44px;
}

.btn-primary {
  background: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  touch-action: manipulation;
}
.btn-icon:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-color-hover);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-primary {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}
.badge-emerald {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.badge-purple {
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
}

/* --- Navbar --- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 0;
  box-shadow: var(--shadow-sm);
}
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-primary);
  text-decoration: none;
}
.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* --- Hero Section --- */
.main-content {
  padding: 2.5rem 0 4rem 0;
}

.hero-simple {
  text-align: center;
  max-width: 650px;
  margin: 0 auto 2.5rem auto;
}
.hero-title-simple {
  font-size: clamp(1.85rem, 5.5vw, 2.75rem);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}
.hero-desc-simple {
  font-size: clamp(0.95rem, 3.5vw, 1.1rem);
  color: var(--text-secondary);
  padding: 0 0.5rem;
}

/* --- Showcase Toolbar & Controls --- */
.showcase-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

/* Scrollable Category Tabs on Mobile */
.category-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-secondary);
  padding: 0.35rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-sm);
  max-width: 100%;
  scrollbar-width: none; /* Firefox */
}
.category-tabs::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.tab-btn {
  padding: 0.55rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  touch-action: manipulation;
  min-height: 40px;
}
.tab-btn:hover {
  color: var(--text-primary);
}
.tab-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.search-view-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  width: auto;
}

.search-box {
  position: relative;
  min-width: 240px;
  flex: 1;
}
.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  min-height: 42px;
}
.search-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.view-switchers {
  display: flex;
  background: var(--bg-secondary);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}
.view-btn {
  padding: 0.45rem 0.7rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  min-height: 38px;
}
.view-btn.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* --- Project Grid & Cards --- */
.projects-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.projects-container.list-view {
  grid-template-columns: 1fr;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-lg);
}

.card-mockup {
  height: 190px;
  position: relative;
  background: #0f172a;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.mockup-header {
  height: 28px;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  padding: 0 0.8rem;
  gap: 0.4rem;
}
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.mockup-address {
  margin-left: 0.4rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'JetBrains Mono', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

.mockup-body {
  flex: 1;
  padding: 1rem;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-badge-container {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 2;
}

.card-content {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
  line-height: 1.3;
}
.card-description {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tech-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  margin-top: auto;
}
.tech-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-family: 'JetBrains Mono', monospace;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color);
  gap: 0.5rem;
}
.btn-card-details {
  background: transparent;
  color: var(--accent-blue);
  border: none;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0;
  touch-action: manipulation;
}

/* List View Adjustments */
.projects-container.list-view .project-card {
  flex-direction: row;
}
.projects-container.list-view .card-mockup {
  width: 320px;
  height: 100%;
  min-height: 200px;
}

/* --- Modal Overlay --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal-card {
  background: var(--bg-modal);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.modal-hero-view {
  height: 220px;
  position: relative;
  overflow: hidden;
}
.modal-hero-content {
  padding: 1.5rem;
}

.modal-metrics-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}
.modal-metric-item {
  display: flex;
  flex-direction: column;
}
.metric-val {
  font-weight: 800;
  font-size: 1rem;
  color: var(--accent-blue);
  font-family: 'JetBrains Mono', monospace;
}
.metric-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-emerald);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all var(--transition-normal);
  max-width: 90vw;
}
.toast.active {
  transform: translateY(0);
  opacity: 1;
}

/* Footer */
.footer {
  padding: 2rem 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE MEDIA QUERIES
   ========================================================================== */

/* Tablets & Small Desktops (< 992px) */
@media (max-width: 992px) {
  .projects-container {
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  }
}

/* Tablets & Mobile Screens (< 768px) */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .hero-simple {
    margin-bottom: 2rem;
  }

  .showcase-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .category-tabs {
    width: 100%;
    justify-content: flex-start;
  }

  .search-view-group {
    width: 100%;
    justify-content: space-between;
  }

  .search-box {
    width: 100%;
  }

  .projects-container.list-view .project-card {
    flex-direction: column;
  }

  .projects-container.list-view .card-mockup {
    width: 100%;
    height: 180px;
  }

  .modal-hero-view {
    height: 190px;
  }

  .modal-metrics-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-hero-content {
    padding: 1.25rem;
  }

  .modal-hero-content div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* Small Mobile Phones (< 480px) */
@media (max-width: 480px) {
  .logo span {
    font-size: 1rem;
  }

  .nav-actions .badge {
    display: none; /* Hide badge on very small screens to fit toggle */
  }

  .projects-container {
    grid-template-columns: 1fr;
  }

  .card-mockup {
    height: 175px;
  }

  .modal-hero-view {
    height: 160px;
  }

  .modal-hero-content div[style*="display: flex; gap: 1rem;"] {
    flex-direction: column;
  }

  .modal-hero-content .btn {
    width: 100%;
  }
}
