/* ==========================================================================
   DEVELOPER PORTFOLIO - MODERN STYLESHEET
   Using CSS Custom Variables, Glassmorphism, Responsive Grid & Dark/Light Mode
   ========================================================================== */

/* --- Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* --- Root & Color System --- */
:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-code: 'Fira Code', monospace;

  /* Theme Accents */
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --secondary-color: #ec4899;
  --accent-teal: #14b8a6;
  --accent-amber: #f59e0b;

  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --gradient-glow: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(236, 72, 153, 0.15));
  --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);

  --transition-speed: 0.3s;
  --transition-curve: cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius-lg: 20px;
  --border-radius-md: 14px;
  --border-radius-sm: 8px;
}

/* --- Dark Mode Variables (Default) --- */
[data-bs-theme="dark"] {
  --bg-body: #0b0f19;
  --bg-surface: #111827;
  --bg-surface-elevated: #1f293d;
  --glass-bg: rgba(17, 24, 39, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(99, 102, 241, 0.4);

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-inverse: #0f172a;

  --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --glow-shadow: 0 0 25px rgba(99, 102, 241, 0.25);
  --nav-bg: rgba(11, 15, 25, 0.85);
}

/* --- Light Mode Variables --- */
[data-bs-theme="light"] {
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-border-hover: rgba(99, 102, 241, 0.5);

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --card-shadow: 0 10px 30px -10px rgba(148, 163, 184, 0.2);
  --glow-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
  --nav-bg: rgba(248, 250, 252, 0.85);
}

/* --- Global Reset & Typography --- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  overflow-x: hidden;
  transition: background-color var(--transition-speed) var(--transition-curve), color var(--transition-speed) var(--transition-curve);
}

/* Background Ambient Orbs */
.bg-ambient-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
}

.ambient-orb-1 {
  top: -10%;
  left: -5%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
}

.ambient-orb-2 {
  bottom: 10%;
  right: -5%;
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, #ec4899 0%, transparent 70%);
}

.ambient-orb-3 {
  top: 45%;
  left: 30%;
  width: 35vw;
  height: 35vw;
  background: radial-gradient(circle, #14b8a6 0%, transparent 70%);
  opacity: 0.2;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* --- Gradient Text Utility --- */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.font-code {
  font-family: var(--font-code);
}

/* --- Navbar Styling --- */
.navbar-custom {
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  transition: all var(--transition-speed) ease;
  z-index: 1030;
}

.navbar-brand {
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.5px;
}

.navbar-brand .code-tag {
  color: var(--primary-color);
}

.nav-link {
  color: var(--text-muted) !important;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 1rem !important;
  transition: color var(--transition-speed) ease;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-main) !important;
}

.nav-link.active::after,
.nav-link:hover::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.theme-toggle-btn:hover {
  border-color: var(--primary-color);
  box-shadow: var(--glow-shadow);
  transform: rotate(15deg);
}

/* --- Section Styling --- */
section {
  padding: 100px 0;
  position: relative;
}

.section-subtitle {
  color: var(--primary-color);
  font-family: var(--font-code);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: block;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .section-title {
    font-size: 2rem;
  }
}

/* Glassmorphism Card Base */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--card-shadow);
  transition: transform var(--transition-speed) var(--transition-curve), border-color var(--transition-speed) var(--transition-curve), box-shadow var(--transition-speed) var(--transition-curve);
}

.glass-card:hover {
  border-color: var(--glass-border-hover);
  box-shadow: var(--glow-shadow);
}

/* --- Hero Section --- */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 130px;
  padding-bottom: 80px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 30px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--primary-color);
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero-badge .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-teal);
  box-shadow: 0 0 10px var(--accent-teal);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(20, 184, 166, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(20, 184, 166, 0); }
}

.hero-heading {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

@media (max-width: 992px) {
  .hero-heading {
    font-size: 2.8rem;
  }
}

@media (max-width: 576px) {
  .hero-heading {
    font-size: 2.2rem;
  }
}

.hero-lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 600px;
}

