/* ========================================
   JOYANTA DEB GUPTA - PREMIUM PORTFOLIO
   Modern, Elegant Design System v2.0
   Fonts loaded from index.html for better performance
   ======================================== */

/* ===== ROOT VARIABLES ===== */
:root {
  /* Typography */
  --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;

  /* Light Mode */
  --bg-base: #fafbfc;
  --bg-surface: #ffffff;
  --bg-elevated: #f8f9fa;
  --bg-muted: #f1f3f4;

  --text-heading: #1a1a2e;
  --text-body: #4a4a68;
  --text-muted: #6b7280;
  --text-subtle: #9ca3af;

  --primary: #5046e5;
  --primary-light: #6366f1;
  --primary-dark: #4338ca;
  --primary-glow: rgba(80, 70, 229, 0.25);

  --accent: #ec4899;
  --accent-light: #f472b6;

  --gradient-primary: linear-gradient(135deg, #5046e5 0%, #7c3aed 50%, #ec4899 100%);
  --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 249, 250, 0.95) 100%);

  --border: #e5e7eb;
  --border-light: #f3f4f6;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
  --shadow-glow: 0 4px 24px var(--primary-glow);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
}

/* ===== DARK MODE ===== */
.dark {
  --bg-base: #0c0c14;
  --bg-surface: #13131f;
  --bg-elevated: #1a1a2e;
  --bg-muted: #252540;

  --text-heading: #ffffff;
  --text-body: #c4c4d4;
  --text-muted: #8888a4;
  --text-subtle: #5c5c78;

  --primary: #818cf8;
  --primary-light: #a5b4fc;
  --primary-dark: #6366f1;
  --primary-glow: rgba(129, 140, 248, 0.2);

  --gradient-primary: linear-gradient(135deg, #818cf8 0%, #a78bfa 50%, #f472b6 100%);
  --gradient-card: linear-gradient(145deg, rgba(19, 19, 31, 0.95) 0%, rgba(26, 26, 46, 0.9) 100%);

  --border: #2a2a4a;
  --border-light: #1f1f3a;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ===== DARK MODE STYLES ===== */
/* Using CSS variables that Tailwind can work with */
html.dark {
  --bg-base: #0c0c14;
  --bg-surface: #13131f;
  --bg-elevated: #1a1a2e;
  --bg-muted: #252540;
  --text-heading: #ffffff;
  --text-body: #c4c4d4;
  --text-muted: #8888a4;
  --border: #2a2a4a;
}

html.dark .bg-white {
  background-color: #1a1a2e;
}

html.dark .bg-slate-50 {
  background-color: #0c0c14;
}

html.dark .bg-slate-100 {
  background-color: #13131f;
}

html.dark .text-slate-700,
html.dark .text-slate-800 {
  color: #e2e8f0;
}

html.dark .text-slate-600 {
  color: #cbd5e1;
}

html.dark .text-slate-500 {
  color: #94a3b8;
}

html.dark .border-slate-200 {
  border-color: #2a2a4a;
}

/* Dark mode for icons */
html.dark .fa,
html.dark .fas,
html.dark .far,
html.dark .fab,
html.dark .fal,
html.dark .fad {
  color: #94a3b8;
}

html.dark .text-slate-800 {
  color: #e2e8f0;
}

html.dark .text-slate-700 {
  color: #cbd5e1;
}

/* Dark mode for experience counter text */
html.dark #experience-counter,
html.dark #stats-years,
html.dark #footer-years,
html.dark #about-years {
  color: #e2e8f0;
}

/* Dark mode card styles */
html.dark .project-card,
html.dark .experience-card,
html.dark .skill-item-pro,
html.dark .interest-item,
html.dark .training-card,
html.dark .education-card,
html.dark .card {
  background-color: #1a1a2e;
  border-color: #2a2a4a;
}

html.dark .text-indigo-700,
html.dark .text-indigo-600 {
  color: #818cf8;
}

html.dark .text-indigo-800 {
  color: #a5b4fc;
}

/* Dark mode for text inside cards */
html.dark .experience-card p,
html.dark .project-card p,
html.dark .education-card p,
html.dark .training-card p,
html.dark .skill-item-pro p,
html.dark .interest-item p {
  color: #c4c4d4;
}

html.dark .experience-card h3,
html.dark .project-card h3,
html.dark .education-card h3,
html.dark .training-card h3 {
  color: #e2e8f0;
}

/* Dark mode for list items in cards */
html.dark .experience-card li,
html.dark .training-card li {
  color: #c4c4d4;
}

html.dark .experience-card ul li::before {
  color: #818cf8;
}

html.dark .achievement-list li::before {
  color: #f472b6;
}

html.dark .text-indigo-500 {
  color: #a5b4fc;
}

/* ===== COMPREHENSIVE DARK MODE STYLES ===== */

/* All white background cards */
html.dark .bg-white,
html.dark [class*="bg-white"] {
  background-color: #1a1a2e !important;
}

/* All slate text colors */
html.dark .text-slate-500,
html.dark .text-slate-400 {
  color: #94a3b8;
}

html.dark .text-slate-600 {
  color: #cbd5e1;
}

html.dark .text-slate-700 {
  color: #e2e8f0;
}

html.dark .text-slate-800 {
  color: #f1f5f9;
}

/* Indigo text */
html.dark .text-indigo-600 {
  color: #818cf8;
}

html.dark .text-indigo-700 {
  color: #a5b4fc;
}

html.dark .text-indigo-800 {
  color: #c7d2fe;
}

/* Green text */
html.dark .text-green-600,
html.dark .text-green-700 {
  color: #4ade80;
}

/* Sky text */
html.dark .text-sky-600,
html.dark .text-sky-700 {
  color: #38bdf8;
}

/* Amber text */
html.dark .text-amber-600,
html.dark .text-amber-700 {
  color: #fbbf24;
}

/* Rose text */
html.dark .text-rose-600 {
  color: #fb7185;
}

/* Cyan text */
html.dark .text-cyan-600 {
  color: #22d3d1;
}

/* Emerald text */
html.dark .text-emerald-600,
html.dark .text-emerald-700 {
  color: #34d399;
}

/* Emerald background */
html.dark .bg-emerald-100 {
  background-color: #064e3b !important;
}

/* Interest items */
html.dark .interest-item {
  background-color: #1a1a2e !important;
  border-color: #334155;
}

html.dark .interest-item i {
  color: #818cf8;
}

html.dark .interest-item p {
  color: #e2e8f0;
}

/* Back to top button - stronger specificity */
html.dark #back-to-top,
html.dark #back-to-top i,
html.dark #back-to-top .fa-arrow-up {
  background: linear-gradient(135deg, #818cf8 0%, #a78bfa 50%, #f472b6 100%) !important;
  color: white !important;
}

/* Chat button - stronger specificity */
html.dark .ai-chat-widget .ai-chat-button,
html.dark .ai-chat-widget .ai-chat-button i,
html.dark .ai-chat-widget .ai-chat-button .fa-robot {
  background: linear-gradient(135deg, #818cf8 0%, #a78bfa 50%, #f472b6 100%) !important;
  color: white !important;
}

/* Chat close button */
html.dark #ai-chat-close,
html.dark #ai-chat-close i {
  color: white !important;
}

/* Additional backgrounds */
html.dark .bg-slate-100 {
  background-color: #1e293b !important;
}

html.dark .bg-slate-900 {
  background-color: #0f172a !important;
}

html.dark .bg-indigo-900\/30,
html.dark .bg-indigo-900\/30 {
  background-color: #312e81 !important;
}

/* Round badge backgrounds */
html.dark .bg-indigo-100 {
  background-color: #1e1b4b !important;
}

/* Inline icon backgrounds in cards */
html.dark [class*="rounded-full"][class*="bg-indigo-100"],
html.dark [class*="rounded-lg"][class*="bg-indigo-100"],
html.dark [class*="rounded-lg"][class*="bg-green-100"],
html.dark [class*="rounded-lg"][class*="bg-sky-100"],
html.dark [class*="rounded-lg"][class*="bg-amber-100"],
html.dark [class*="rounded-lg"][class*="bg-emerald-100"],
html.dark [class*="rounded-full"][class*="bg-indigo-100"],
html.dark [class*="rounded-full"][class*="bg-green-100"],
html.dark [class*="rounded-full"][class*="bg-sky-100"] {
  background-color: #1e293b !important;
}

/* Chat message bot background */
html.dark .ai-chat-window .w-8.h-8.rounded-full.bg-indigo-100 {
  background-color: #312e81 !important;
}

/* Border colors */
html.dark .border-indigo-200,
html.dark .border-slate-200 {
  border-color: #334155;
}

/* Background colors for icons */
html.dark .bg-indigo-100,
html.dark .bg-green-100,
html.dark .bg-sky-100,
html.dark .bg-amber-100,
html.dark .bg-cyan-100,
html.dark .bg-rose-100 {
  background-color: #1e293b !important;
}

/* Icon colors inside colored backgrounds */
html.dark .bg-indigo-100 .text-indigo-600,
html.dark .bg-green-100 .text-green-600,
html.dark .bg-sky-100 .text-sky-600,
html.dark .bg-amber-100 .text-amber-600,
html.dark .bg-cyan-100 .text-cyan-600,
html.dark .bg-rose-100 .text-rose-600 {
  color: #818cf8 !important;
}

html.dark .bg-green-100 .text-green-600 {
  color: #4ade80 !important;
}

html.dark .bg-sky-100 .text-sky-600 {
  color: #38bdf8 !important;
}

/* Back to top button */
html.dark #back-to-top {
  background: linear-gradient(135deg, #818cf8 0%, #a78bfa 50%, #f472b6 100%);
  color: white;
}

/* Chat widget */
html.dark .ai-chat-window {
  background: #1a1a2e;
  border-color: #334155;
}

html.dark .ai-chat-messages {
  background: #0c0c14;
}

html.dark .ai-chat-input {
  background: #1a1a2e;
  border-color: #334155;
}

html.dark .ai-chat-input input {
  background: #0c0c14;
  border-color: #334155;
  color: #e2e8f0;
}

html.dark .ai-chat-input input::placeholder {
  color: #64748b;
}

html.dark .ai-chat-button {
  background: linear-gradient(135deg, #818cf8 0%, #a78bfa 50%, #f472b6 100%);
}

/* Footer */
html.dark footer {
  background: #13131f;
  border-color: #334155;
}

html.dark .footer-column-title {
  color: #e2e8f0;
}

html.dark .footer-link {
  color: #94a3b8;
}

html.dark .footer-link:hover {
  color: #818cf8;
}

html.dark .footer-social-icon {
  background: #1e293b;
  border-color: #334155;
}

html.dark .footer-social-icon i {
  color: #94a3b8;
}

html.dark .footer-social-icon:hover {
  background: linear-gradient(135deg, #818cf8 0%, #a78bfa 50%, #f472b6 100%);
}

html.dark .footer-social-icon:hover i {
  color: white;
}

/* All Font Awesome icons */
html.dark i.fa,
html.dark i.fas,
html.dark i.far,
html.dark i.fab,
html.dark i.fal,
html.dark i.fad {
  color: #94a3b8;
}

html.dark .fa-envelope,
html.dark .fa-phone,
html.dark .fa-map-marker-alt,
html.dark .fa-globe {
  color: #94a3b8;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--bg-base);
}

body {
  font-family: var(--font-primary);
  background: var(--bg-base);
  color: var(--text-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.4s ease, color 0.4s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  color: var(--text-heading);
  line-height: 1.2;
  font-weight: 700;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== MOBILE LAYOUT FIXES ===== */
/* Prevent horizontal overflow */
html,
body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Section containers */
section {
  max-width: 100%;
  overflow: hidden;
}

/* About section specific fixes */
#about {
  max-width: 100%;
}

#about .flex {
  max-width: 100%;
}

#about p {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Contact section - let Tailwind handle layout */

/* ===== TYPOGRAPHY ===== */
.font-handwriting {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

/* ===== HEADER ===== */
header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.header-profile-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
  box-shadow: 0 0 0 4px var(--bg-surface), var(--shadow-glow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.header-profile-img:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 0 0 4px var(--bg-surface), 0 8px 30px var(--primary-glow);
}

.header-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (min-width: 768px) {
  .header-name {
    font-size: 1.75rem;
  }
}

/* Nav Links */
.nav-link {
  position: relative;
  padding: 0.625rem 1rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.nav-link:hover {
  color: var(--primary);
  background: rgba(80, 70, 229, 0.08);
}

.nav-link.active {
  color: var(--primary);
  background: rgba(80, 70, 229, 0.12);
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 3px;
}

/* Mobile Menu */
#mobile-menu {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

#mobile-menu .nav-link {
  display: block;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin: 0.25rem 0;
}

/* ===== HERO SECTION ===== */
#home {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 1rem 2rem;
  background: var(--bg-base);
  position: relative;
  overflow: hidden;
}

#home::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background:
    radial-gradient(circle at 20% 20%, rgba(80, 70, 229, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(124, 58, 237, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content-wrapper-index9 {
  width: 100%;
  max-width: 80rem;
  z-index: 10;
  position: relative;
}

/* Hero Glass Card */
.hero-card {
  /* Let Tailwind handle background transparency */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-xl);
}

@media (min-width: 768px) {
  .hero-card {
    padding: 2.5rem 2rem;
  }
}

@media (min-width: 1024px) {
  .hero-card {
    padding: 3rem 2.5rem;
  }
}

/* Profile Image Wrapper */
.profile-wrapper {
  position: relative;
}

.profile-wrapper::before {
  content: '';
  position: absolute;
  inset: -12px;
  background: var(--gradient-primary);
  border-radius: 50%;
  opacity: 0.6;
  filter: blur(30px);
  animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {

  0%,
  100% {
    opacity: 0.4;
    transform: scale(1);
  }

  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

.profile-image {
  position: relative;
  border-radius: 50%;
  border: 5px solid var(--bg-surface);
  box-shadow: var(--shadow-xl);
  transition: transform 0.5s ease;
}

.profile-image:hover {
  transform: scale(1.05);
}

/* ===== SECTIONS ===== */
main>section:not(#home) {
  padding: 3rem 0;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  main>section:not(#home) {
    padding: 4rem 0;
    margin-bottom: 1.5rem;
  }
}

/* ===== CARD SYSTEM ===== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-4px);
}

/* Project Cards */
.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-xl), 0 0 40px var(--primary-glow);
  border-color: var(--primary);
}

.project-image-placeholder {
  background: linear-gradient(135deg, var(--bg-muted) 0%, var(--bg-elevated) 100%);
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.project-image-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.project-card:hover .project-image-placeholder img {
  transform: scale(1.1);
}

/* Experience Cards */
.experience-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

.experience-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 0 4px 4px 0;
}

.experience-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.experience-card ul li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.75rem;
  color: var(--text-body);
}

.experience-card ul li::before {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  left: 0;
  top: 0.2em;
  color: var(--primary);
  font-size: 0.875rem;
}

.achievement-list li::before {
  content: "\f005";
  color: var(--accent);
}

/* Skill Items */
.skill-item-pro {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  transition: all 0.3s ease;
}

.skill-item-pro:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

/* Education/Training Cards */
.education-card,
.training-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  transition: all 0.4s ease;
}

.education-card:hover,
.training-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

/* Interest Items */
.interest-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.interest-item:hover {
  transform: translateY(-8px) scale(1.05);
  border-color: var(--primary);
  box-shadow: 0 16px 40px var(--primary-glow);
}

.interest-item i {
  color: var(--primary);
  transition: transform 0.3s ease;
}

.interest-item:hover i {
  transform: scale(1.2);
}

/* ===== CONTACT SECTION ===== */
#contact {
  position: relative;
  overflow: hidden;
}

#contact h2 {
  color: white;
  -webkit-text-fill-color: white;
}

/* ===== FOOTER ===== */
footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem 2rem;
}

