/* Cyberpunk/Retro-Gaming Portfolio - Custom CSS */
:root {
  --bg-dark: #000000;
  --card: #0a0a0a;
  --accent: #64FFDA;
  --pink: rgba(255, 46, 46, 0.6);
  --pink-hover: rgba(255, 46, 46, 0.8);
  --white: #FFFFFF;
  --glow-purple: #64FFDA;
  --glow-red: #FF2E2E;
}

/* Smooth scroll with offset for fixed navbar */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
  overflow-x: hidden;
  max-width: 100vw;
}

/* Pixel-art background texture */
body {
  font-family: 'Bahnschrift', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #000000;
  color: #FFFFFF;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(100, 255, 218, 0.03) 2px, rgba(100, 255, 218, 0.03) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(100, 255, 218, 0.03) 2px, rgba(100, 255, 218, 0.03) 4px);
  background-size: 4px 4px;
  overflow-x: hidden;
  max-width: 100vw;
}

/* Prevent width change when modal opens */
body.modal-open {
  overflow: hidden !important;
  padding-right: 0 !important;
}

.modal-open .navbar,
.modal-open .fixed-top {
  padding-right: 0 !important;
}

/* Prevent horizontal overflow from Bootstrap rows and containers */
* {
  box-sizing: border-box;
}

.container, .container-fluid {
  max-width: 100%;
}

.row {
  margin-left: 0;
  margin-right: 0;
  max-width: 100%;
}

/* Ensure column content doesn't overflow */
[class*="col-"] {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.bahnschrift {
  font-family: 'Bahnschrift', sans-serif;
}

/* Monospace */
.mono {
  font-family: 'Courier New', Courier, monospace;
}

/* Bold italic class for header labels (prefixed .) with neon glow */
.andrei-moldovean, .about-me, .project-name, .skills, .retro-futurism, .contact-info, .social-media, .ui-ux-design {
  font-weight: 700;
  font-style: italic;
  color: #B794F4;
  text-shadow: 0 0 5px rgba(183, 148, 244, 0.5);
}

/* Flickering animation for main header */
.andrei-moldovean {
  animation: flicker 3s infinite alternate;
}

@keyframes flicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% {
    text-shadow: 0 0 8px rgba(183, 148, 244, 0.6);
    opacity: 1;
  }
  20%, 24%, 55% {
    text-shadow: 0 0 4px rgba(183, 148, 244, 0.3);
    opacity: 0.95;
  }
}

/* Code-style labels */
.unity, .unreal-engine, .photoshop, .figma, .blender, .python,
.skill-item {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  color: var(--pink);
  background: none;
  border: none;
  padding: 0;
  transition: text-shadow 0.3s ease;
}

.unity:hover, .unreal-engine:hover, .photoshop:hover, .figma:hover, .blender:hover, .python:hover,
.skill-item:hover {
  text-shadow: 0 0 2px rgba(255, 46, 46, 0.8);
}

/* Navbar */
.navbar {
  background-color: rgba(0, 0, 0, 0.95) !important;
  border-bottom: 1px solid rgba(183, 148, 244, 0.5);
  box-shadow: 0 2px 10px rgba(183, 148, 244, 0.2);
}

.navbar .container {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 1200px) {
  .navbar .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (min-width: 1920px) {
  .navbar .container {
    padding-left: 4rem;
    padding-right: 4rem;
  }
}

.navbar .nav-link, .navbar-brand {
  font-family: 'Courier New', monospace;
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #B794F4 !important;
  position: relative;
  transition: all 0.3s ease;
}

.navbar-brand {
  font-size: clamp(0.7rem, 4vw, 0.9rem);
  white-space: nowrap;
  overflow: visible;
  padding-right: 0.25rem;
  max-width: none;
  flex-shrink: 1;
  min-width: 0;
}

@media (min-width: 360px) {
  .navbar-brand {
    font-size: clamp(0.85rem, 4vw, 1rem);
  }
}

@media (min-width: 380px) {
  .navbar-brand {
    font-size: 1.1rem;
  }
}

@media (min-width: 450px) {
  .navbar-brand {
    font-size: 1.2rem;
  }
}

@media (min-width: 576px) {
  .navbar-brand {
    font-size: 1.25rem;
  }
}

@media (min-width: 768px) {
  .navbar-brand {
    font-size: 1.3rem;
  }
}

@media (min-width: 992px) {
  .navbar-brand {
    font-size: 1.45rem;
  }
}

.navbar .nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #B794F4, transparent);
  box-shadow: 0 0 8px #B794F4;
  transition: width 0.4s ease;
}

.navbar .nav-link:hover::after {
  width: 100%;
}

.navbar .nav-link:hover {
  color: #FFFFFF !important;
  text-shadow: 0 0 8px rgba(183, 148, 244, 0.8);
}

