/* ===========================
   THEME & BASE
=========================== */
:root{
    --bg: #121212;
    --text: #f4f4f4;
    --muted: #9aa3af;
    --card: #1e1e1e;
    --border: #1f2937;
  
    /* Your blue */
    --brand:   #61dafb;
    --brand-2: #6ab7ff;
  }
  
  *{ box-sizing: border-box; }
  html, body{ height: 100%; }
  
  body{
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
  }
  
  /* Keep main content above particles */
  header, main, footer{
    position: relative;
    z-index: 1;
  }
  
  /* ===========================
     PARTICLES BACKGROUND
  =========================== */
  #particles-js{
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: var(--bg);
    background-size: cover;
    background-position: 50% 50%;
    background-repeat: no-repeat;
  }
  
  /* ===========================
     HEADER (old legacy blocks trimmed)
     Note: the updated PHP has its own header styles inline.
     These are just safe theme tweaks.
  =========================== */
  .hero{
    background-color: #282c34;
    color: #fff;
    text-align: center;
    padding: 50px 20px;
  }
  .hero h1{ margin: 0; font-size: 2.5em; }
  .hero p{ font-size: 1.2em; }
  
  /* Make the new .menu links use your blue by default */
  .menu > li > a,
  .menu > li > button{
    color: var(--brand);
  }
  .menu > li > a:hover,
  .menu > li > button:hover{
    color: #fff;
    border-color: var(--brand-2);
    background: rgba(106,183,255,.10);
  }
  
  /* Dropdown links inside menus */
  .dropdown a{ color: #e8f2ff; }
  .dropdown a:hover{ border-color: var(--brand-2); }
  
  /* ===========================
     USER MENU (avatar / profile / logout)
  =========================== */
  .user-menu{
    position: relative;
    display: flex;
    align-items: center;
  }
  .user-btn{
    appearance: none; -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: transparent;
    color: inherit;
    cursor: pointer;
    line-height: 1;
  }
  .user-btn:hover{ background: rgba(255,255,255,.03); }
  
  .user-label{
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .avatar{
    width: 26px; height: 26px; border-radius: 50%;
    display: grid; place-items: center;
    font-size: 12px; font-weight: 700;
    color: #0b0c10;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
  }
  
  /* Open the dropdown on hover/focus (desktop) */
  .user-menu:hover > .dropdown,
  .user-menu:focus-within > .dropdown{
    display: block;
  }
  
  /* Right-align this dropdown when using .right */
  .dropdown.right{ left: auto; right: 0; }
  
  /* Optional: support click-to-toggle with a class */
  .user-menu.open > .dropdown{ display: block; }
  
  /* Hide long usernames on small screens */
  @media (max-width: 980px){
    .user-label{ display: none; }
  }
  
  /* ===========================
     CONTENT SECTIONS
  =========================== */
  .about, .projects, .discord-bots, .interests, .contact, .social{
    padding: 20px;
    color: #fff;
    background: var(--card);
    margin: 20px auto;
    max-width: 75%;
    box-shadow: 0 0 10px rgba(0,0,0,.1);
    border-radius: 10px;
  }
  .about h2, .projects h2, .discord-bots h2, .interests h2, .contact h1, .social h2{
    margin-top: 0;
    color: var(--brand);
  }
  
  /* Project cards */
  .project-cards{
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex-wrap: wrap;
  }
  .project-card{
    background: #2c2f33;
    border: 1px solid var(--brand);
    padding: 20px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    box-shadow: 0 0 5px rgba(0,0,0,.1);
    border-radius: 10px;
    text-align: left;
    max-height: 200px;
    overflow: hidden;
    transition: max-height .3s ease;
    position: relative;
  }
  .project-card.expanded{ max-height: none; }
  .project-card img{
    max-width: 150px; height: auto; margin-right: 20px;
    border-radius: 10px;
  }
  .project-card ul{ padding-left: 20px; list-style: disc; }
  .expand-btn{
    display: none;
    margin-top: 10px;
    background: transparent;
    border: none;
    color: var(--brand);
    cursor: pointer;
    text-align: left;
  }
  
  /* ===========================
     CAROUSEL
  =========================== */
  .bot-carousel{ overflow: hidden; position: relative; width: 100%; }
  .bot-carousel-track{
    display: flex;
    width: calc(300px * 14);
    animation: scroll 40s linear infinite;
  }
  @keyframes scroll{
    0%{ transform: translateX(0); }
    100%{ transform: translateX(calc(-300px * 7)); }
  }
  .bot-carousel:hover .bot-carousel-track{ animation-play-state: paused; }
  
  .bot-card{
    min-width: 300px;
    background: #2c2f33;
    border: 1px solid var(--brand);
    padding: 10px;
    border-radius: 10px;
    flex: 0 0 auto;
    text-align: center;
  }
  .bot-card img{
    width: 200px; height: 200px;
    object-fit: cover;
    border-radius: 10px;
  }
  .description{ max-width: 200px; margin: 0 auto; }
  
  /* Tags with your blue */
  .interest-tags{ display: flex; flex-wrap: wrap; gap: 10px; }
  .tag{
    background: var(--brand);
    color: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    display: inline-block;
  }
  
  /* ===========================
     FOOTER
  =========================== */
  footer{
    text-align: center;
    padding: 20px 0;
    background: #282c34;
    color: var(--brand);
  }
  
  /* ===========================
     POPUP IMAGE
  =========================== */
  .popup-img{
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    padding-top: 60px;
    background: rgba(0,0,0,.9);
  }
  .popup-img-content{
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
  }
  .close{
    position: absolute;
    top: 15px; right: 35px;
    color: #fff;
    font-size: 40px; font-weight: bold;
    transition: .3s;
  }
  .close:hover, .close:focus{
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
  }
  
  /* ===========================
     RESPONSIVE TWEAKS
  =========================== */
  @media (max-width: 768px){
    .project-card{ flex-direction: column; align-items: flex-start; padding: 10px; margin: 10px 0; }
    .project-card img{ max-width: 100%; margin: 0 0 10px 0; }
    .project-cards{ padding: 10px; }
    .about, .projects, .discord-bots, .interests, .contact, .social{ max-width: 95%; }
  }
  @media (max-width: 480px){
    .project-card{ padding: 10px; margin: 10px 0; }
    .about, .projects, .discord-bots, .interests, .contact, .social{ max-width: 95%; }
    .expand-btn{ display: block; }
  }
  
  /* ===========================
     SMALL UTILITIES
  =========================== */
  .hover-img{ color: var(--brand); font-weight: bold; cursor: pointer; }
  
  footer {
    margin-top: 2rem;
    padding: 1rem;
    text-align: center;
    color: var(--muted);
    border-top: 1px solid var(--border);
    background: transparent;
  }
  
  /* --- Mobile nav fixes --- */
@media (max-width:980px){
  /* Ensure the “drawer” sits on top and is scrollable */
  header{ z-index: 1000; }
  .nav-wrap{ position: relative; }     /* make absolute children anchor here */
  .mobile-toggle{ position: relative; z-index: 1001; }

  /* Turn the menu into a fixed panel under the header */
  .menu{
    position: fixed;
    left: 0; right: 0;
    top: 56px;                           /* adjust if your header is taller */
    display: none;
    z-index: 1000;
    max-height: calc(100vh - 56px);
    overflow: auto;
    background: rgba(18,20,26,.98);
    border-top: 1px solid var(--border);
    padding: 8px 12px;
    -webkit-overflow-scrolling: touch;
  }
  .menu.open{ display: block; }

  /* Submenus are CLOSED by default on mobile and open per item tap */
  .menu .dropdown{ display: none; position: static; margin: 6px 0; padding: 8px; }
  .menu li.open > .dropdown{ display: block; }

  /* Make full-row touch targets */
  .menu > li{ display: block; }
  .menu > li > a,
  .menu > li > button{ width: 100%; justify-content: space-between; }

  /* Little caret that rotates when open */
  .menu > li > button .caret{ transition: transform .2s ease; }
  .menu li.open > button .caret{ transform: rotate(180deg); }

  /* Lock body scroll when the nav is open */
  body.nav-open{ overflow: hidden; touch-action: none; }
}

