/* ============================================
   BASE.CSS - Structural Layout & Reset
   This file provides layout structure only.
   Colors, shadows, radii, and visuals come from theme CSS files.
   ============================================ */

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

/* Root Variables for Layout Only */
:root {
  --max-width: 1200px;
  --section-spacing: 4rem;
  --card-padding: 1.5rem;
}

/* Typography Base */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  line-height: 1.6;
  min-height: 100vh;
  /* Font family defined in theme */
}

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 0;
  /* Visuals (backdrop-filter, bg) in theme */
}

.header-content {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  /* Color in theme */
}

.nav {
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-self: center;
}

.nav-link {
  text-decoration: none;
  font-weight: 500;
  /* Transitions defined in theme */
}

/* Theme Controls */
.theme-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.btn-theme-popup {
  padding: 0.5rem 1.25rem;
  border-style: solid;
  border-width: 1px;
  /* Border color, radius, bg, color in theme */
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

.btn-theme-like {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  /* Color in theme */
}

.heart-icon {
  width: 24px;
  height: 24px;
  transition: fill 0.3s ease, transform 0.2s ease;
}

.btn-theme-like.liked .heart-icon {
  fill: var(--accent, #e91e63);
  stroke: var(--accent, #e91e63);
}

/* Like button tooltip */
.like-tooltip {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--bg-card, #1a1a2e);
  color: var(--text-primary, #fff);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color, #333);
  z-index: 100;
}

/* Tooltip arrow border (behind) */
.like-tooltip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  right: 12px;
  border: 7px solid transparent;
  border-bottom-color: var(--border-color, #333);
  z-index: 0;
}

/* Tooltip arrow fill (in front) */
.like-tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  right: 13px;
  border: 6px solid transparent;
  border-bottom-color: var(--bg-card, #1a1a2e);
  z-index: 1;
}

.btn-theme-like:hover .like-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Theme Modal */
.theme-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  /* fade in handled by opacity transition in theme or here? 
     Structure: display flex/none. 
     Visual: bg color (dimming), backdrop filter.
  */
}

.theme-modal-overlay.open {
  display: flex;
}

.theme-modal-content {
  width: 90%;
  max-width: 400px;
  overflow: hidden;
  /* Visuals: bg, color, radius, shadow, transform/transition in theme */
}

.theme-modal-header {
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* Border bottom in theme */
}

.theme-modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.theme-modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  /* Color/opacity in theme */
}

.theme-list {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.theme-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  cursor: pointer;
  border-width: 2px;
  border-style: solid;
  border-color: transparent;
  /* Radius, bg, hover bg, active border in theme */
}

.theme-info {
  width: 100%;
}

.theme-name {
  font-weight: 600;
  font-size: 1rem;
  text-transform: capitalize;
}

.theme-badges {
  display: flex;
  gap: 0.5rem;
}

.badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
  /* Colors in theme */
}

.active-indicator {
  font-weight: bold;
  font-size: 1.25rem;
  margin-left: 0.5rem;
  /* Color in theme */
}

/* Hero Section */
.hero {
  padding: var(--section-spacing) 0;
  text-align: center;
  /* Background in theme */
}

.hero-avatar {
  width: 150px;
  height: 150px;
  margin-bottom: 1.5rem;
  object-fit: cover;
  /* Border-radius, border, shadow in theme */
}

.hero-name {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.hero-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.hero-location {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.hero-summary {
  max-width: 700px;
  margin: 0 auto 2rem;
  font-size: 1.1rem;
}

/* Social Links */
.social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  text-decoration: none;
  /* radius, transition, hover, bg, color in theme */
}

.social-link svg {
  width: 24px;
  height: 24px;
}

/* Section Styling */
.section {
  padding: var(--section-spacing) 0;
  /* Background nth-child in theme */
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
}

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

.skill-card {
  padding: var(--card-padding);
  /* radius, bg, border, shadow, hover in theme */
}

.skill-category {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

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

.skill-tag {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  /* radius, bg, border, color in theme */
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.project-card {
  padding: var(--card-padding);
  /* radius, bg, border, shadow, hover in theme */
}

.project-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.project-description {
  margin-bottom: 1rem;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tech-tag {
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  /* radius, bg, color in theme */
}

.project-links {
  display: flex;
  gap: 1rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  /* radius, transition, bg, color, border in theme */
}

/* Experience Timeline structure */
.experience-timeline {
  max-width: 800px;
  margin: 0 auto;
}

.experience-item {
  position: relative;
  padding: var(--card-padding);
  padding-left: 2.5rem;
  margin-bottom: 2rem;
  border-left-style: solid;
  /* border-width, radius, bg, colors in theme */
}

.experience-item::before {
  content: '';
  position: absolute;
  left: -8px;
  /* Alignment tweak, might need adjustment if border width changes, but mostly structural */
  top: var(--card-padding);
  width: 14px;
  height: 14px;
  /* radius, bg, border in theme */
}

.experience-role {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.experience-company {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.experience-period {
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.experience-highlights {
  list-style: none;
  padding: 0;
  margin: 0;
}

.experience-highlights li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.experience-highlights li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

.experience-highlights li:last-child {
  margin-bottom: 0;
}

/* Resume Download Button */
.resume-download-container {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.resume-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent, #7c3aed) 0%, var(--accent-hover, #6d28d9) 100%);
  border: none;
  border-radius: var(--border-radius-pill, 50px);
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
  transition: all 0.3s ease;
  cursor: pointer;
}

.resume-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.resume-download-btn:active {
  transform: translateY(0);
}

.resume-download-btn svg {
  flex-shrink: 0;
}

/* Education */
.education-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.education-card {
  padding: var(--card-padding);
  text-align: center;
  /* radius, bg, border, shadow in theme */
}

.education-degree {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.education-institution {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.education-year {
  font-size: 0.875rem;
}

/* Certifications */
.certifications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.certification-card {
  padding: var(--card-padding);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  /* radius, bg, border, shadow in theme */
}

.certification-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-bottom: 0.5rem;
  color: var(--accent);
  background: rgba(var(--accent-rgb, 139, 92, 246), 0.1);
}

.certification-icon svg {
  width: 28px;
  height: 28px;
}

.certification-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.certification-issuer {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0;
}

.certification-year {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

.certification-link {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--border-radius-pill);
  color: var(--accent);
  border: 1px solid var(--accent);
  transition: var(--transition-fast);
}

.certification-link:hover {
  background: var(--accent);
  color: white;
}

/* Interests */
.interests-section {
  padding-bottom: 3rem;
}

.interests-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.interest-tag {
  padding: 0.6rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--border-radius-pill);
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  transition: var(--transition-fast);
}

.interest-tag:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Footer */
.footer {
  padding: 2rem 0;
  text-align: center;
  margin-top: var(--section-spacing);
  /* bg, border-top in theme */
}

.footer-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Demo Mode Button */
.demo-btn {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  /* radius, shadow, transition, bg, color in theme */
}

.demo-btn svg {
  flex-shrink: 0;
}

.demo-btn-label {
  font-weight: 600;
}

/* Chatbox Container */
.chatbox-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
}

.chatbox-toggle {
  /* width/height removed to allow auto-sizing for text labels */
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  /* radius, shadow, transition, bg, color in theme */
}

.chatbox-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: 500px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  /* radius, bg, border, shadow in theme */
}

.chatbox-window.open {
  display: flex;
}

.chatbox-header {
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* bg, color, border-bottom in theme */
}

.chatbox-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.chatbox-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  /* opacity, color, transition in theme */
}

.chatbox-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  /* bg in theme */
}

.message {
  max-width: 85%;
  padding: 0.75rem 1rem;
  line-height: 1.5;
  font-size: 0.9rem;
  /* radius, bg, color, border in theme */
}

.message.user {
  align-self: flex-end;
}

.message.bot {
  align-self: flex-start;
}

.chatbox-input-container {
  padding: 1rem;
  display: flex;
  gap: 0.5rem;
  /* bg, border-top in theme */
}

.chatbox-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border-style: solid;
  border-width: 1px;
  font-size: 0.9rem;
  outline: none;
  /* radius, bg, color, border-color, shadow in theme */
}

.chatbox-send {
  padding: 0.75rem 1.25rem;
  border: none;
  cursor: pointer;
  font-weight: 600;
  /* radius, bg, color, hover in theme */
}

/* Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-style: solid;
  border-width: 2px;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  /* color/border color in theme */
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  padding: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-name {
    font-size: 2rem;
  }

  .hero-title {
    font-size: 1.25rem;
  }

  /* Adjust Header Layout for Mobile */
  .header-content {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    position: relative;
  }

  /* Collapsible Nav */
  .mobile-menu-toggle {
    display: block;
    margin-left: auto;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color);
    border-top: none;
    padding: 1rem 1.5rem;
    gap: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
  }

  .nav.open {
    display: flex;
  }

  .nav-link {
    display: block;
    width: 100%;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .chatbox-window {
    width: calc(100vw - 2rem);
    right: -1rem;
  }

  /* Compact Chatbox Toggle - Forced Overrides */
  .chatbox-label {
    display: none !important;
  }

  .chatbox-toggle {
    padding: 0 !important;
    border-radius: 50% !important;
    width: 56px !important;
    height: 56px !important;
    justify-content: center !important;
  }

  /* Compact Demo Button - Forced Overrides */
  .demo-btn-label {
    display: none !important;
  }

  .demo-btn {
    padding: 0 !important;
    border-radius: 50% !important;
    width: 56px !important;
    height: 56px !important;
    justify-content: center !important;
  }
}