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

/* 
  ===========================================
  Theme Variables & Configuration
  ===========================================
  Define the core color palette. Using a dark, "GitHub-inspired" theme
  with a splash of blue for that calm, coding-at-night vibe.
*/
:root {
  --bg-dark: #0d1117;
  --bg-darker: #010409;
  --bg-card: #161b22;
  --text-main: #c9d1d9;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-glow: rgba(88, 166, 255, 0.3);
  --border: #30363d;
  --terminal-bg: #0d0d0d;
  --terminal-header: #2d2d2d;
  --success: #2ea043;
  --danger: #da3633;
}

/* Bootstrap Theme Overrides - Force Dark Mode */
[data-bs-theme="dark"] {
  --bs-body-bg: var(--bg-dark);
  --bs-body-color: var(--text-main);
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  /* Use JetBrains Mono for everything - because code is life */
  font-family: 'JetBrains Mono', monospace;
  overflow-x: hidden;
}

/* 
  Custom Scrollbar 
  Make it slim and match the dark theme.
*/
::-webkit-scrollbar {
  width: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 5px;
}

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

/* Typography Tweaks */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: #ffffff;
  font-weight: 700;
}

/* Utility Classes */
.text-accent {
  color: var(--accent) !important;
}

.text-light-muted {
  color: var(--text-muted) !important;
}

.bg-darker {
  background-color: var(--bg-card) !important;
}

/* 
  Navigation Bar
  Glassmorphism effect for a modern touch.
*/
.navbar {
  background-color: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.navbar-brand {
  font-weight: 700;
  color: #fff !important;
}

.nav-link {
  color: var(--text-main) !important;
  transition: color 0.3s;
}

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

.navbar-toggler {
  border-color: var(--border);
}

/* 
  Hero Section - The Landing
*/
.hero {
  position: relative;
  padding-top: 60px;
}

.code-block {
  border: 1px solid var(--border);
  font-size: 0.9rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Terminal Colors */
.text-purple {
  color: #d2a8ff;
}

.text-blue {
  color: #79c0ff;
}

.text-green {
  color: #7ee787;
}

/* 
  Button Styles
  Primary accent buttons and outline variants with hover glow effects.
*/
.btn-accent {
  background-color: var(--accent);
  color: #000;
  border: 1px solid var(--accent);
  font-weight: 600;
}

.btn-accent:hover {
  background-color: transparent;
  color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.btn-outline-accent {
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-outline-accent:hover {
  background-color: var(--accent);
  color: #000;
}

/* 
  Section Titles
  Underline effect using pseudo-element.
*/
.section-title {
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: var(--accent);
  margin-top: 10px;
}

/* 
  Tech Stack Cards
  Simple grid items that pop on hover.
*/
.tech-card {
  background-color: var(--bg-card);
  border-color: var(--border) !important;
  transition: transform 0.1s, border-color 0.1s, box-shadow 0.1s;
}

.tech-card:hover {
  transform: scale(1.05);
  border-color: var(--accent) !important;
  box-shadow: 0 0 25px var(--accent);
}

/* 
  The Interactive Terminal
  Styled to look like a real Ubuntu/Linux terminal window.
*/
.terminal-window {
  background-color: var(--terminal-bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  font-family: 'Courier New', Courier, monospace;
  min-height: 300px;
}

.terminal-header {
  background-color: var(--terminal-header);
  border-bottom: 1px solid #333;
}

.btn-circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-body {
  color: #ccc;
  height: 300px;
  overflow-y: auto;
}

#terminal-input:focus {
  outline: none;
  box-shadow: none;
}

/* 
  Project Cards
  Standard card layout with hover lift effect.
*/
.card {
  transition: transform 0.1s, border-color 0.1s, box-shadow 0.1s;
}

.card:hover {
  transform: scale(1.05);
  border-color: var(--accent) !important;
  box-shadow: 0 0 25px var(--accent);
}

/* 
  Boot Sequence Preloader
  Full screen overlay that mimics a system boot.
*/
#preloader.split-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: #0b0e14; /* Darker technical base */
  background-image: 
    linear-gradient(rgba(88, 166, 255, 0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 166, 255, 0.10) 1px, transparent 1px);
  background-size: 25px 25px;
  background-position: center;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

.loader-brand {
  position: absolute;
  top: 30px;
  left: 40px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--text-main);
  font-size: 1.2rem;
  letter-spacing: 1px;
  z-index: 10;
}

.loader-content {
  flex-grow: 1;
}

/* Glowing Arc Divider */
.loader-arc {
  position: absolute;
  top: 50%;
  left: 10vw;
  /* Arc starts 10% from left, taking 40% width so its right edge perfectly hits the 50% split */
  transform: translateY(-50%);
  width: 40vw;
  height: 140vh;
  /* Extremely tall for a gentle curve */
  border-radius: 50%;
  border-right: 2px solid rgba(88, 166, 255, 0.8);
  pointer-events: none;
  z-index: 1;
}

/* Physically draw the blur ONLY on the right side using a pseudo element */
.loader-arc::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: 50%;
  border-right: 8px solid rgba(88, 166, 255, 0.5);
  filter: blur(12px);
  transform: translateX(6px);
}

/* Sci-Fi Terminal Box */
.sci-fi-box-wrapper {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.4), rgba(88, 166, 255, 0.1));
  padding: 1px;
  /* border thickness */
  clip-path: polygon(25px 0, 100% 0,
      100% calc(100% - 25px), calc(100% - 25px) 100%,
      0 100%, 0 25px);
  filter: drop-shadow(0 0 10px rgba(88, 166, 255, 0.2));
  width: 100%;
  max-width: 380px;
  /* SHRUNK FURTHER from 450px */
}

