/*
 * portfolio/style.css
 * =====================================================
 * Architecture: Monolithic stylesheet
 * Sections:
 *   1. CSS Variables & Reset
 *   2. Layout Shell (sidebars + main)
 *   3. Left Sidebar
 *   4. Right Sidebar
 *   5. Main Content Area
 *   6. About Section
 *   7. Bottom Taskbar Icons
 *   8. Terminal
 *   9. Content Panels (experience/education/etc.)
 *  10. Notes (Blogs)
 *  11. Gallery
 *  12. Modals & Overlays
 *  13. Scrollbars
 *  14. Animations
 *  15. Responsive
 * =====================================================
 */

/* ─────────────────────────────────────────────────
   1. CSS Variables & Reset
───────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&family=Syne:wght@400;600;700;800&display=swap');

:root {
  /* EDIT HERE: Change color palette */
  --bg-primary:     #0f0f0f;
  --bg-secondary:   #1a1a1a;
  --bg-panel:       #141414;
  --bg-glass:       rgba(255,255,255,0.04);
  --bg-glass-hover: rgba(255,255,255,0.08);

  --border:         rgba(255,255,255,0.10);
  --border-active:  rgba(255,255,255,0.25);

  --accent:         #c8f04d;   /* lime green accent */
  --accent-dim:     rgba(200,240,77,0.15);
  --accent-2:       #4df0c8;   /* teal secondary */

  --text-primary:   #f0f0f0;
  --text-secondary: #888;
  --text-muted:     #555;

  --sidebar-w:      72px;
  --taskbar-h:      110px;
  --gap:            12px;

  --radius:         16px;
  --radius-sm:      10px;

  --font-mono:      'JetBrains Mono', monospace;
  --font-display:   'Syne', sans-serif;

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

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
}

/* ─────────────────────────────────────────────────
   2. Layout Shell
───────────────────────────────────────────────── */
#app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--sidebar-w);
  grid-template-rows: 1fr;
  height: 100vh;
  width: 100vw;
  gap: 0;
}

/* ─────────────────────────────────────────────────
   3. Left Sidebar
───────────────────────────────────────────────── */
#sidebar-left {
  grid-column: 1;
  grid-row: 1;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 16px 0;
  z-index: 10;
}

#profile-pic-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  overflow: hidden;
  cursor: default;
  box-shadow: 0 0 0 4px var(--accent-dim);
  transition: box-shadow var(--transition);
}

#profile-pic-wrap:hover {
  box-shadow: 0 0 0 6px var(--accent-dim), 0 0 20px rgba(200,240,77,0.2);
}

#profile-pic-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ─────────────────────────────────────────────────
   4. Right Sidebar
───────────────────────────────────────────────── */
#sidebar-right {
  grid-column: 3;
  grid-row: 1;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
  gap: 18px;
  z-index: 10;
}

.social-link {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  position: relative;
}

.social-link:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-active);
  transform: scale(1.1);
}

.social-link img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: invert(1) brightness(0.75);
  transition: filter var(--transition);
}

.social-link:hover img {
  filter: invert(1) brightness(1);
}

/* Tooltip */
.social-link::after {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.social-link:hover::after {
  opacity: 1;
}

/* ─────────────────────────────────────────────────
   5. Main Content Area
───────────────────────────────────────────────── */
#main {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: var(--gap);
  gap: var(--gap);
  overflow: hidden;
  background: var(--bg-primary);
}

/* ─────────────────────────────────────────────────
   6. About / Content Panel
───────────────────────────────────────────────── */
#content-area {
  flex: 1;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Panel header bar (like window chrome) */
#panel-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.chrome-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-active);
}

.chrome-dot.red   { background: #ff5f57; }
.chrome-dot.yellow{ background: #ffbd2e; }
.chrome-dot.green { background: #28c840; }

#panel-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: 8px;
}

/* Scrollable content inside the panel */
#panel-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 40px 48px;
}

/* ── About ── */
#about-content h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}

#about-content .subtitle {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 32px;
  letter-spacing: 0.05em;
}

#about-content p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 620px;
  margin-bottom: 20px;
}

#about-content .highlight {
  color: var(--accent);
  font-weight: 600;
}

/* ─────────────────────────────────────────────────
   7. Bottom Taskbar Icons
───────────────────────────────────────────────── */
#taskbar {
  height: var(--taskbar-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-shrink: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.task-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  user-select: none;
}

.task-icon:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border);
  transform: translateY(-4px);
}

.task-icon:active {
  transform: translateY(-2px);
}

.task-icon svg {
  width: 42px;
  height: 42px;
  stroke: var(--text-secondary);
  transition: stroke var(--transition);
}

.task-icon:hover svg {
  stroke: var(--accent);
}

.task-icon span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.task-icon:hover span {
  color: var(--accent);
}

/* ─────────────────────────────────────────────────
   8. Terminal
───────────────────────────────────────────────── */
#terminal-panel {
  display: none;
  flex-direction: column;
  height: 100%;
}

#terminal-output {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-primary);
}

.term-line {
  margin-bottom: 2px;
}

