/* ==========================================================================
   SAKHAWAT HOSSAIN - PORTFOLIO DESIGN SYSTEM & STYLES
   Role: Backend Software Engineer (Laravel, PHP, AWS)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Dark Mode Default Palette */
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-card: rgba(17, 24, 39, 0.8);
  --bg-card-hover: rgba(30, 41, 59, 0.9);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-primary: #6366f1; /* Indigo */
  --accent-secondary: #06b6d4; /* Cyan */
  --accent-emerald: #10b981; /* Emerald */
  --accent-amber: #f59e0b; /* Amber */
  --accent-purple: #a855f7;
  
  --gradient-brand: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  
  --header-height: 72px;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --border-subtle: #e2e8f0;
  --border-focus: #6366f1;
  
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  
  --gradient-brand: linear-gradient(135deg, #4f46e5 0%, #0891b2 100%);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.15);
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.06);
}

/* Base Elements */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.25s ease, color 0.25s ease;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
}

[data-theme="light"] body {
  background-color: #f8fafc;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.04) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.04) 0px, transparent 50%);
}

/* Typography & Links */
.font-mono {
  font-family: var(--font-mono);
}

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

/* Glassmorphism & Panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  box-shadow: var(--shadow-card);
}

[data-theme="light"] .glass-panel {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

.glass-nav {
  background: rgba(9, 13, 22, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

[data-theme="light"] .glass-nav {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #e2e8f0;
}

.glass-footer {
  background: rgba(9, 13, 22, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

[data-theme="light"] .glass-footer {
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid #e2e8f0;
}

/* Brand Logo & Typography */
.brand-emblem {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.brand-emblem:hover {
  transform: scale(1.08) rotate(-2deg);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.6);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--text-primary);
}

.brand-subtitle {
  font-size: 0.725rem;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #818cf8;
}

[data-theme="light"] .brand-subtitle {
  color: #4f46e5;
}

/* Navbar Links */
.nav-link {
  position: relative;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  transition: color 0.2s ease;
}

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

[data-theme="light"] .nav-link {
  color: #475569;
}

[data-theme="light"] .nav-link:hover,
[data-theme="light"] .nav-link.active {
  color: #4f46e5;
}

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

/* Mobile Dropdown & Links */
#mobile-menu {
  width: 100%;
  border-top: 1px solid var(--border-subtle);
  background: rgba(9, 13, 22, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.5);
  animation: mobileMenuSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes mobileMenuSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-theme="light"] #mobile-menu {
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.1);
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.95rem;
  color: #cbd5e1;
  transition: all 0.15s ease;
}

.mobile-nav-link:hover, .mobile-nav-link.active {
  color: #ffffff;
  background: rgba(99, 102, 241, 0.15);
}

.mobile-nav-link.active {
  color: #818cf8;
  font-weight: 600;
}

[data-theme="light"] .mobile-nav-link {
  color: #334155;
}

[data-theme="light"] .mobile-nav-link:hover,
[data-theme="light"] .mobile-nav-link.active {
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.08);
}

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

/* Badges */
.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.825rem;
  font-weight: 500;
  font-family: var(--font-mono);
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.1);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
  transition: all 0.2s ease;
}

.tech-badge:hover {
  background: rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
}

.tech-badge-emerald {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.25);
}

.tech-badge-cyan {
  background: rgba(6, 182, 212, 0.1);
  color: #22d3ee;
  border-color: rgba(6, 182, 212, 0.25);
}

.tech-badge-amber {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.25);
}

.tech-badge-purple {
  background: rgba(168, 85, 247, 0.1);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.25);
}

/* Light Theme Badges */
[data-theme="light"] .tech-badge {
  background: rgba(79, 70, 229, 0.08);
  color: #4338ca;
  border-color: rgba(79, 70, 229, 0.25);
}

[data-theme="light"] .tech-badge-emerald {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="light"] .tech-badge-cyan {
  background: rgba(6, 182, 212, 0.1);
  color: #0e7490;
  border-color: rgba(6, 182, 212, 0.3);
}

[data-theme="light"] .tech-badge-amber {
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.3);
}

[data-theme="light"] .tech-badge-purple {
  background: rgba(168, 85, 247, 0.1);
  color: #7e22ce;
  border-color: rgba(168, 85, 247, 0.3);
}

/* Cards & Hover Effects */
.interactive-card {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.interactive-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-focus);
  box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.3), 0 0 15px rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .interactive-card:hover {
  box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.1), 0 0 15px rgba(99, 102, 241, 0.1);
  border-color: #6366f1;
}

/* Pulse Beacon */
.status-beacon {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 0.85rem;
  font-weight: 500;
}

[data-theme="light"] .status-beacon {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #065f46;
  font-weight: 600;
}

.beacon-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  position: relative;
}

.beacon-dot::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: #10b981;
  border-radius: 50%;
  animation: pulse-ring 1.8s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff !important;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
  transition: all 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
  color: #ffffff !important;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-subtle);
  transition: all 0.25s ease;
}