/* Hamburger menu styling with brain-to-smooth transformation */
.navbar-toggler {
  border: 2px solid #B794F4;
  padding: 0.35rem;
  position: relative;
  background: transparent;
  overflow: visible;
  width: 44px;
  height: 44px;
  border-radius: 4px;
}

.navbar-toggler::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #00FFFF, #B794F4);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: glitch 2s infinite;
}

@keyframes glitch {
  0%, 90%, 100% {
    opacity: 0;
  }
  92%, 94%, 96% {
    opacity: 0.3;
    transform: translate(1px, 1px);
  }
  93%, 95% {
    opacity: 0;
    transform: translate(-1px, -1px);
  }
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(0, 255, 255, 0.3);
  border-color: #00FFFF;
  outline: none;
}

/* Brain menu SVG styles */
.brain-menu svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  display: block;
}

/* Brain wrinkles - wavy lines */
.wrinkle {
  fill: none;
  stroke: #B794F4;
  stroke-width: 2;
  stroke-linecap: round;
  transition: d 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease 0.2s,
              transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

/* Smooth circle - hidden by default */
.smooth-circle {
  fill: none;
  stroke: #B794F4;
  stroke-width: 2;
  transform-origin: center;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.3s ease 0.15s,
              transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ACTIVE STATE - when menu is open */
.navbar-toggler[aria-expanded="true"] .wrinkle {
  opacity: 0;
}

.navbar-toggler[aria-expanded="true"] .wrinkle-1 {
  d: path("M20,10 Q25,10 25,15 Q25,20 20,20 Q15,20 15,15 Q15,10 20,10");
}

.navbar-toggler[aria-expanded="true"] .wrinkle-2 {
  d: path("M20,15 Q28,15 28,20 Q28,25 20,25 Q12,25 12,20 Q12,15 20,15");
}

.navbar-toggler[aria-expanded="true"] .wrinkle-3 {
  d: path("M20,20 Q30,20 30,25 Q30,30 20,30 Q10,30 10,25 Q10,20 20,20");
}

.navbar-toggler[aria-expanded="true"] .smooth-circle {
  opacity: 1;
  transform: scale(1);
}

/* Glow effect on hover */
.navbar-toggler:hover .wrinkle,
.navbar-toggler:hover .smooth-circle {
  filter: drop-shadow(0 0 4px rgba(183, 148, 244, 0.8));
  stroke: #00FFFF;
}

.navbar-toggler:hover {
  border-color: #00FFFF;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.6), 0 0 8px rgba(183, 148, 244, 0.4);
}

.navbar-toggler:hover::before {
  opacity: 0.2;
}

/* Tagline */
.tagline {
  font-family: 'Bahnschrift', sans-serif;
  display: inline-block;
  text-align: center;
  color: var(--white);
}

/* Hero inverse pyramid sizing */
header h2.tagline {
  font-size: 2.5rem;
}

header h3.tagline {
  font-size: 2rem;
}

header h4.tagline {
  font-size: 1.5rem;
}

/* Vaporwave street lines */
.street-line {
  font-family: 'Courier New', monospace;
  color: #B794F4;
  font-weight: 400;
}

/* Glowing Buttons */
.btn-outline-pink {
  color: var(--pink);
  border: none;
  background: transparent;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: all 0.3s ease;
}

.btn-outline-pink:hover, .btn-outline-pink:focus {
  background: transparent;
  color: var(--pink-hover);
  text-shadow: 0 0 2px rgba(255, 46, 46, 0.8);
  transform: translateY(-2px);
  text-decoration: underline;
}

/* Glowing Cards */
.project-card {
  background-color: transparent;
  border: 4px solid;
  border-image: linear-gradient(45deg, #00FFFF, #B794F4) 1;
  border-radius: 0.6rem;
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  max-width: 450px;
  margin: 0 auto;
}

.project-card .card-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-card .card-body .btn {
  margin-top: auto;
}

.project-card::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  background: linear-gradient(45deg, #00FFFF, #B794F4);
  z-index: -1;
  opacity: 0;
  border-radius: 0.6rem;
  animation: glitch 2s infinite;
  pointer-events: none;
}

.project-card:hover {
  border-image: linear-gradient(225deg, #00FFFF, #B794F4) 1;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.6), 0 0 8px rgba(183, 148, 244, 0.4);
}

.project-card:hover::before {
  opacity: 0.15;
  background: linear-gradient(225deg, #00FFFF, #B794F4);
}

.project-card .card-title {
  color: var(--accent);
  font-family: 'Courier New', monospace;
  font-weight: 700;
  text-shadow: 0 0 10px var(--glow-purple);
}

.project-card .card-body {
  color: var(--white);
}

.project-card .card-text {
  color: rgba(255, 255, 255, 0.8);
}

.project-card img {
  object-fit: cover;
  height: 180px;
  filter: brightness(0.8) contrast(1.2);
}

/* Carousel with CRT filter */
.carousel-item {
  position: relative;
}

.carousel-item img {
  filter: brightness(0.9) contrast(1.3) saturate(1.2);
}

.carousel-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
}

.carousel-control-prev-icon, .carousel-control-next-icon {
  background-image: none !important;
  background-color: var(--accent);
  width: 44px !important;
  height: 44px !important;
  border-radius: 50%;
  display: inline-block;
  opacity: 0.9;
  box-shadow: 0 0 10px var(--glow-purple);
  transition: all 0.3s ease;
}

.carousel-control-prev-icon:hover, .carousel-control-next-icon:hover {
  box-shadow: 0 0 20px var(--glow-purple);
}

.carousel-caption p {
  font-family: 'Courier New', monospace;
  background: rgba(0, 0, 0, 0.7);
  display: inline-block;
  padding: 0.35rem 0.6rem;
  border-radius: 0.25rem;
  border: 1px solid var(--glow-purple);
  box-shadow: 0 0 10px var(--glow-purple);
  color: var(--glow-purple);
}

/* Iframe border fix (replaces deprecated frameborder attribute) */
iframe {
  border: none;
}

/* Modal slide-down animation from top */
.modal.fade .modal-dialog {
  transform: translateY(-100vh);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal.show .modal-dialog {
  transform: translateY(0);
}

.modal-content {
  background-color: rgba(0, 0, 0, 0.95);
  border: 2px solid;
  border-image: linear-gradient(45deg, #00FFFF, #B794F4) 1;
  box-shadow: none;
  color: var(--white);
  position: relative;
}

.modal-content::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #00FFFF, #B794F4);
  z-index: -1;
  opacity: 0;
  animation: glitch 2s infinite;
  pointer-events: none;
}

.modal-header, .modal-body, .modal-footer {
  border-color: rgba(183, 148, 244, 0.2);
}

.modal-title {
  color: rgba(183, 148, 244, 0.9);
  text-shadow: none;
}

.modal-body .row {
  min-height: 280px;
}

.modal-body .col-md-7,
.modal-body .col-md-5 {
  display: flex;
  flex-direction: column;
}

.modal-body .col-md-5 {
  justify-content: space-between;
}

/* Section dividers */
section {
  border-bottom: 1px solid rgba(183, 148, 244, 0.2);
  box-shadow: none;
  margin-bottom: 0;
}

section:last-of-type {
  border-bottom: none;
}

/* Ensure sections fill width without overflow */
section .container {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 576px) {
  section .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (min-width: 1200px) {
  section .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (min-width: 1920px) {
  section .container {
    padding-left: 4rem;
    padding-right: 4rem;
  }
}

/* About section - education badges with no border */
.badge {
  border: none;
  background-color: transparent;
  color: #FFFFFF;
  font-family: 'Courier New', monospace;
  transition: all 0.3s ease;
  display: inline-block;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.badge:hover {
  background-color: transparent;
  color: #B794F4;
  text-shadow: 0 0 5px #B794F4;
  transform: scale(1.05);
}

/* Ensure list items wrap properly */
.code-style li {
  white-space: normal;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Align education and skills sections properly on all screens */
.code-style {
  padding-left: 0;
  margin-bottom: 0;
}

.code-style li.badge {
  text-align: left;
  display: inline-block;
  vertical-align: top;
}

/* Footer */
footer {
  background-color: rgba(0, 0, 0, 0.95);
  border-top: 2px solid var(--glow-purple);
  box-shadow: 0 -2px 10px rgba(100, 255, 218, 0.3);
}

footer .container {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

footer .row {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

footer .link-light {
  font-family: 'Courier New', monospace;
  color: var(--glow-purple) !important;
  transition: all 0.3s ease;
}

footer .link-light:hover {
  text-shadow: 0 0 10px var(--glow-purple);
}

/* Hero section */
header.vh-100 {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100vh;
  padding-top: 56px;
  width: 100%;
  position: relative;
  background-color: #0A192F;
  margin: 0;
}

header.vh-100 .container {
  width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (max-width: 991px) {
  header.vh-100 {
    padding-top: 70px;
  }
}

@media (max-width: 576px) {
  header.vh-100 .container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

/* Headings glow */
h1, h2, h3, h4, h5, h6 {
  color: #B794F4;
  text-shadow: 0 0 5px rgba(183, 148, 244, 0.4);
}

/* Paragraph text */
p, .lead {
  color: rgba(255, 255, 255, 0.9);
}

/* Terminal-style code blocks */
code, pre {
  font-family: 'Courier New', monospace;
  background-color: rgba(100, 255, 218, 0.1);
  border: 1px solid var(--glow-purple);
  border-radius: 4px;
  padding: 2px 6px;
  box-shadow: 0 0 5px var(--glow-purple);
  color: var(--glow-purple);
}

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

.text-light {
  color: rgba(255, 255, 255, 0.9) !important;
}

/* Responsive tweaks */
@media (max-width: 767px) {
  .andrei-moldovean {
    font-size: 2rem;
  }
}
