/* ===== CSS Variables ===== */
:root {
  /* Dark Mode (Default) - Catppuccin Mocha */
  --bg-primary: #1e1e2e;
  --bg-secondary: #242438;
  --bg-tertiary: #313244;
  --text-primary: #cdd6f4;
  --text-secondary: #a6adc8;
  --accent: #89b4fa;
  --accent-hover: #b4befe;
  --border-color: #313244;
  --shadow-color: rgba(0, 0, 0, 0.3);
  
  /* Light Mode Overrides */
  --bg-primary-light: #eff1f5;
  --bg-secondary-light: #e6e9ef;
  --bg-tertiary-light: #dce0e8;
  --text-primary-light: #4c4f69;
  --text-secondary-light: #6c6f85;
  --accent-light: #1e66f5;
  --accent-hover-light: #004eb5;
  --border-color-light: #ccd0da;
  --shadow-color-light: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] {
  --bg-primary: var(--bg-primary-light);
  --bg-secondary: var(--bg-secondary-light);
  --bg-tertiary: var(--bg-tertiary-light);
  --text-primary: var(--text-primary-light);
  --text-secondary: var(--text-secondary-light);
  --accent: var(--accent-light);
  --accent-hover: var(--accent-hover-light);
  --border-color: var(--border-color-light);
  --shadow-color: var(--shadow-color-light);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== Layout ===== */
.container {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  background: var(--bg-secondary);
  padding: 2rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* ===== Profile Image ===== */
.profile-image-container {
  width: 180px;
  height: 180px;
  margin: 0 auto 1.5rem;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
}

/* Clickable indicator */
.profile-image-container.clickable {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-image-container.clickable:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 40px var(--shadow-color);
}

/* Click hint (appears on hover) */
.profile-image-container.clickable::after {
  content: '🔍';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.profile-image-container.clickable:hover::after {
  opacity: 1;
}

.profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  border: 3px solid var(--accent);
  box-shadow: 0 8px 30px var(--shadow-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  image-rendering: auto;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* ===== Theme Toggle Button ===== */
.theme-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2rem;
  transition: all 0.2s ease;
}

.theme-btn:hover {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

/* ===== Navigation ===== */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-weight: 500;
  border-left: 3px solid transparent;
}

.nav-link:hover, .nav-link:focus {
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border-left-color: var(--accent);
}

/* ===== Contact Info ===== */
.contact-info h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.contact-info ul { list-style: none; }
.contact-info li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}
.contact-info a { color: var(--text-secondary); text-decoration: none; }
.contact-info a:hover { color: var(--accent); }

/* ===== Social Links ===== */
.social-links {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}
.social-links a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}
.social-links a:hover {
  background: var(--accent);
  color: var(--bg-primary);
  transform: translateY(-2px);
}

/* ===== Main Content ===== */
.main-content {
  padding: 2rem;
  max-width: 900px;
}

.content-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.content-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px var(--shadow-color);
}

.content-section h2 {
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.content-section p { color: var(--text-secondary); margin-bottom: 0.5rem; }

/* ===== Job Cards ===== */
.job-card {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: 10px;
  border-left: 4px solid var(--accent);
  transition: background-color 0.3s ease;
}
.job-header { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.25rem; }
.job-header h3 { font-size: 1.1rem; color: var(--text-primary); }
.company { color: var(--accent); font-weight: 500; }
.date { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.job-details { list-style: none; padding-left: 0.5rem; }
.job-details li { position: relative; padding-left: 1rem; margin-bottom: 0.25rem; color: var(--text-secondary); }
.job-details li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); }

/* ===== Read More Button ===== */
.read-more-btn {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 0.75rem;
  transition: all 0.2s ease;
  display: inline-block;
}

.read-more-btn:hover {
  background: var(--accent);
  color: var(--bg-primary);
  transform: translateY(-1px);
}

/* ===== Skill Tags ===== */
.skill-category { margin-bottom: 1.5rem; }
.skill-category h3 { font-size: 1rem; color: var(--text-primary); margin-bottom: 0.5rem; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  background: var(--bg-tertiary);
  color: var(--accent);
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.tag:hover { border-color: var(--accent); transform: translateY(-1px); }

/* Interactive Skill Tags */
.skill-tag {
  cursor: pointer;
  position: relative;
}

.skill-tag:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

/* ===== Project Cards ===== */
.project-card {
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: 10px;
  transition: all 0.2s ease;
}
.project-card:hover { background: var(--bg-secondary); transform: translateX(4px); }
.project-card h3 { font-size: 1.1rem; color: var(--text-primary); margin-bottom: 0.25rem; }
.project-card p { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 0.5rem; }
.project-meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.tech { background: var(--bg-primary); color: var(--text-secondary); padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; }
.project-link { color: var(--accent); text-decoration: none; font-size: 0.9rem; margin-left: auto; }
.project-link:hover { color: var(--accent-hover); }

/* ===== Buttons ===== */
.contact-buttons { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}
.btn.primary { background: var(--accent); color: var(--bg-primary); }
.btn.primary:hover { background: var(--accent-hover); transform: translateY(-2px); }
.btn.secondary { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.btn.secondary:hover { background: var(--accent); color: var(--bg-primary); }

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-color);
}

/* ===== IMAGE MODAL / LIGHTBOX ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  cursor: zoom-out;
}

.modal-content {
  position: relative;
  z-index: 10000;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-image {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 16px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
  cursor: grab;
}

.modal-image:active {
  cursor: grabbing;
}

.modal-close {
  position: absolute;
  top: -50px;
  right: 0;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 2.5rem;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s ease, transform 0.2s ease;
  line-height: 1;
  padding: 0.5rem;
}

.modal-close:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* ===== ARTICLE MODAL (Read More) ===== */
.article-modal-content {
  max-width: 700px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--border-color);
}

.article-modal-body {
  color: var(--text-primary);
  line-height: 1.8;
}

.article-modal-body h3 {
  color: var(--accent);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.article-modal-body strong {
  color: var(--text-primary);
}

.article-modal-body ul {
  list-style-type: disc;
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.article-modal-body li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

/* ===== SKILL MODAL (Explanation) ===== */
.skill-modal-content {
  max-width: 500px;
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--border-color);
}

.skill-modal-body h3 {
  color: var(--accent);
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.skill-modal-body p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.7;
  font-size: 1rem;
}

.skill-ref-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
  border-bottom: 1px solid transparent;
}

.skill-ref-link:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .container { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; border-right: none; border-bottom: 1px solid var(--border-color); padding: 1.5rem; }
  .profile-image-container { width: 140px; height: 140px; }
  .main-content { padding: 1.5rem; }
}

@media (max-width: 600px) {
  .profile-image-container { width: 120px; height: 120px; }
  .profile-section h1 { font-size: 1.5rem; }
  .job-header { flex-direction: column; }
  .contact-buttons { flex-direction: column; }
  .btn { text-align: center; }
  
  .modal-close {
    top: 10px;
    right: 10px;
    font-size: 2rem;
  }
  
  .article-modal-content, .skill-modal-content {
    width: 90%;
    padding: 1.5rem;
  }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
