/* ==============================
   FELIX PORTFOLIO — BASE THEME
   ============================== */

/* Theme tokens */
:root{
  --bg:#0c0c0c;
  --panel:#1a1a1a;
  --text:#f5f5f5;
  --muted:#bdbdbd;
  --accent:#00bcd4;
  --shadow:0 6px 22px rgba(0,0,0,.45);

  --util-h:44px;          /* utility bar (top layer) */
  --nav-h:64px;           /* main nav height */
  --avail-h:38px;         /* availability bar height */
}

:root.light{
  --bg:#1e1e1e;           /* darker light mode per your request */
  --panel:#2a2a2a;
  --text:#f1f1f1;
  --muted:#d7d7d7;
  --accent:#19cbe0;
  --shadow:0 6px 18px rgba(0,0,0,.35);
}

/* Resets / layout safety */
*{box-sizing:border-box;margin:0;padding:0;}
html,body{width:100%;max-width:100%;overflow-x:hidden;scroll-behavior:smooth;}
body{font-family:"Poppins",system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:var(--bg);color:var(--text);}

/* Utilities */
.hidden{opacity:0;pointer-events:none;transform:translateY(10px);transition:opacity .25s,transform .25s;}
.container{max-width:1200px;margin:0 auto;padding:0 5%;}

/* ==============================
   HEADER (3 LAYERS INSIDE <header>)
   ============================== */
header{width:100%;}

/* LAYER 1 — Utility (translator + theme) */
.header-utility{
  position:fixed; top:0; left:0; right:0; height:var(--util-h);
  background:var(--panel);
  display:flex; align-items:center;
  padding:0 5%;
  box-shadow:var(--shadow);
  z-index:999;
  transition:transform .4s ease, opacity .4s ease, height .2s;
}
.header-utility.hide{transform:translateY(-100%); opacity:0;}
.utility-inner{display:flex; align-items:center; justify-content:space-between; width:100%; gap:14px;}

.translate-wrap{display:flex; align-items:center; gap:8px;}
.translate-label{font-size:.9rem; color:var(--text); opacity:.85;}

/* Make Google Translate native select visible & themed */
#google_translate_element .goog-te-gadget-simple{display:none!important;}
#google_translate_element .goog-te-gadget{font-size:0!important;}
#google_translate_element .goog-te-combo{
  display:inline-block!important;
  background:transparent!important;
  color:var(--text)!important;
  border:1px solid rgba(255,255,255,.25)!important;
  border-radius:8px!important;
  padding:6px 10px!important;
  font-size:.92rem!important; line-height:1!important;
  outline:none; cursor:pointer;
}
#google_translate_element .goog-te-combo:hover,
#google_translate_element .goog-te-combo:focus{
  border-color:var(--accent)!important;
  box-shadow:0 0 0 3px rgba(0,188,212,.15);
}