.footer-column-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 1rem;
}

.footer-link {
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: var(--primary);
}

.footer-social-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--primary);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.footer-social-icon:hover {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white;
  transform: translateY(-4px) rotate(5deg);
  box-shadow: var(--shadow-glow);
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--gradient-primary);
  color: white;
  font-weight: 600;
  padding: 1rem 2rem;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px var(--primary-glow);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  color: var(--text-heading);
  font-weight: 600;
  padding: 1rem 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

/* Dark mode button fixes */
html.dark .btn-secondary {
  background: #1a1a2e;
  color: #e2e8f0;
  border-color: #334155;
}

html.dark .btn-secondary:hover {
  border-color: #818cf8;
}

/* Hero section icons and elements */
html.dark .btn-primary i,
html.dark .btn-secondary i,
html.dark .fa-arrow-right,
html.dark .fa-folder-open {
  color: inherit;
}
  box-shadow: var(--shadow-glow);
}

/* ===== ANIMATIONS ===== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-50ms {
  transition-delay: 0.05s;
}

.delay-100ms {
  transition-delay: 0.1s;
}

.delay-150ms {
  transition-delay: 0.15s;
}

.delay-200ms {
  transition-delay: 0.2s;
}

.delay-300ms {
  transition-delay: 0.3s;
}

/* Float Animation */
@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-15px);
  }
}