/* Typing Cursor */
.typed-cursor {
  font-weight: 400;
  color: var(--primary-color);
  animation: blink 0.7s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Hero Avatar Container */
.hero-avatar-wrapper {
  position: relative;
  display: inline-block;
}

.hero-avatar-ring {
  position: absolute;
  top: -12px;
  left: -12px;
  right: -12px;
  bottom: -12px;
  border-radius: 50%;
  background: var(--gradient-primary);
  z-index: -1;
  filter: blur(15px);
  opacity: 0.6;
  animation: pulseGlow 4s infinite alternate;
}

@keyframes pulseGlow {
  0% { transform: scale(0.98); opacity: 0.5; }
  100% { transform: scale(1.03); opacity: 0.8; }
}

.hero-avatar-img {
  width: 320px;
  height: 320px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--bg-surface);
  box-shadow: var(--card-shadow);
}

@media (max-width: 992px) {
  .hero-avatar-img {
    width: 240px;
    height: 240px;
  }
}

/* Floating Code Snippet Card */
.floating-code-card {
  position: absolute;
  bottom: -20px;
  right: -20px;
  padding: 14px 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  box-shadow: var(--card-shadow);
  font-family: var(--font-code);
  font-size: 0.82rem;
  color: var(--text-main);
  animation: floatCard 4s ease-in-out infinite;
}

@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Social Icon Buttons */
.btn-social {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all var(--transition-speed) ease;
}

.btn-social:hover {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
  transform: translateY(-4px);
  box-shadow: var(--glow-shadow);
}

/* --- Buttons --- */
.btn-gradient {
  background: var(--gradient-primary);
  color: #ffffff !important;
  border: none;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 30px;
  transition: all var(--transition-speed) ease;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
  color: #ffffff;
}

.btn-outline-custom {
  background: transparent;
  color: var(--text-main);
  border: 1.5px solid var(--glass-border);
  font-weight: 600;
  padding: 11px 26px;
  border-radius: 30px;
  transition: all var(--transition-speed) ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-outline-custom:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(99, 102, 241, 0.08);
  transform: translateY(-2px);
}

/* --- About & Stats --- */
.stat-box {
  padding: 24px;
  text-align: center;
}

.stat-number {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;

}

/* --- Skills Section --- */
.skill-card {
  padding: 24px;
  height: 100%;
}

.skill-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1.2rem;
}

.skill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--glass-border);
  font-size: 0.85rem;
  font-weight: 500;
  margin: 4px;
  transition: all var(--transition-speed) ease;
}

.skill-badge:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
}

/* --- Projects Section & Filters --- */
.portfolio-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.filter-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  padding: 8px 22px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
  box-shadow: var(--glow-shadow);
}

.project-card {
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.project-img-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
  height: 220px;
}

.project-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-img-wrapper img {
  transform: scale(1.08);
}

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  transition: opacity var(--transition-speed) ease;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-body {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-tag {
  color: var(--primary-color);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
}

.project-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.project-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 1.2rem;
  flex-grow: 1;
}

.tech-stack-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tech-badge {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-color);
  font-weight: 600;
}

/* --- Timeline Section --- */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--glass-border);
  transform: translateX(-50%);
}

@media (max-width: 768px) {
  .timeline::before {
    left: 20px;
  }
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
  width: 50%;
  padding-right: 40px;
}

.timeline-item:nth-child(even) {
  left: 50%;
  padding-right: 0;
  padding-left: 40px;
}

@media (max-width: 768px) {
  .timeline-item,
  .timeline-item:nth-child(even) {
    width: 100%;
    left: 0;
    padding-left: 50px;
    padding-right: 0;
  }
}

.timeline-dot {
  position: absolute;
  top: 20px;
  right: -10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  border: 4px solid var(--bg-body);
  box-shadow: 0 0 10px var(--primary-color);
  z-index: 2;
}

.timeline-item:nth-child(even) .timeline-dot {
  right: auto;
  left: -10px;
}

@media (max-width: 768px) {
  .timeline-dot,
  .timeline-item:nth-child(even) .timeline-dot {
    left: 10px;
  }
}

.timeline-content {
  padding: 24px;
}

.timeline-date {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-color);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
}

/* --- Contact Section --- */
.form-control-custom {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  color: var(--text-main);
  padding: 14px 18px;
  font-size: 0.95rem;
  transition: all var(--transition-speed) ease;
}

.form-control-custom:focus {
  background: var(--bg-surface-elevated);
  border-color: var(--primary-color);
  color: var(--text-main);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
  outline: none;
}

.contact-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

/* --- Footer --- */
footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--glass-border);
  padding: 40px 0 20px;
}

.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: var(--glow-shadow);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-speed) ease;
  z-index: 1000;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-5px);
  background: var(--primary-hover);
}

/* --- Modal Custom --- */
.modal-content-custom {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  color: var(--text-main);
}