/* Theme toggle (wheel text flips) */
.theme-toggle{
  position:relative; display:grid; place-items:center;
  width:92px; height:34px;
  border-radius:999px; border:1px solid rgba(255,255,255,.2);
  background:rgba(255,255,255,.06);
  cursor:pointer; overflow:hidden; perspective:700px;
}
.toggle-wheel{position:relative; width:100%; height:100%; display:grid; place-items:center;}
.label-dark,.label-light{
  position:absolute; inset:0; display:grid; place-items:center; font-weight:800; letter-spacing:.2px; transition:transform .6s;
}
.label-dark{color:#fff;}
.label-light{color:#000; transform:rotateX(-90deg);}
:root.light .label-dark{transform:rotateX(90deg);}
:root.light .label-light{transform:rotateX(0);}

.theme-toggle.spin .toggle-wheel{animation:flip360 .5s;}
@keyframes flip360{from{transform:rotateY(0)}to{transform:rotateY(360deg)}}

/* LAYER 2 — Main navigation */
.header-main{
  position:fixed; left:0; right:0; top:var(--util-h); height:var(--nav-h);
  display:flex; align-items:center; justify-content:space-between;
  background:var(--panel); padding:0 5%;
  box-shadow:var(--shadow); z-index:998;
  transition:top .4s ease;
}
.header-main.compact{top:0;} /* when utility is hidden */

.logo a{display:flex; align-items:center; gap:12px; text-decoration:none; color:var(--text);}
.logo-img{height:42px; width:auto; filter:drop-shadow(0 0 10px rgba(0,188,212,.45));}

#nav-menu{display:flex; gap:22px;}
#nav-menu a{color:var(--text); text-decoration:none; font-weight:700; position:relative;}
#nav-menu a::after{content:""; position:absolute; left:0; bottom:-4px; height:2px; width:0; background:var(--accent); transition:width .3s;}
#nav-menu a:hover::after{width:100%;}

.menu-toggle{display:none; background:none; border:0; color:var(--text); font-size:1.9rem; cursor:pointer;}

/* LAYER 3 — Availability */
.availability-bar{
  position:fixed; left:0; right:0; top:calc(var(--util-h) + var(--nav-h));
  height:var(--avail-h); display:flex; align-items:center; justify-content:center;
  background:rgba(0,255,128,.12); color:#00ff80; font-weight:800;
  text-align:center; letter-spacing:.3px;
  backdrop-filter:blur(6px);
  box-shadow:0 0 10px rgba(0,255,128,.35);
  z-index:997;
  transition:top .4s ease;
  animation:glowPulse 3s ease-in-out infinite;
}
@keyframes glowPulse{
  0%,100%{box-shadow:0 0 8px rgba(0,255,128,.35);}
  50%{box-shadow:0 0 16px rgba(0,255,128,.7);}
}

/* Mobile nav dropdown (overlay to avoid underlap) */
@media (max-width: 900px){
  body.nav-open{overflow:hidden;} /* stop background scroll */

  #nav-menu{
    position:fixed;
    top:var(--menu-top, calc(var(--util-h) + var(--nav-h) + var(--avail-h)));
    left:0; width:100%;
    flex-direction:column; align-items:center;
    background:var(--panel);
    border-top:1px solid rgba(255,255,255,.08);
    border-bottom:1px solid rgba(255,255,255,.08);
    max-height:0; opacity:0; transform:translateY(-10px);
    overflow:hidden;
    transition:max-height .4s ease, opacity .4s ease, transform .4s ease;
    z-index:2000;
  }
  #nav-menu.active{max-height:360px; opacity:1; transform:translateY(0);}
  #nav-menu a{width:100%; padding:14px 0; text-align:center; border-bottom:1px solid rgba(255,255,255,.08);}
  .menu-toggle{display:block;}
}

/* Keep the page content below header stack */
body{padding-top:calc(var(--util-h) + var(--nav-h) + var(--avail-h));}

/* When utility hides, nav moves to top & availability follows */
.header-main.compact + .availability-bar{top:var(--nav-h);}
.header-utility.hide ~ .header-main{top:0;}
.header-utility.hide ~ .availability-bar{top:var(--nav-h);}

/* Responsive adjustments for utility bar */
@media (max-width:700px){
  .utility-inner{flex-direction:column; align-items:stretch; gap:8px; height:auto;}
  .header-utility{height:auto; padding:8px 5%;}
}

/* ==============================
   HERO
/* ===== HERO SECTION ===== */
.hero-modern {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #fff;
}

/* Matrix Background */
#matrix-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #000;
  opacity: 0.45; /* more visible */
}

/* Transparent Floating Box */
.hero-box {
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 1100px;
  min-height: 85vh; /* almost fullscreen */
  padding: 60px 50px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(0, 255, 100, 0.3);
  border-radius: 20px;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 30px rgba(0, 255, 100, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: glowPulse 8s ease-in-out infinite;
}

/* Subtle glow pulse */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 40px rgba(0, 255, 100, 0.3);
    border-color: rgba(0, 255, 100, 0.3);
  }
  50% {
    box-shadow: 0 0 70px rgba(0, 255, 100, 0.6);
    border-color: rgba(0, 255, 100, 0.6);
  }
}

/* Text Area */
.hero-text {
  text-align: center;
  max-width: 800px;
}

.hero-text h1 {
  font-size: 3rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 15px;
}

.hero-text h2 {
  font-size: 2rem;
  font-weight: 700;
  color: #64b5f6; /* light blue */
  margin-bottom: 20px;
}

.hero-text h3 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #b3e5fc;
  border-right: 3px solid #64b5f6;
  white-space: nowrap;
  overflow: hidden;
  width: 100%;
  animation: blinkCursor 0.8s step-end infinite;
  margin-bottom: 25px;
}

@keyframes blinkCursor {
  50% {
    border-color: transparent;
  }
}

.hero-text p {
  font-size: 1.1rem;
  color: #e0e0e0;
  margin-bottom: 40px;
  line-height: 1.8;
}

/* Buttons */
.hero-buttons {
  display: flex;
  justify-content: center;
}

.btn-primary {
  background: #00e676;
  color: #001b20;
  padding: 14px 30px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.3s ease, background 0.3s ease;
}
.btn-primary:hover {
  transform: translateY(-3px);
  background: #1de9b6;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-box {
    padding: 40px 20px;
    min-height: 90vh;
  }

  .hero-text h1 {
    font-size: 2.4rem;
  }

  .hero-text h2 {
    font-size: 1.6rem;
  }

  .hero-text h3 {
    font-size: 1.4rem;
  }

  .hero-text p {
    font-size: 1rem;
  }

  .btn-primary {
    padding: 12px 24px;
  }
}