.animate-float {
  animation: float 5s ease-in-out infinite;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: var(--gradient-primary);
  border-radius: 10px;
  border: 2px solid var(--bg-base);
}

/* ===== AI CHAT WIDGET ===== */
.ai-chat-widget {
  position: fixed;
  bottom: 80px;
  right: 16px;
  z-index: 49;
}

.ai-chat-button {
  background: var(--gradient-primary);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 12px var(--primary-glow);
  transition: all 0.3s ease;
  font-size: 1.125rem;
}

.ai-chat-button:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.ai-chat-window {
  position: fixed;
  bottom: 140px;
  right: 16px;
  width: 300px;
  max-width: calc(100vw - 32px);
  height: 350px;
  max-height: 55vh;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 50;
}

.ai-chat-window.active {
  display: flex;
}

.ai-chat-header {
  background: var(--gradient-primary);
  padding: 0.875rem 1rem;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9375rem;
  font-weight: 600;
}

.ai-chat-header button {
  font-size: 1rem;
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: var(--bg-base);
  font-size: 0.875rem;
  line-height: 1.5;
}

.ai-chat-input {
  border-top: 1px solid var(--border);
  padding: 0.75rem;
  display: flex;
  gap: 0.5rem;
  background: var(--bg-surface);
}

.ai-chat-input input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.625rem 0.875rem;
  color: var(--text-heading);
  font-size: 0.875rem;
}

