/* ============================================
   TOP BAR — language + theme switcher
   ============================================ */
.top-bar {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
}

/* ── Language buttons ── */
.lang-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color var(--transition);
  letter-spacing: 0.5px;
}

.lang-btn:hover  { color: var(--text); }
.lang-btn.active { color: var(--primary); }

.lang-divider {
  color: var(--border);
  font-size: 0.85rem;
  user-select: none;
}

/* ── Separator between lang and theme ── */
.bar-divider {
  width: 1px;
  height: 16px;
  background: var(--border);
}

/* ── Theme toggle switch ── */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.theme-toggle .icon {
  font-size: 0.85rem;
  line-height: 1;
  user-select: none;
}

.toggle-track {
  position: relative;
  width: 32px;
  height: 17px;
  background: var(--border);
  border-radius: 999px;
  transition: background var(--transition);
  flex-shrink: 0;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  background: var(--primary);
  border-radius: 50%;
  transition: transform var(--transition);
}

body.light .toggle-thumb {
  transform: translateX(15px);
}

/* ============================================
   LIGHT THEME OVERRIDES
   ============================================ */
body.light {
  --dark:    #f1f5f9;
  --card-bg: #ffffff;
  --text:    #1e293b;
  --muted:   #64748b;
  --border:  #cbd5e1;
  --heading: #0f172a;

}

body.light .hero {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

body.light .top-bar {
  background: rgba(241, 245, 249, 0.92);
}

body.light .chat-window,
body.light #chat-input {
  background: #f8fafc;
}

body.light .chat-message.bot {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

/* ============================================
   GLOBAL RESET & VARIABLES
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary:    #0ea5e9;
  --dark:       #0f172a;
  --card-bg:    #1e293b;
  --text:       #e2e8f0;
  --muted:      #94a3b8;
  --border:     #334155;
  --heading:    #ffffff;   /* h1 hero title */
  --radius:     12px;
  --transition: 0.2s ease;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--dark);
  color: var(--text);
  line-height: 1.7;
}

/* ============================================
   HERO / HEADER
   ============================================ */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  padding: 60px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  object-fit: cover;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 8px;
}

.tagline {
  color: var(--primary);
  font-size: 1.1rem;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
  text-align: justify;
}

.contact-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-links a {
  color: var(--text);
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.9rem;
  transition: all var(--transition);
}

.contact-links a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.location {
  color: var(--text);
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.9rem;
}

/* ============================================
   LAYOUT CONTAINER
   ============================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ============================================
   TWO-COLUMN GRID
   Left  = 2/3  (66.6%)
   Right = 1/3  (33.3%)
   ============================================ */
.two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;   /* columns start at top, don't stretch to equal height */
}

.col-left,
.col-right {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Full-width cards sit outside .two-col so they span both columns */
.full-width {
  width: 100%;
}

/* ============================================
   CHART WRAPPERS
   ============================================ */
.chart-wrapper {
  display: flex;
  justify-content: center;
  padding: 8px 0;
}

.chart-img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.myday-chart-img {
  max-width: 70%;
  height: auto;
  border-radius: 8px;
}

/* Shown when the PNG is not yet generated */
.chart-placeholder {
  width: 100%;
  min-height: 180px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.chart-caption {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

/* ============================================
   SKILLS GRID (compact for right column)
   ============================================ */
.skills-grid-small {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ============================================
   LANGUAGES LIST
   ============================================ */
.lang-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lang-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lang-level {
  font-size: 0.8rem;
  color: var(--primary);
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.3);
  padding: 2px 10px;
  border-radius: 10px;
}

/* ============================================
   HOBBIES TAGS
   ============================================ */
.hobbies-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hobby-tag {
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  transition: border-color var(--transition);
}

.hobby-tag:hover {
  border-color: var(--primary);
}

/* ============================================
   RESPONSIVE — stack columns on mobile
   ============================================ */
@media (max-width: 768px) {
  .two-col {
    grid-template-columns: 1fr;   /* single column on mobile */
  }
}

/* ============================================
   VIEW COUNTER BANNER
   ============================================ */
.counter-banner {
  display: inline-block;
  margin: 20px 0 0;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: var(--radius);
  padding: 12px 40px;
  font-size: 0.95rem;
  color: var(--primary);
}

#view-count {
  font-weight: 700;
  font-size: 1.1rem;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: border-color var(--transition);
}

.card:hover {
  border-color: var(--primary);
}

.card h2 {
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ============================================
   SKILLS GRID
   ============================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.skill-group h3 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 10px;
}

.skill-group ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skill-group ul li::before {
  content: "▸ ";
  color: var(--primary);
}

/* ============================================
   TIMELINE (Experience / Education)
   ============================================ */
.timeline-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.timeline-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.timeline-header strong {
  font-size: 1.05rem;
  color: var(--heading);
}

.jobtitle {
  font-size: 0.85rem;
  color: var(--muted);
  background: rgba(148, 163, 184, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
}

.date {
  font-size: 0.85rem;
  color: var(--muted);
  background: rgba(148, 163, 184, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
}

.company {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.job-desc {
  text-align: justify;
}

.timeline-item ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.timeline-item ul li::before {
  content: "→ ";
  color: var(--primary);
}

/* ============================================
   CHATBOT
   ============================================ */
.chatbot-intro {
  color: var(--muted);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.chat-window {
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
  scroll-behavior: smooth;
}

.chat-message {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

.chat-message.bot {
  background: var(--card-bg);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 3px;
}

.chat-message.user {
  background: var(--primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 3px;
}

.chat-message.loading {
  color: var(--muted);
  font-style: italic;
}

.chat-input-row {
  display: flex;
  gap: 10px;
}

#chat-input {
  flex: 1;
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition);
}

#chat-input:focus {
  border-color: var(--primary);
}

#chat-send-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
}

#chat-send-btn:hover    { opacity: 0.85; }
#chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================
   FOOTER
   ============================================ */
footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 600px) {
  .hero h1             { font-size: 1.8rem; }
  .card                { padding: 20px; }
  .timeline-header     { flex-direction: column; }
  .chat-message        { max-width: 95%; }
}