/* ==============================
   ABOUT
   ============================== */
.about{padding:80px 5%; text-align:center;}
.about h2{font-size:2rem; margin-bottom:12px;}
.about-scroll{
  max-width:900px; margin:0 auto; background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.1); border-radius:12px; padding:16px;
  color:var(--muted);
}

/* ==============================
   SKILLS (marquee)
   ============================== */
.skills{padding:80px 5%; text-align:center;}
.skills h2{font-size:2rem; margin-bottom:12px;}
.skills-wrapper{overflow:hidden; white-space:nowrap;}
.skills-scroll{display:inline-flex; gap:38px; padding:14px 0; animation:marquee 38s linear infinite;}
.skills-scroll span{color:var(--accent); font-weight:900; text-shadow:0 0 10px rgba(0,188,212,.45);}
@keyframes marquee{from{transform:translateX(0)} to{transform:translateX(-50%)}}

/* ==============================
   FEATURED
   ============================== */
.featured{padding:80px 5%; text-align:center;}
.featured h2{font-size:2rem; margin-bottom:16px;}
.featured-grid{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:22px;
}
.featured-card{
  background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.08);
  border-radius:12px; padding:14px; text-align:left; box-shadow:var(--shadow); transition:transform .25s;
}
.featured-card:hover{transform:translateY(-6px);}
.featured-card img{width:100%; height:180px; object-fit:cover; border-radius:10px; margin-bottom:8px;}
.tag{display:inline-block; background:var(--accent); color:#032026; font-weight:900; font-size:.78rem; padding:4px 10px; border-radius:999px; margin-bottom:8px;}

/* ==============================
   EDITS (manual scrollers)
   ============================== */
.edits{padding:80px 5%; text-align:center;}
.scroll-wrapper{position:relative; display:flex; align-items:center; justify-content:center; margin-bottom:34px;}
.scroll-container{display:flex; gap:14px; overflow-x:auto; scroll-behavior:smooth; padding:8px; max-width:100%;}
.scroll-container::-webkit-scrollbar{height:8px;} /* optional */
.scroll-container img, .scroll-container video{
  width:260px; height:160px; object-fit:cover; border-radius:10px;
  background:rgba(255,255,255,.05); transition:transform .25s;
}
.scroll-container img:hover, .scroll-container video:hover{transform:scale(1.05);}
.scroll-btn{
  position:absolute; width:44px; height:44px; border-radius:10px; border:none;
  background:rgba(255,255,255,.12); color:var(--text); font-size:1.6rem; cursor:pointer; z-index:5;
  box-shadow:var(--shadow);
}
.scroll-btn:hover{background:var(--accent); color:#032026;}
.scroll-btn.left{left:0;}
.scroll-btn.right{right:0;}

/* ==============================
   AI ASSISTANT
   ============================== */
.ai-assistant{padding:80px 5%; text-align:center; position:relative;}
.ai-assistant h2{font-size:2rem; margin-bottom:12px;}
.ai-toggle{
  position:fixed; bottom:84px; right:20px;
  background:var(--accent); color:#001b20; font-weight:900;
  border:none; border-radius:999px; padding:12px 18px; cursor:pointer;
  box-shadow:var(--shadow); z-index:1500; transition:transform .2s, background .2s;
}
.ai-toggle:hover{transform:scale(1.05); background:#15dbf0;}

.ai-popup{
  position:fixed; bottom:150px; right:20px; width:340px;
  background:var(--panel); border:1px solid rgba(255,255,255,.12);
  border-radius:12px; box-shadow:var(--shadow); overflow:hidden; z-index:1600;
  transition:opacity .25s, transform .25s;
}
.ai-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 14px; color:var(--accent); background:rgba(255,255,255,.05); font-weight:900;
}
.ai-close{background:transparent; border:none; color:var(--text); font-size:1.2rem; cursor:pointer;}
.ai-body{max-height:320px; overflow:auto; padding:10px; display:flex;}
.ai-messages{display:flex; flex-direction:column; gap:8px; width:100%;}
.ai-message{max-width:85%; padding:8px 10px; border-radius:8px;}
.ai-message.user{align-self:flex-end; background:rgba(255,255,255,.08);}
.ai-message.bot{align-self:flex-start; background:rgba(0,188,212,.15);}
.ai-input{display:flex; border-top:1px solid rgba(255,255,255,.1);}
.ai-input input{flex:1; padding:10px; background:transparent; border:none; color:var(--text); outline:none;}
.ai-send{background:var(--accent); color:#001b20; border:none; padding:10px 14px; font-weight:800; cursor:pointer;}

/* ==============================
   FOOTER
   ============================== */
footer{position:relative; padding:36px 5%; text-align:center; background:var(--panel); color:var(--muted); overflow:hidden;}
#code-canvas-footer{position:absolute; inset:0; opacity:.1; pointer-events:none;}
.footer-inner{position:relative; z-index:1; max-width:1100px; margin:0 auto;}
.footer-icons{display:flex; justify-content:center; gap:16px; margin-bottom:8px;}
.footer-icons i{font-size:22px; opacity:.9; transition:opacity .25s;}
.footer-icons i:hover{opacity:1;}


/* ===== ABOUT (Detailed) ===== */
.about {
  padding: 80px 5%;
  text-align: center;
}

.about h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.about-intro {
  max-width: 900px;
  margin: 0 auto 22px;
  color: var(--muted);
  line-height: 1.9;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 16px 18px;
}

/* Grid of cards */
.about-grid {
  display: grid;
  grid-template-columns: repeat( auto-fit, minmax(260px, 1fr) );
  gap: 18px;
  margin-top: 10px;
}

.about-card {
  text-align: left;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  transition: transform .25s ease, border-color .25s ease;
}

.about-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,0.18);
}

.about-card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.about-card p {
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 10px;
}

/* Bulleted lists */
.bullets {
  margin-left: 16px;
  color: var(--text);
}
.bullets li {
  margin: 6px 0;
  color: var(--muted);
}

/* Skill tags & metrics */
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 8px;
}
.skill-tags span {
  display: inline-block;
  background: rgba(0,188,212,0.15);
  color: var(--accent);
  border: 1px solid rgba(0,188,212,0.35);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .82rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 8px;
  margin-top: 8px;
}
.metric {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 8px 10px;
  display: grid;
  gap: 4px;
}
.metric span {
  font-size: .78rem;
  color: var(--muted);
}
.metric strong {
  font-size: .95rem;
}