.ai-chat-input input:focus {
  outline: none;
  border-color: var(--primary);
}

.ai-chat-input button {
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
}

.ai-message {
  margin-bottom: 0.75rem;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.ai-message.user {
  flex-direction: row-reverse;
}

.ai-message-content {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.625rem 0.875rem;
  border-radius: 12px;
  max-width: 85%;
  color: var(--text-body);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.ai-message.user .ai-message-content {
  background: var(--gradient-primary);
  border: none;
  color: white;
}

/* ===== BACK TO TOP ===== */
#back-to-top {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-glow);
  transition: all 0.3s ease;
}

#back-to-top:hover {
  transform: scale(1.15);
  box-shadow: 0 8px 30px var(--primary-glow);
}

/* ===== UTILITIES ===== */
.bg-indigo-100 {
  background: rgba(80, 70, 229, 0.1);
}

.text-indigo-600 {
  color: var(--primary);
}

.text-indigo-700 {
  color: var(--primary-dark);
}

.bg-white {
  background: var(--bg-surface);
}

.text-slate-500 {
  color: var(--text-muted);
}

.text-slate-600 {
  color: var(--text-body);
}

.text-slate-700 {
  color: var(--text-heading);
}

.text-slate-800 {
  color: var(--text-heading);
}

/* ===== RESPONSIVE ===== */

