/* ========= GRID & IMAGES ========= */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.project-image {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: fill; 
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

/* ========= CARD ========= */
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  display: flex;
  flex-direction: column;
  min-height: 400px;
  height: 100%;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,.1); }

/* Compact variant */
.card--compact { min-height: unset; height: auto; padding: .75rem; }
.card--compact h3 { margin: 0 0 .25rem; font-size: 1rem; }
.card--compact > p { margin: 0 0 .5rem; font-size: .9rem; }
.card--compact ul { margin: .25rem 0 .5rem; padding-left: 1.1rem; }
.card--compact li { margin: .15rem 0; }
.card--compact .tags { margin-top: .25rem; }
.card--compact .tag { font-size: .75rem; padding: .1rem .5rem; }

/* ========= TAGS ========= */
.tag {
  font-size: .85rem;
  padding: .15rem .5rem;
  border: 1px solid #ccc;
  border-radius: 999px;
  margin-right: .35rem;
}

/* ========= TIMELINE ========= */
.timeline {
  position: relative;
  margin: 1rem 0 2rem;
  padding-left: 1.5rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: .6rem; top: 0; bottom: 0;
  width: 2px; background: #e5e7eb;
}
.timeline-item { position: relative; margin: 1rem 0; padding-left: .75rem; }
.timeline-dot {
  position: absolute; left: -0.1rem; top: .6rem;
  width: .75rem; height: .75rem;
  background: #fff; border: 2px solid #3b82f6; border-radius: 9999px;
  box-shadow: 0 0 0 3px #fff;
}
.timeline-card { display: flex; align-items: center; gap: .75rem; }
.timeline-img {
  width: 44px; height: 44px; border-radius: 9999px; object-fit: cover; flex: 0 0 auto;
  border: 1px solid #e5e7eb;
}
.timeline-text { display: grid; gap: .125rem; min-width: 0; }
.timeline-date { font-size: .8rem; color: #6b7280; }
.timeline-label { font-size: .95rem; line-height: 1.3; }


/* ========= EXPERIENCE ========= */
.experience-card { display: flex; align-items: flex-start; gap: 1rem; }
.experience-img {
  width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex: 0 0 auto;
  border: 1px solid #e5e7eb;
}
.experience-text { flex: 1; min-width: 0; }
@media (max-width: 500px) {
  .experience-card { flex-direction: column; align-items: flex-start; }
  .experience-img { width: 40px; height: 40px; }
}

/* ========= HIGHLIGHTS ========= */
.highlights { display: grid; gap: .5rem; margin: 1rem 0; }
.highlight { background: #f9fafb; border-radius: .5rem; padding: .5rem .75rem; font-size: .95rem; }
.esports-hero img { width: 100%; height: auto; border-radius: .75rem; margin-bottom: 1rem; }

/* ========= CERTIFICATES ========= */
.certificates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
  gap: 1.25rem; 
}

.certificate-card {
  padding: 1rem; 
  border-radius: 0.85rem; 
}

.certificate-card:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.logo-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.certificate-name { margin: 0; font-size: 1rem; line-height: 1.3; }
.certificate-issuer { margin: 0; font-size: .9rem; color: #374151; }
.link-inline { font-size: .9rem; text-decoration: underline; text-underline-offset: 2px; }

.cert-cta {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .6rem; border: 1px solid #2563eb; border-radius: 9999px;
  text-decoration: none; font-size: .85rem; color: #2563eb; background: #eff6ff;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.cert-cta::after { content: "↗"; font-size: .85em; line-height: 1; }
.certificate-card:hover { transform: translateY(-2px); }
.cert-cta:hover { background: #dbeafe; transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,.06); }

/* ========= DARK MODE ========= */
/* Theme Toggle */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 2px 8px var(--shadow-color);
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px var(--shadow-color);
}

/* CSS Variables for themes */
:root {
  --bg-color: #ffffff;
  --text-color: #374151;
  --text-secondary: #6b7280;
  --card-bg: #ffffff;
  --border-color: #e5e7eb;
  --shadow-color: rgba(0,0,0,0.05);
  --accent-color: #3b82f6;
  --tag-bg: #f3f4f6;
  --tag-border: #d1d5db;
  --highlight-bg: #f9fafb;
  --timeline-line: #e5e7eb;
}

[data-theme="dark"] {
  --bg-color: #111827;
  --text-color: #f9fafb;
  --text-secondary: #d1d5db;
  --card-bg: #1f2937;
  --border-color: #374151;
  --shadow-color: rgba(0,0,0,0.3);
  --accent-color: #60a5fa;
  --tag-bg: #374151;
  --tag-border: #4b5563;
  --highlight-bg: #374151;
  --timeline-line: #4b5563;
}

/* Apply variables */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.card {
  background: var(--card-bg);
  border-color: var(--border-color);
  box-shadow: 0 2px 8px var(--shadow-color);
}

.tag {
  background: var(--tag-bg);
  border-color: var(--tag-border);
  color: var(--text-color);
}

.highlight {
  background: var(--highlight-bg);
  color: var(--text-color);
}

.timeline::before {
  background: var(--timeline-line);
}

.timeline-dot {
  background: var(--bg-color);
  border-color: var(--accent-color);
}

.timeline-date {
  color: var(--text-secondary);
}

.timeline-label {
  color: var(--text-color);
}

.logo-img {
  border-color: var(--border-color);
  background: var(--card-bg);
}

.certificate-issuer {
  color: var(--text-secondary);
}

.cert-cta {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: var(--card-bg);
}

.cert-cta:hover {
  background: var(--highlight-bg);
}

.experience-summary {
  border-left: 4px solid #7dd3fc;
  padding-left: 12px;
  margin: 0.5rem 0 1rem;
  font-style: italic;
  background-color: rgba(125, 211, 252, 0.05);
}

/* ========= PROJECT FILTERING & SEARCH ========= */
.project-controls {
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-container {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background: var(--card-bg);
  color: var(--text-color);
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  margin-top: 0.25rem;
  box-shadow: 0 4px 12px var(--shadow-color);
  z-index: 10;
  max-height: 200px;
  overflow-y: auto;
  display: none;
}

.search-suggestions.show {
  display: block;
}

.suggestion-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background: var(--highlight-bg);
}

.suggestion-text {
  color: var(--text-color);
}

.suggestion-count {
  color: var(--text-secondary);
  font-size: 0.8rem;
  background: var(--tag-bg);
  padding: 0.2rem 0.5rem;
  border-radius: 1rem;
}

.search-stats {
  margin: 1rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-style: italic;
  display: none;
}

.search-stats.show {
  display: block;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.filter-label {
  font-weight: 600;
  color: var(--text-color);
  margin-right: 0.5rem;
}

.filter-btn {
  padding: 0.4rem 1rem;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-color);
  border-radius: 2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  text-decoration: none;
}

.filter-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.filter-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

.project-grid {
  transition: opacity 0.3s ease;
}

.project-card.hidden {
  display: none;
}

.no-results {
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  padding: 2rem;
  display: none;
}

.no-results.show {
  display: block;
}

/* ========= SKILLS SHOWCASE ========= */
.skills-section {
  margin: 3rem 0;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.skill-category {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 2px 8px var(--shadow-color);
}

.skill-category h3 {
  margin: 0 0 1rem;
  color: var(--accent-color);
  font-size: 1.1rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  padding: 0.3rem 0.8rem;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  border-radius: 1rem;
  font-size: 0.85rem;
  color: var(--text-color);
  transition: transform 0.2s ease;
}

.skill-tag:hover {
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .project-controls {
    gap: 0.75rem;
  }
  
  .filter-buttons {
    justify-content: center;
  }
  
  .skills-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}