/* CTA */
.about-cta {
  margin-top: 22px;
  display: grid;
  gap: 12px;
  justify-items: center;
}
.about-cta p {
  color: var(--muted);
  max-width: 800px;
  line-height: 1.8;
}
.about-cta .btn-primary {
  display: inline-block;
}

/* Responsive */
@media (max-width: 800px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}
@media (max-width: 520px) {
  .metrics {
    grid-template-columns: 1fr;
  }
}


/* ===== CURRENTLY SHARPENING ===== */
.sharpening{
  padding:80px 5%;
  background: transparent; /* blends with your theme */
  display:flex; justify-content:center;
}
.sharpening-inner{
  width:100%; max-width:1100px; text-align:center;
}

.sharpening h2{
  font-size:2rem; margin-bottom:18px;
}

.terminal{
  margin:0 auto;
  position:relative;
  background: rgba(0, 20, 10, 0.5);
  border: 1px solid rgba(0,255,128,0.25);
  box-shadow: 0 10px 28px rgba(0,0,0,.45), inset 0 0 24px rgba(0,255,128,0.08);
  border-radius: 12px;
  padding: 18px 16px 22px 16px;
  max-width: 100%;
  overflow: hidden;
  text-align: left;
  backdrop-filter: blur(4px);
}

/* coding font + green theme */
.terminal,
.terminal pre,
.terminal .prompt{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: #00ff80;
}

.prompt{
  position:absolute; left:14px; top:14px;
  opacity:.9;
}

#dev-stream{
  margin:0;
  padding-left: 26px; /* space for prompt */
  white-space: pre-wrap;       /* keep newlines, wrap long lines */
  word-wrap: break-word;
  line-height: 1.65;
  min-height: 140px;
}

/* blinking cursor */
.cursor{
  position:absolute;
  bottom: 18px;
  left: 16px;
  width: 10px; height: 18px;
  background: #00ff80;
  opacity: .9;
  animation: blink 1s steps(1, end) infinite;
}
@keyframes blink{
  50%{opacity:0;}
}

/* when typing, keep cursor near the end (visual trick on small screens) */
@media (max-width: 700px){
  .cursor{ left:auto; right:16px; }
}

/* tasteful scanline / glow (optional) */
.terminal::after{
  content:"";
  position:absolute; inset:0;
  background: repeating-linear-gradient(transparent 0 2px, rgba(0,255,128,0.04) 2px 3px);
  pointer-events:none;
  mix-blend-mode: lighten;
}