/* Extra small devices (phones, less than 480px) */
@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .section-title {
    font-size: 1.5rem !important;
  }

  .card {
    padding: 1rem !important;
    border-radius: 12px !important;
  }

  .hero-card {
    padding: 1.25rem !important;
    border-radius: 16px !important;
  }

  #home {
    padding: 4.5rem 0.5rem 1.5rem !important;
    min-height: auto;
  }

  .profile-image {
    width: 180px !important;
    height: 180px !important;
  }

  .btn-primary,
  .btn-secondary {
    padding: 0.75rem 1.25rem !important;
    font-size: 0.875rem !important;
  }

  .ai-chat-widget {
    right: 12px;
    bottom: 70px;
  }

  .ai-chat-button {
    width: 46px;
    height: 46px;
    font-size: 1.125rem;
  }

  .ai-chat-window {
    width: 280px;
    max-width: calc(100vw - 24px);
    right: 12px;
    left: auto;
    bottom: 125px;
    height: 320px;
    max-height: 55vh;
    border-radius: 10px;
  }

  .ai-chat-header {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
  }

  .ai-chat-header button {
    font-size: 0.875rem;
  }

  .ai-chat-messages {
    padding: 0.75rem;
    font-size: 0.8125rem;
  }

  .ai-chat-input {
    padding: 0.5rem 0.625rem;
    gap: 0.5rem;
  }

  .ai-chat-input input {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: 6px;
  }

  .ai-chat-input button {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }

  .ai-message {
    margin-bottom: 0.625rem;
    gap: 0.375rem;
  }

  .ai-message-content {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: 8px;
  }
}

