/* --- Codeat Infotech — Project Showcase --- */
:root {
  --bg: #0a0e14;
  --bg-elevated: #0f1419;
  --surface: #151b23;
  --surface-hover: #1a212c;
  --border: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(99, 179, 237, 0.5);
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-dim: rgba(88, 166, 255, 0.12);
  --success: #3fb950;
  --brand: #7c5cff;
  --brand2: #20e3b2;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --font: 'Outfit', ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { height: 100%; margin: 0; }
body {
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  background:
    radial-gradient(ellipse 120% 80% at 50% -30%, rgba(124, 92, 255, 0.08), transparent 50%),
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(32, 227, 178, 0.06), transparent 45%),
    var(--bg);
  min-height: 100vh;
}

/* App-like layout: only the content panel scrolls */
body { overflow: hidden; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.page-wrap {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Topbar --- */
.topbar {
  background: rgba(15, 20, 25, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}
.brand:hover { text-decoration: none; color: var(--text); }

.logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 4px 16px rgba(124, 92, 255, 0.35);
  flex-shrink: 0;
}

.brand h1 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.btn:hover {
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.12);
  text-decoration: none;
  color: var(--text);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #388bfd);
  border-color: rgba(88, 166, 255, 0.5);
  color: #fff;
  box-shadow: 0 4px 14px rgba(88, 166, 255, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #6ea8ff, #58a6ff);
  color: #fff;
  text-decoration: none;
  border-color: rgba(88, 166, 255, 0.6);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: rgba(88, 166, 255, 0.35);
}
.btn-outline:hover {
  background: var(--accent-dim);
  color: var(--accent);
  text-decoration: none;
}

.btn-filter {
  background: linear-gradient(135deg, var(--brand), rgba(32, 227, 178, 0.9));
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(124, 92, 255, 0.3);
}
.btn-filter:hover {
  filter: brightness(1.08);
  color: #fff;
  text-decoration: none;
}

/* --- Main layout: sidebar + content --- */
.main-content { flex: 1; overflow: hidden; padding: 18px 0 18px; }
.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 22px;
  align-items: start;
  height: 100%;
}

/* --- Sidebar --- */
.sidebar { position: relative; min-width: 200px; }
.sidebar-sticky {
  position: sticky;
  top: 86px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  height: calc(100dvh - 86px - 18px - 18px);
  display: flex;
  flex-direction: column;
}

/* Sidebar: make category list scrollable */
.category-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  padding-right: 6px;
  margin-right: -6px;
}
.sidebar-sticky:hover .category-nav { overflow: auto; }
.sidebar-sticky:focus-within .category-nav { overflow: auto; }
.category-nav::-webkit-scrollbar { width: 10px; }
.category-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 999px; }
.category-nav::-webkit-scrollbar-track { background: transparent; }

.sidebar-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.count-badge {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

/* Content panel scrolls (projects) */
.content-area {
  min-width: 0;
  height: calc(100dvh - 86px - 18px - 18px);
  overflow: auto;
  padding: 0 10px 12px 0;
}
.content-area::-webkit-scrollbar { width: 10px; }
.content-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 999px; }
.content-area::-webkit-scrollbar-track { background: transparent; }
.sidebar-title {
  margin: 0 0 14px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
}
.category-link {
  display: block;
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  text-decoration: none;
}
.category-link:hover {
  background: rgba(255,255,255,0.06);
  color: var(--accent);
  border-color: rgba(88, 166, 255, 0.25);
  text-decoration: none;
}
.category-link.active {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(88, 166, 255, 0.5);
  font-weight: 600;
}

/* --- Content area --- */
/* (moved above to add scroll behavior) */

.hero {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 14px 0 18px;
  margin-bottom: 18px;
  background:
    linear-gradient(180deg, rgba(10,14,20,0.92), rgba(10,14,20,0.65) 70%, rgba(10,14,20,0));
  backdrop-filter: blur(10px);
}
.hero h2 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}
.hero .sub {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.input {
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input::placeholder { color: var(--text-muted); }
.input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.12);
}
.input-search {
  min-width: 240px;
  flex: 1;
}