.term-prompt { color: var(--accent); }
.term-cmd    { color: var(--text-primary); }
.term-output { color: var(--text-secondary); }
.term-error  { color: #ff6b6b; }
.term-success{ color: var(--accent-2); }
.term-bold   { color: var(--text-primary); font-weight: 600; }

#terminal-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

#terminal-prompt-label {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  white-space: nowrap;
  /* EDIT HERE: Change terminal username/hostname */
}

#terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  caret-color: var(--accent);
}

/* ─────────────────────────────────────────────────
   9. Content Panels (experience / education / etc.)
───────────────────────────────────────────────── */
/* Zigzag / alternating layout as per design screenshots */
.entries-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px 32px;
  padding-bottom: 32px;
}

.entry-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Alternate columns: odd = left, even = right — achieved in JS */
.entry-card.left  { grid-column: 1; }
.entry-card.right { grid-column: 2; }

.entry-card h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.entry-card .entry-sub {
  font-size: 14px;
  color: var(--text-secondary);
}

.entry-card .entry-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.entry-card .entry-desc {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-top: 8px;
  border-left: 2px solid var(--accent-dim);
  padding-left: 12px;
}

/* Section heading inside panels */
.panel-section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 40px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Certification special — 2-col text only */
.cert-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px 32px;
}

.cert-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cert-card h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.cert-card .cert-issuer {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.cert-card .cert-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* Projects — 4-col image grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: transform var(--transition);
}

.project-card:hover {
  transform: translateY(-4px);
}

.project-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-thumb .thumb-placeholder {
  color: var(--text-muted);
  font-size: 32px;
}

.project-card span {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}

/* ─────────────────────────────────────────────────
   10. Notes (Blogs)
───────────────────────────────────────────────── */
#notes-panel {
  display: none;
  flex-direction: column;
  height: 100%;
}

/* Blog list — compact horizontal rows */
.blog-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 16px;
}

.blog-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-glass);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.blog-card:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-active);
}

.blog-thumb {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--bg-glass) 0%, var(--bg-glass-hover) 100%);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-thumb .thumb-emoji {
  font-size: 18px;
}

.blog-card .blog-title {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: left;
  line-height: 1.4;
  flex: 1;
}

/* Blog reader */
#blog-reader {
  display: none;
  flex-direction: column;
  height: 100%;
}

#blog-reader-back {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  background: var(--bg-secondary);
  flex-shrink: 0;
  transition: background var(--transition);
}

#blog-reader-back:hover { background: var(--bg-glass-hover); }

#blog-reader-content {
  flex: 1;
  overflow-y: auto;
  padding: 40px 48px;
}

/* Markdown rendered output */
.md-body {
  max-width: 680px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.md-body h1, .md-body h2, .md-body h3 {
  font-family: var(--font-display);
  color: var(--text-primary);
  margin: 32px 0 12px;
  font-weight: 700;
}

.md-body h1 { font-size: 2rem; }
.md-body h2 { font-size: 1.4rem; }
.md-body h3 { font-size: 1.1rem; }

.md-body p { margin-bottom: 16px; }

.md-body code {
  background: var(--bg-glass-hover);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

.md-body pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 20px;
}

.md-body pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

.md-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  color: var(--text-muted);
  font-style: italic;
  margin: 20px 0;
}

.md-body ul, .md-body ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.md-body li { margin-bottom: 6px; }

.md-body a {
  color: var(--accent-2);
  text-decoration: none;
}

.md-body a:hover { text-decoration: underline; }

.md-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* Notes save area */
#notes-save-area {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  /* Pin to bottom — always visible */
  position: sticky;
  bottom: 0;
  z-index: 5;
}

#notes-save-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#notes-textarea {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 12px;
  resize: vertical;
  min-height: 80px;
  outline: none;
  transition: border-color var(--transition);
}

#notes-textarea:focus { border-color: var(--accent); }

#notes-save-btn {
  align-self: flex-end;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
}

#notes-save-btn:hover { opacity: 0.85; }

/* ─────────────────────────────────────────────────
   11. Gallery
───────────────────────────────────────────────── */
#gallery-panel {
  display: none;
  height: 100%;
  overflow: hidden;
  flex-direction: column;
}

/* Masonry-style grid as shown in design */
.gallery-masonry {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  columns: 4;
  column-gap: 12px;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 1px dashed var(--border);
  background: var(--bg-glass);
  transition: border-color var(--transition), transform var(--transition);
  display: block;
}

.gallery-item:hover {
  border-color: var(--accent);
  transform: scale(1.01);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

/* Gallery lightbox */
#gallery-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

#gallery-lightbox.open {
  display: flex;
}

#lightbox-img {
  max-width: 88vw;
  max-height: 88vh;
  border-radius: var(--radius);
  object-fit: contain;
  box-shadow: 0 40px 120px rgba(0,0,0,0.8);
  animation: lb-in 0.25s ease;
}

@keyframes lb-in {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

#lightbox-close {
  position: absolute;
  top: 24px;
  right: 28px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 18px;
  transition: background var(--transition);
}

#lightbox-close:hover { background: var(--bg-glass-hover); }

/* ─────────────────────────────────────────────────
   12. Scrollbars
───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-active); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

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

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

/* Blinking cursor in terminal */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

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

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  gap: 8px;
}