.sci-fi-box {
  background: rgba(13, 17, 23, 0.9);
  padding: 1.5rem 1.5rem;
  /* Increased vertical padding */
  clip-path: polygon(25px 0, 100% 0,
      100% calc(100% - 25px), calc(100% - 25px) 100%,
      0 100%, 0 25px);
  min-height: 240px;
  /* INCREASED to fit spaced out lines */
}

.sci-fi-dots {
  position: absolute;
  top: 8px;
  right: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.4);
  font-family: inherit;
  font-size: 0.75rem;
}

/* Reusing .terminal-body for the text */
.terminal-body {
  color: var(--text-main);
  font-size: 0.9rem; /* Increased slightly for better legibility */
  line-height: 2.2; /* Spaced out for readability */
  text-align: left;
}

.terminal-body .text-success {
  color: var(--success) !important;
}

.loader-countdown {
  font-size: clamp(4rem, 10vw, 10rem);
  font-weight: 700;
  color: var(--text-main);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
}

.loader-countdown span {
  color: var(--accent);
}

/* 
  Scroll Animation Classes
  Elements fade in and slide up as you scroll down.
*/
.hidden-element {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.hidden-element.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger Utilities - for when we want things to appear one by one */
.delay-100 {
  transition-delay: 0.1s;
}

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

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

/* Blinking Cursor Animation */
.cursor {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .display-3 {
    font-size: 2.5rem;
  }

  /* Split Preloader Mobile Tweaks - Terminal & Sequence only */
  #preloader.split-loader .row {
    flex-direction: column !important;
    justify-content: center !important;
    gap: 6rem !important;
  }

  .loader-arc,
  .loader-arc::after {
    display: none !important;
  }

  .loader-brand {
    top: 25px !important;
    left: 25px !important;
    font-size: 1rem !important;
    z-index: 20 !important;
  }

  .sci-fi-box-wrapper {
    max-width: 85% !important;
    /* slightly slimmer for mobile */
    margin: 0 auto;
    transform: translateY(-20px);
    /* PUSH UP slightly */
  }

  .loader-countdown {
    font-size: clamp(3rem, 15vw, 6rem) !important;
    transform: translateY(20px);
    /* PUSH DOWN slightly */
  }
}

/* 
  Certificate Gallery
  Grid of images that expand when needed.
*/
.cert-card {
  transition: transform 0.3s, border-color 0.3s;
  cursor: pointer;
  max-width: 300px;
  margin: 0 auto;
}

.cert-card img {
  height: 200px;
  object-fit: cover;
}

.cert-card:hover {
  transform: scale(1.05);
  border-color: var(--accent) !important;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Contact Form Input Styles */
.form-control:focus,
.input-group-text {
  border-color: var(--accent) !important;
  box-shadow: none;
}

/* Social Icon Buttons */
.social-links .btn-outline-light:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #000;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px var(--accent-glow);
}

.social-links .btn-outline-light {
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Disclaimer Modal Customization */
.modal-disclaimer-content {
  background: linear-gradient(135deg, #042749 0%, #084c96 100%);
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border-radius: 1rem;
  border: 1px solid var(--accent);
}

.pin-icon {
  transform: rotate(45deg);
  color: var(--accent) !important;
}

.hover-accent:hover {
  color: var(--accent) !important;
}

/* Available for Work Badge */
.available-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background-color: rgba(46, 160, 67, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
  padding: 8px 16px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 0 15px rgba(46, 160, 67, 0.2);
  transition: all 0.3s ease;
}

.available-badge:hover {
  background-color: rgba(46, 160, 67, 0.2);
  box-shadow: 0 0 20px rgba(46, 160, 67, 0.4);
  transform: translateY(-2px);
}

.status-indicator {
  width: 10px;
  height: 10px;
  background-color: var(--success);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--success);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 160, 67, 0.7);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(46, 160, 67, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(46, 160, 67, 0);
  }
}

/* Custom Tooltip Styling */
.custom-tooltip {
  --bs-tooltip-bg: var(--bg-card);
  --bs-tooltip-color: var(--accent);
  --bs-tooltip-opacity: 1;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  border: 1px solid var(--accent);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  font-size: 0.9rem;
}