/* --- Grid & cards --- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  box-shadow: 0 10px 32px rgba(0,0,0,0.25);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(88, 166, 255, 0.2);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.33);
}

.card-thumb-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.card-thumb-link:hover { text-decoration: none; }

.card-thumb {
  height: 180px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.15), rgba(32, 227, 178, 0.08));
  overflow: hidden;
  position: relative;
}

.card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.card:hover .card-thumb-img {
  transform: scale(1.05);
}

.card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: linear-gradient(160deg, rgba(124, 92, 255, 0.2), rgba(32, 227, 178, 0.1));
}
.card-thumb-placeholder-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='m21 15-5-5L5 21'/%3E%3C/svg%3E") center/70% no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='m21 15-5-5L5 21'/%3E%3C/svg%3E") center/70% no-repeat;
  flex-shrink: 0;
}
.card-thumb-placeholder-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.card-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text);
}

.card-desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.45;
  min-height: 2.8em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.tag {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.tag-category {
  background: rgba(124, 92, 255, 0.2);
  color: #a78bfa;
  border: 1px solid rgba(124, 92, 255, 0.35);
}
.tag-muted {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.card-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* --- Empty state --- */
.empty {
  margin-top: 32px;
  padding: 48px 24px;
  text-align: center;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
}
.empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.5'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'/%3E%3C/svg%3E") center/50% no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.5'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'/%3E%3C/svg%3E") center/50% no-repeat;
}
.empty p { margin: 0; font-size: 1rem; }
.empty-hint {
  margin-top: 8px !important;
  font-size: 0.875rem !important;
  opacity: 0.85;
}

/* --- Pagination --- */
.pagination {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
}
.pagination-info { font-size: 0.875rem; color: var(--text-muted); }
.pagination-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.875rem;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.pagination-btn:hover {
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text);
  text-decoration: none;
}
.pagination-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  pointer-events: none;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  background: rgba(10, 14, 20, 0.7);
  padding: 14px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-brand {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}
.footer-links { display: flex; gap: 16px; }
.footer-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer-links a:hover { color: var(--accent); }

/* --- Responsive --- */
@media (max-width: 1024px) {
  body { overflow: auto; }
  .page-wrap { height: auto; min-height: 100dvh; }
  .main-content { overflow: visible; padding: 16px 0 28px; }
  .layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .sidebar { min-width: 0; }
  .sidebar-sticky {
    position: static;
    display: block;
    height: auto;
    padding: 16px 18px;
  }
  .category-nav { max-height: none; overflow: visible; padding-right: 0; margin-right: 0; }
  .content-area { height: auto; overflow: visible; padding-right: 0; }
  .hero { position: static; backdrop-filter: none; background: transparent; padding: 0; }
  .sidebar-title {
    margin: 0 0 12px;
    font-size: 0.8rem;
    color: var(--text);
  }
  .category-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .category-link {
    padding: 10px 14px;
    font-size: 0.9rem;
    display: inline-block;
  }
  .sidebar-footer {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

@media (max-width: 640px) {
  .container { padding: 0 14px; }
  .topbar-inner { padding: 12px 14px; }
  .brand h1 { font-size: 1rem; }
  .logo { width: 38px; height: 38px; }
  .main-content { padding: 16px 0 32px; }
  .sidebar-sticky { padding: 14px 16px; }
  .category-nav { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .category-link { padding: 10px 14px; font-size: 0.875rem; }
  .hero h2 { font-size: 1.45rem; }
  .controls { flex-direction: column; align-items: stretch; }
  .input-search { min-width: 0; }
  .pagination { flex-direction: column; align-items: stretch; text-align: center; }
  .pagination-links { justify-content: center; }
  .card-body { padding: 14px; }
  .card-thumb { height: 160px; }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 380px) {
  .grid {
    grid-template-columns: 1fr;
  }
}