[data-theme="light"] .btn-secondary {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-focus);
  transform: translateY(-2px);
}

[data-theme="light"] .btn-secondary:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

/* Mobile & Tablet Specific Responsive Overrides */
@media (max-width: 640px) {
  .brand-emblem {
    width: 36px;
    height: 36px;
    font-size: 0.875rem;
    border-radius: 10px;
  }
  
  .brand-title {
    font-size: 1.05rem;
  }
  
  .brand-subtitle {
    font-size: 0.625rem;
  }
  
  .status-beacon {
    font-size: 0.75rem;
    padding: 0.25rem 0.65rem;
    gap: 0.35rem;
  }
  
  .tech-badge {
    font-size: 0.725rem;
    padding: 0.22rem 0.55rem;
    gap: 0.25rem;
  }
  
  .btn-primary, .btn-secondary {
    padding: 0.6rem 1.1rem;
    font-size: 0.875rem;
    border-radius: 0.625rem;
  }
  
  .glass-panel {
    border-radius: 0.75rem;
  }
}

/* Timeline */
.timeline-item {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid var(--border-subtle);
}

[data-theme="light"] .timeline-item {
  border-left-color: #cbd5e1;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-primary);
}

/* Project Filter Tabs */
.filter-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
}

@media (max-width: 640px) {
  .filter-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
  }
}

[data-theme="light"] .filter-btn {
  color: #475569;
  border-color: #cbd5e1;
  background: #ffffff;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--accent-primary);
  color: #ffffff !important;
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

/* Toast Notification */
#toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #10b981;
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 100;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 640px) {
  #toast {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: calc(100% - 2rem);
    justify-content: center;
    font-size: 0.85rem;
    padding: 0.65rem 1rem;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}

/* Resume Paper Simulation & Print Styles */
.resume-paper {
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border-radius: 0.75rem;
}

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .no-print {
    display: none !important;
  }
  .resume-paper {
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }
}

/* ==========================================================================
   LIGHT THEME COMPLETE CONTRAST & LEGIBILITY OVERRIDES
   Ensures zero washed-out text, crisp contrast, clean borders & surfaces
   ========================================================================== */

[data-theme="light"] .text-white {
  color: #0f172a !important;
}

[data-theme="light"] .text-gray-200 {
  color: #1e293b !important;
}

[data-theme="light"] .text-gray-300 {
  color: #334155 !important;
}

[data-theme="light"] .text-gray-400 {
  color: #475569 !important;
}

[data-theme="light"] .text-gray-500 {
  color: #64748b !important;
}

[data-theme="light"] .text-indigo-400 {
  color: #4f46e5 !important;
}

[data-theme="light"] .text-cyan-400 {
  color: #0891b2 !important;
}

[data-theme="light"] .text-emerald-400 {
  color: #059669 !important;
}

[data-theme="light"] .text-amber-400 {
  color: #d97706 !important;
}

[data-theme="light"] .text-purple-400 {
  color: #9333ea !important;
}

[data-theme="light"] .border-white\/10,
[data-theme="light"] .border-white\/5,
[data-theme="light"] .border-white\/20,
[data-theme="light"] .border-white\/30 {
  border-color: #e2e8f0 !important;
}

[data-theme="light"] .bg-white\/\[0\.02\],
[data-theme="light"] .bg-white\/\[0\.05\],
[data-theme="light"] .bg-white\/5 {
  background-color: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .bg-black\/10,
[data-theme="light"] .bg-black\/20,
[data-theme="light"] .bg-black\/30 {
  background-color: #f1f5f9 !important;
}

[data-theme="light"] .bg-black\/40 {
  background-color: #ffffff !important;
}

/* Light Theme Inputs & Form Controls */
[data-theme="light"] input,
[data-theme="light"] textarea {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] input:focus,
[data-theme="light"] textarea:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
  color: #94a3b8 !important;
}

/* Hero Terminal Card Styling (Keep crisp dark code terminal look in both themes) */
.terminal-card {
  background: #0f172a !important;
  border: 1px solid #1e293b !important;
}
.terminal-card * {
  color: inherit;
}
.terminal-card .text-emerald-400 { color: #34d399 !important; }
.terminal-card .text-amber-300 { color: #fcd34d !important; }
.terminal-card .text-cyan-300 { color: #67e8f9 !important; }
.terminal-card .text-cyan-400 { color: #22d3ee !important; }
.terminal-card .text-indigo-400 { color: #818cf8 !important; }
.terminal-card .text-indigo-300 { color: #a5b4fc !important; }
.terminal-card .text-green-400 { color: #4ade80 !important; }
.terminal-card .text-gray-300 { color: #cbd5e1 !important; }
.terminal-card .text-gray-400 { color: #94a3b8 !important; }

/* Theme Toggle Button */
.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}
[data-theme="light"] .theme-toggle-btn {
  background: #f1f5f9;
  border-color: #cbd5e1 !important;
}
