/* Static CSS that works without Tailwind build step */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
}

body {
  font-family: inherit;
  background-color: #0f172a;
  color: #e2e8f0;
}

.btn {
  padding: 0.625rem 1.5rem;
  background-color: #0ea5e9;
  color: white;
  font-weight: 500;
  border-radius: 0.5rem;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 10px 20px rgba(14,165,233,0.2);
}

.btn:hover {
  background-color: #38bdf8;
}

.btn:active {
  transform: scale(0.95);
}

.btn-secondary {
  padding: 0.625rem 1.5rem;
  background-color: #0f172a;
  color: white;
  font-weight: 500;
  border-radius: 0.5rem;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease-in-out;
}

.section-heading {
  font-size: 2rem;
  font-weight: 800;
  color: white;
  margin-bottom: 2rem;
  text-align: center;
  letter-spacing: -0.025em;
}

.glass-card {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.75), rgba(15, 23, 42, 0.55));
  backdrop-filter: blur(14px);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 1rem;
  padding: 1.6rem;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.45);
  border-color: rgba(56, 189, 248, 0.6);
}

.btn {
  padding: 0.75rem 1.65rem;
  background-image: linear-gradient(120deg, #0ea5e9 0%, #3b82f6 100%);
  color: #ffffff;
  font-weight: 700;
  border-radius: 0.75rem;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 10px 20px rgba(14, 165, 233, 0.35);
  border: 1px solid rgba(14, 165, 233, 0.45);
}

.btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 14px 25px rgba(14, 165, 233, 0.55);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(14, 165, 233, 0.35);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.4);
}

.btn-secondary {
  padding: 0.75rem 1.65rem;
  background: linear-gradient(145deg, #1e293b, #334155);
  color: #e2e8f0;
  font-weight: 600;
  border-radius: 0.75rem;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(100, 116, 139, 0.4);
}

.btn-secondary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.55);
}

.btn-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.35);
}

.nav-link {
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}

.nav-link:hover {
  background-color: #0f172a;
  color: #e2e8f0;
}

.nav-link.active {
  background-color: #0ea5e9;
  color: white;
  box-shadow: 0 10px 20px rgba(14,165,233,0.2);
}

.social-icon {
  padding: 0.5rem;
  background-color: #0f172a;
  color: #94a3b8;
  border-radius: 0.5rem;
  text-decoration: none;
  display: inline-flex;
  transition: all 0.2s ease-in-out;
}

.social-icon:hover {
  background-color: #0ea5e9;
  color: white;
}

.skill-badge {
  padding: 0.25rem 0.75rem;
  background-color: #0f172a;
  color: #cbd5e1;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid #1e293b;
}

.project-icon-box {
  width: 3rem;
  height: 3rem;
  background-color: #0f172a;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: #0ea5e9;
  transition: all 0.2s ease-in-out;
}

.group:hover .project-icon-box {
  background-color: #0ea5e9;
  color: white;
}

.tag {
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: #0ea5e9;
  background-color: rgba(14,165,233,0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  text-transform: uppercase;
}

.edu-item {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid #1e293b;
}

.edu-dot {
  position: absolute;
  left: -0.56rem;
  top: 0;
  width: 1rem;
  height: 1rem;
  background-color: #0ea5e9;
  border-radius: 9999px;
  box-shadow: 0 0 10px rgba(14,165,233,0.5);
}

#contact .form-input {
  width: 100%;
  background-color: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  color: #e2e8f0;
  outline: none;
  transition: all 0.2s ease-in-out;
}

.form-input:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 2px rgba(14,165,233,0.3);
}

.info-icon-box {
  width: 2.5rem;
  height: 2.5rem;
  background-color: rgba(14,165,233,0.1);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0ea5e9;
}

#contact {
  padding: 4.5rem 1.5rem;
  max-width: 84rem;
  margin: 0 auto;
}

#contact .grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 1024px) {
  #contact .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

#contact h2.section-heading {
  margin-bottom: 1.5rem;
  text-align: left;
  font-size: 2.6rem;
  letter-spacing: -0.02em;
  color: #f8fafc;
}

#contact .contact-subtitle {
  color: #94a3b8;
  margin-bottom: 1.8rem;
}

#contact form {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.90), rgba(15, 23, 42, 0.80));
  border: 1px solid rgba(148, 163, 184, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 1rem;
  padding: 1.5rem;
}

#contact .glass-card {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.65);
}

#contact .info-icon-box {
  background-color: rgba(14, 165, 233, 0.12);
  color: #34d399;
}

#contact .text-slate-500 {
  color: #cbd5e1;
}

#contact .btn {
  width: 100%;
  max-width: 100%;
}

#contact .btn-secondary, #contact .btn {
  font-size: 1rem;
}