/* Small devices (phones, 481px to 640px) */
@media (min-width: 481px) and (max-width: 640px) {
  .hero-card {
    padding: 1.5rem !important;
  }

  #home {
    padding: 6rem 1rem 3rem;
  }

  .ai-chat-window {
    width: calc(100vw - 28px);
    right: 14px;
    bottom: 130px;
    height: 340px;
  }

  .ai-chat-widget {
    right: 14px;
    bottom: 70px;
  }
}

/* Medium devices (tablets, 641px to 768px) */
@media (min-width: 641px) and (max-width: 768px) {
  .hero-card {
    padding: 2rem !important;
  }

  #home {
    padding: 7rem 1.5rem 3rem;
  }
}

/* Large devices (desktops, 769px and up) */
@media (min-width: 769px) {
  .hero-card {
    padding: 3rem;
  }
}

/* Very large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .hero-card {
    padding: 4rem;
  }
}

/* Ensure text wraps properly on all screens */
p,
span,
a,
li,
label {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Fix for long email addresses on mobile */
a[href^="mailto:"],
a[href^="tel:"] {
  word-break: break-all;
}

/* Forms - let Tailwind handle responsive behavior */

/* ===== PRINT ===== */
@media print {

  .no-print,
  #contact,
  #back-to-top,
  .ai-chat-widget,
  .ai-chat-window {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }
}

/* ===== MOBILE SAFETY FOR CONTACT SECTION ===== */
@media (max-width: 480px) {
  #contact {
    /* Prevents the section from being wider than the phone screen */
    width: 100% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  #contact form {
    /* Ensures the form fits inside the padding */
    width: 100% !important;
    padding: 1.25rem !important;
    /* p-5 equivalent */
  }

  /* Fixes text going off-screen */
  #contact p,
  #contact span,
  #contact a {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }
}