/* Mobile-specific UI placement */
@media (max-width: 1023px) {
  body {
    padding-bottom: 4rem; /* avoid content behind bottom social bar */
  }

  #home {
    padding-top: 6.5rem; /* make room for the fixed mobile profile header */
  }

  #mobile-social-bar {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* AI Chat Panel Styles */
#chat-widget-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#chat-toggle-btn {
  width: 3.5rem;
  height: 3.5rem;
  background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
  color: white;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1.5rem;
}

#chat-toggle-btn:hover {
  transform: scale(1.1) rotate(12deg);
  box-shadow: 0 12px 32px rgba(14, 165, 233, 0.6);
}

#chat-toggle-btn:active {
  transform: scale(0.95);
}

#chat-window {
  width: 380px;
  max-width: calc(100vw - 4rem);
  height: 520px;
  max-height: calc(100vh - 8rem);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 1.5rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  transform-origin: bottom right;
  transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8) translateY(20px);
}

#chat-window.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

.chat-header {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(to right, rgba(14, 165, 233, 0.1), transparent);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-avatar {
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(14, 165, 233, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.chat-avatar i {
  color: #0ea5e9;
  font-size: 1rem;
}

.avatar-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0.5rem;
  height: 0.5rem;
  background-color: #10b981;
  border: 2px solid #0f172a;
  border-radius: 50%;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.2) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 10px;
}

.message {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  position: relative;
  animation: messageAppear 0.3s ease-out forwards;
}

@keyframes messageAppear {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
  color: white;
  border-bottom-right-radius: 0.25rem;
}

.message.bot {
  align-self: flex-start;
  background: rgba(30, 41, 59, 0.8);
  color: #e2e8f0;
  border-bottom-left-radius: 0.25rem;
  border: 1px solid rgba(148, 163, 184, 0.1);
}

/* Markdown Styling in Chat */
.message.bot p { margin-bottom: 0.5rem; }
.message.bot p:last-child { margin-bottom: 0; }
.message.bot strong { color: #f8fafc; font-weight: 700; }
.message.bot a { color: #38bdf8; text-decoration: underline; }
.message.bot ul, .message.bot ol { margin-left: 1.25rem; margin-bottom: 0.5rem; }
.message.bot li { margin-bottom: 0.25rem; }
.message.bot code { 
  background: rgba(15, 23, 42, 0.6);
  padding: 0.1rem 0.3rem; 
  border-radius: 0.25rem; 
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
}
.message.bot pre {
  background: rgba(15, 23, 42, 0.8);
  padding: 0.75rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 0.5rem 0;
  border: 1px solid rgba(148, 163, 184, 0.1);
}
.message.bot pre code { background: transparent; padding: 0; }

.chat-input-area {
  padding: 1.25rem;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.chat-input-container {
  display: flex;
  gap: 0.75rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.75rem;
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  transition: all 0.2s;
}

.chat-input-container:focus-within {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.1);
}

#chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #e2e8f0;
  outline: none;
  font-size: 1rem; /* Better for mobile to avoid auto-zoom */
  padding: 0.25rem 0;
}

#chat-send-btn {
  background: #0ea5e9;
  color: white;
  border: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

#chat-send-btn:hover:not(:disabled) {
  background: #38bdf8;
  transform: translateY(-1px);
}

#chat-send-btn:disabled {
  background: rgba(148, 163, 184, 0.1);
  color: rgba(148, 163, 184, 0.4);
  cursor: not-allowed;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 10px 15px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 1rem;
  width: fit-content;
  margin-bottom: 1rem;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

@media (max-width: 640px) {
  #chat-widget-container {
    bottom: 5.5rem; /* Sufficiently above the mobile social bar */
    right: 1.25rem;
  }
  
  #chat-toggle-btn {
    width: 3.25rem;
    height: 3.25rem;
    box-shadow: 0 8px 32px rgba(10, 10, 10, 0.5); /* Stronger shadow on mobile */
  }

  #chat-window {
    position: fixed;
    bottom: 0px;
    left: 0px;
    right: 0px;
    width: 100%;
    height: 80vh; /* Better vertical space */
    max-width: 100vw;
    max-height: 85vh;
    margin-bottom: 0;
    border-radius: 1.5rem 1.5rem 0 0;
    border-bottom: none;
    transform: translateY(100%);
    backdrop-filter: blur(25px);
    background: rgba(15, 23, 42, 0.98); /* Less transparent on mobile for focus */
    z-index: 2000;
  }

  #chat-window.active {
    transform: translateY(0);
  }

  /* Hide toggle button when chat is active on mobile to avoid overlap */
  #chat-widget-container.active #chat-toggle-btn {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.8);
  }

  .chat-messages {
    padding: 1.25rem;
    gap: 0.85rem;
  }

  /* Improved bubble size for tap targets and readability */
  .message {
    max-width: 90%;
    padding: 0.85rem 1.1rem;
    font-size: 1rem;
  }

  .chat-input-area {
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }
}
