@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Preahvihear&display=swap');

/* CSS Variables for colors, fonts, and sizes */
:root {
    --font-family-primary: 'Plus Jakarta Sans', sans-serif;
    --font-family-secondary: 'Preahvihear', sans-serif;
    --background-body: #11071f;
    --background-card: #1a0b2e;
    --color-text-primary: #f9f9fa;
    --color-text-violet: #7127BA;
    --color-social-container: rgb(44, 44, 44);
    --color-social-instagram: #d62976;
    --color-social-linkedin: #0072b1;
    --color-social-telegram: #ffe134ea; /* Assuming Telegram, adjust if needed */
    --color-social-whatsapp: #25d366;
    --color-online-user: #33a22d;
    --box-shadow-card: 0px 0px 20px rgba(0, 0, 0, 0.055);
    --border-radius-card: 1.042vw;
    --transition-duration: 0.3s;
    --project-gradient-start: #130428;
    --project-gradient-mid-1: #251043;
    --project-gradient-mid-2: #38126d;
    --project-gradient-mid-3: #261045;
    --project-gradient-end: #190634;
    --project-border-color: #4F228D;
    --project-button-bg: #2C1250;
}

html {
    scroll-behavior: smooth;
    font-size: 16px; /* Base font size */
}

body {
    background-color: var(--background-body);
    margin: 0;
    font-family: var(--font-family-primary);
    color: var(--color-text-primary);
}

/* Utility Classes (optional, for re-usability) */
.font-primary {
    font-family: var(--font-family-primary);
}

.font-secondary {
    font-family: var(--font-family-secondary);
}

.text-violet {
    color: var(--color-text-violet);
}

/* Social fixed */
.social-fixed {
    position: fixed;
    top: 50%;
    left: 90%;
    transform: translateY(-50%);
    z-index: 100; /* Ensure it's above other content */
}

/* Social icons card */
.card {
    width: fit-content;
    height: fit-content;
    background-color: var(--background-card);
    border-radius: var(--border-radius-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px;
    gap: 20px;
    box-shadow: var(--box-shadow-card);
}

/* Social containers */
.socialContainer {
    width: 52px;
    height: 52px;
    background-color: var(--color-social-container);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all var(--transition-duration) ease;
    border-radius: var(--border-radius-card);
}

/* Hover Effects - Descriptive class names */
.social-instagram:hover {
    background-color: var(--color-social-instagram);
    transform: scale(1.5);
}

.social-linkedin:hover {
    background-color: var(--color-social-linkedin);
    transform: scale(1.5);
}

.social-telegram:hover {
    background-color: var(--color-social-telegram);
    transform: scale(1.5);
}

.social-whatsapp:hover {
    background-color: var(--color-social-whatsapp);
    transform: scale(1.5);
}

.socialContainer:active {
    transform: scale(0.9);
}

/* SVG Styles */
.socialSvg, .socialSvg-S {
    fill: transparent;
    transition: all var(--transition-duration) ease;
}

.socialSvg {
    width: 17px;
}

.socialSvg-S {
    width: 30px;
}

.socialSvg path {
    fill: var(--color-text-primary);
}

/* Slide-in animation */
@keyframes slide-in-top {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.socialContainer:hover .socialSvg,
.socialContainer:hover .socialSvg-S {
    animation: slide-in-top var(--transition-duration) both;
}

.card:has(.socialContainer:hover) .socialContainer:not(:hover) {
    opacity: 0.1;
}

/* Top Navigation */
.topnav {
    background-color: var(--background-card);
    color: var(--color-text-primary);
    width: 100%;
    height: 5.729vw;
    display: flex;
    justify-content: flex-start;
    font-family: var(--font-family-primary);
}

.components-top {
    width: 100%;
    display: flex;
    align-items: center;
}

.logo-co {
    width: 5%;
    padding-left: 6vw;
}

.info-co {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: calc(-5% - 6vw + 20vw);
}

.logo {
    height: 4.5vw;
    width: 100%;
}

.onlineUser {
    display: flex;
    text-align: center;
    width: 2.5vw;
    height: 2.5vw;
    font-size: 1vw;
    color: var(--color-online-user);
    font-family: var(--font-family-primary);
    margin-left: 20vw;
}

.info {
    width: 50%;
    display: flex;
    justify-content: space-between;
    width: 27.083vw;
    height: 1.563vw;
    font-size: 1.042vw;
    font-weight: 600;
    font-family: var(--font-family-primary);
}

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 2rem; /* Or use an icon image/SVG */
    padding: 10px; /* Add some padding for touch targets */
}

.container {
    width: 100%;
    display: flex;
    color: var(--color-text-primary);
    flex-direction: column;
    columns: 1;
}

/* Components for "me" section */
.components-me {
    height: 22.448vw;
    width: 100%;
    margin-top: 5.469vw;
    padding-bottom: 4.792vw;
    display: flex;
    justify-content: center;
}

.me-all {
    width: 41.927vw;
    height: 100%;
    display: flex;
    justify-content: center;
}

.me-img {
    width: 20.052vw;
    height: 100%;
    display: flex;
    position: relative;
    justify-content: center;
    align-items: center;
    background-image: url('./assets/Gradient.svg');
    background-size: 20.052vw;
    background-position: center;
}

.me-img img {
    height: 11.615vw;
    width: 8.594vw;
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
}

.me-info {
    margin-left: calc(-3.802vw - 0.781vw - 2.542vw);
    width: 100%;
    position: relative;
}

.me-info img {
    width: 5.052vw;
    margin-bottom: -2.542vw;
    margin-right: 0.781vw;
}

.info-top {
    font-size: 1.302vw;
    font-weight: 600;
    font-family: var(--font-family-primary);
}

.violet {
    color: var(--color-text-violet);
}

.info a {
    text-decoration: none;
    color: var(--color-text-primary);
}

.all-info {
    width: 24.323vw;
    height: 9.386vw;
    margin-left: 5.99vw;
}

.all-info p {
    width: 120%;
}

.p-top {
    font-size: 0.885vw;
    margin-top: 4.167vw;
    text-decoration-line: underline;
}

.p-smaller {
    font-size: 0.833vw;
}

.all-info h1 {
    font-size: 2.604vw;
    margin-top: -0vw;
    margin-bottom: -0vw;
    font-weight: 600;
}

.me-description {
    display: flex;
    justify-content: center;
    height: 11.563vw;
    width: 100%;
    color: var(--color-text-primary);
}

.me-description-text {
    width: 41.927vw;
    height: 100%;
    display: flex;
    justify-content: center;
    flex-direction: column;
    font-family: var(--font-family-primary);
}

.me-description-text h1,
.me-description-text p {
    margin: 0;
}

.me-description-text h1 {
    margin-bottom: 0.625vw;
    font-size: 2.865vw;
    text-align: center;
}

.me-description-text p {
    font-size: 1.146vw;
    text-align: center;
    margin: 0 2.5vw;
}

/* All Projects Section */
.all-project {
    width: 100%;
    height: 36.458vw;
    margin-top: 3.906vw;
    display: flex;
    position: relative;
    justify-content: center;
    align-items: center;
    background-image: url('./assets/Gradient.svg');
    background-repeat: no-repeat;
    background-size: 32.552vw;
    background-position: center;
}

.project {
    height: 18.229vw;
    width: 54.688vw;
    font-family: var(--font-family-secondary);
}

.projects {
    display: flex;
    gap: 2vw;
}

.first-project,
.second-project {
    display: flex;
    align-items: center;
    height: 11.719vw;
    width: 29.167vw;
    background: linear-gradient(
        to right,
        var(--project-gradient-start) 7%,
        var(--project-gradient-mid-1) 34%,
        var(--project-gradient-mid-2) 71%,
        var(--project-gradient-mid-3) 85%,
        var(--project-gradient-end) 100%
    );
    border-radius: 0.781vw;
    border-top: 0.521vw solid var(--project-border-color);
}

.project-t {
    font-size: 1.042vw;
    margin-top: -2.083vw;
}

.first-project-img {
    height: 17.417vw;
    width: 17.417vw;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.first-project-img img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.first-project-txt {
    margin-top: -0.625vw;
    font-family: var(--font-family-secondary);
}

.first-project-txt h1 {
    margin-bottom: 0.625vw;
    padding: 0;
    font-size: 1.354vw;
}

.first-project-txt p {
    font-size: 0.833vw;
    margin-top: -0.625vw;
    line-height: 1.146vw;
}

.first-project-button {
    width: 6.25vw;
    height: 2.083vw;
    margin-top: 0.521vw;
    background-color: var(--project-button-bg);
    border-radius: 0.521vw;
    border: 0.156vw solid var(--project-border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: underline;
    cursor: pointer;
}

.first-project-button p {
    margin: 0;
}

.second-project-img {
    height: 7.292vw;
    width: 7.292vw;
    margin-left: 1.042vw;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.second-project-img img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.second-project {
    display: flex;
    gap: 1.042vw;
}

.second-project-button {
    width: 13.542vw;
    height: 6.25vw;
    font-size: 2.083vw;
    text-align: center;
    font-weight: bolder;
    line-height: 2.865vw;
    margin-top: 0.521vw;
    background-color: var(--project-button-bg);
    border-radius: 0.521vw;
    border: 0.156vw solid var(--project-border-color);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Skills Section */
.skill {
    width: 100%;
    height: 40.104vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

.skills {
    margin-top: 3.646vw;
    width: 45.833vw;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.skill-t {
    width: 19vw;
    height: 3.385vw;
    text-align: center;
    font-size: 1.988vw;
    line-height: 2.865vw;
    font-weight: bold;
    font-family: var(--font-family-secondary);
}
/* Contenitore di tutte le icone: le mantiene su una riga orizzontale */
.container-icon-skill {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 7vw;
}

/* Stile base per ogni singola icona */
.icon-skill {
  position: relative;
  width: 60px;
  height: 60px;
  background: #251c31;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  --primary-color: aqua; /* Valore di default, sovrascritto dal JS se necessario */
}

/* Ridimensiona l'immagine al suo interno */
.icon-skill img {
  width: 30px;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
}

/* Effetto gradiente di riempimento con pseudo-elemento ::after */
.icon-skill::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  z-index: -1;
  background: conic-gradient(
    var(--primary-color, aqua) 0% var(--fill),
    transparent var(--fill) 100%
  );
  transition: --fill 0.5s ease-in-out;
}

@property --fill {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 0%;
}

/* Al passaggio del mouse si colora il bordo in gradiente */
.icon-skill:hover {
  color: var(--primary-color, aqua);
  --fill: 100%;
}

/* Sezione descrittiva nascosta di default */
.description-section {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  background: #251c31;
  color: #fff;
  padding: 1rem;
  border-radius: 8px;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
  text-align: center;
}

/* Mostra la sezione descrittiva al passaggio del mouse */
.icon-skill:hover .description-section {
  display: block;
  opacity: 1;
}

/* Stile per il titolo: usa la stessa variabile per il colore */
.description-section h3 {
  margin-top: 0;
  font-size: 1.1rem;
  color: var(--primary-color, aqua);
}

.description-section p {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  line-height: 1.3;
}


.line {
    margin-top: 1.042vw;
    width: 12.5vw;
    height: 16.146vw;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.line img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.bow {
    width: 45.833vw;
    height: 14.063vw;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: url('./assets/skills.png');
    background-repeat: no-repeat;
    background-size: 45.833vw;
    background-position: center;
}

.circle {
    width: 9.375vw;
    height: 9.375vw;
    margin-top: -2.083vw;
    background: #251C31;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(
        to top,
        rgba(48, 16, 128, 0.6) 0%,
        rgb(120, 64, 173, 0.36) 100%
    );
}

.circle img {
    width: 5.729vw;
    height: 5.729vw;
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
}

.bg {
    width: 28.125vw;
    height: 17.188vw;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: url('./assets/bg-2.svg');
    background-repeat: no-repeat;
    background-size: 100%;
}

.footer {
    width: 100%;
    height: 5.729vw;
    margin-top: 10.417vw;
    background: var(--background-card);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Media Queries for Mobile Devices */
/* Media Query for devices with maximum width 768px */
/***************************/
/*         Desktop         */
/***************************/

/* Desktop styles are above the media queries */

/***************************/
/*  Media Query <= 768px   */
/***************************/
/* Default styles for larger screens are above */


@media (max-width: 768px) {
    html {
      font-size: 14px; /* Reduced base font size for smaller screens */
    }

    body {
      padding: 0;
      margin: 0;
      overflow-y: auto;
    }

    .topnav {
      height: auto;
      padding: 1rem;
      justify-content: space-between;
      align-items: center;
      flex-direction: column; /* Changed to column to stack items */
      position: relative; /* Added relative positioning for dropdown menu */
    }

    .topnav.active .info-co { /* Styles for when the menu is active */
        display: flex; /* Or 'block' depending on layout */
        flex-direction: column;
        position: absolute; /* Dropdown positioning */
        top: 100%; /* Below the navbar */
        left: 0;
        width: 100%;
        background-color: var(--background-card); /* Match navbar background */
        text-align: center; /* Center text in menu items */
        z-index: 10; /* Ensure it's above other content if needed */
    }

    .components-top {
      flex-direction: row; /* Keep logo and hamburger in a row */
      align-items: center;
      justify-content: space-between;
      width: 100%;
    }

    .logo-co {
      width: 50px;
      padding-left: 0;
    }

    .logo {
      height: 3rem;
      width: auto;
    }

    .hamburger {
      display: block;
      cursor: pointer;
      font-size: 2rem;
    }

    .info-co {
      display: none; /* Hidden by default on mobile */
      flex-direction: column;
      width: 100%;
    }

    .info {
      flex-direction: column;
      gap: 1.5rem;
      font-size: 1rem;
      text-align: center;
      width: auto;
      padding: 1rem 0; /* Add padding to the menu */
    }

    .info a {
      padding: 0.5rem 0;
      border-top: 1px solid #ccc;
      width: 100%;
      text-align: center;
      display: block; /* Make links block level for full width click area */
    }

    .onlineUser {
      margin-left: 0;
      font-size: 0.9rem;
      width: auto;
      height: auto;
    }

    /* Social Fixed & Card adjustments for mobile */
    .social-fixed {
      position: fixed;
      bottom: 1rem;
      right: 1rem;
      top: auto;
      left: auto;
      transform: none;
    }

    .card {
      flex-direction: row;
      padding: 0.5rem;
      gap: 0.5rem;
    }

    .socialContainer {
      width: 40px;
      height: 40px;
    }

    /* "Me" Section adjustments for mobile */
    .components-me {
      height: auto;
      margin-top: 2rem;
      padding-bottom: 2rem;
    }

    .me-all {
      width: 90%;
      flex-direction: column;
      align-items: center;
    }

    .me-img {
      width: 50%;
      max-width: 200px;
      height: auto;
      background-size: contain;
    }

    .me-info {
      margin-left: 0;
      text-align: center;
    }

    .info-top {
      font-size: 1.2rem;
    }

    .all-info {
      width: 90%;
      margin-left: 0;
      height: auto;
    }

    .all-info h1 {
      font-size: 1.5rem;
    }

    .p-top {
      font-size: 0.9rem;
      margin-top: 1rem;
    }

    .p-smaller {
      font-size: 0.85rem;
    }

    .me-description {
      height: auto;
      padding: 2rem 1rem;
    }

    .me-description-text {
      width: 90%;
    }

    .me-description-text h1 {
      font-size: 1.5rem;
    }

    .me-description-text p {
      font-size: 1rem;
    }

    /* Projects Section adjustments for mobile */
    .all-project {
      height: auto;
      margin-top: 2rem;
      padding: 2rem 1rem;
      background-size: contain;
    }

    .project {
      width: 90%;
      height: auto;
    }

    .projects {
      display: flex;
      flex-direction: row;
      gap: 1.5rem;
      overflow-x: auto;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }

    .projects::-webkit-scrollbar {
      display: none;
    }

    .first-project,
    .second-project {
      width: 25rem;
      display: flex;
      flex-direction: row;
      align-items: center;
      flex-shrink: 0;
      border-radius: 6px;
      padding: 1rem;
      gap: 1rem;
    }

    .first-project-img,
    .second-project-img {
      width: 120px;
      height: 120px;
      object-fit: cover;
    }

    .first-project-txt,
    .second-project-txt {
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

    .first-project-txt h1,
    .second-project-txt h1 {
      font-size: 1.2rem;
    }

    .first-project-txt p,
    .second-project-txt p {
      font-size: 0.9rem;
    }

    .first-project-button,
    .second-project-button {
      width: 5rem;
      height: 1.8rem;
      font-size: 0.9rem;
    }

    /* Skills Section adjustments for mobile */
    .skill {
      height: auto;
      padding: 2rem 1rem;
    }

    .skills {
      width: 90%;
    }

    .skill-t {
      font-size: 1.2rem;
      width: auto;
    }

    .container-icon-skill {
      width: 100%;
      justify-content: center;
      gap: 1rem;
    }

    .icon-skill {
      width: 2.5rem;
      height: 2.5rem;
    }

    .icon-skill img {
      width: 1.2rem;
    }

    .line {
      width: 60%;
      max-width: 200px;
      height: auto;
    }

    .bow {
      width: 100%;
      height: auto;
      background-size: contain;
    }

    .circle {
      width: 5rem;
      height: 5rem;
    }

    .circle img {
      width: 3rem;
    }

    /* Footer adjustments for mobile */
    .footer {
      height: auto;
      padding: 1rem;
    }
  }

  @media (max-width: 480px) {
    html {
      font-size: 12px; /* Further reduced base font size for very small screens */
    }

    body {
      overflow-y: auto;
    }

    .me-img {
      width: 70%;
      max-width: 150px;
    }

    .socialContainer {
      width: 35px;
      height: 35px;
    }

    .all-info h1 {
      font-size: 1.2rem;
    }

    .me-description-text h1 {
      font-size: 1.2rem;
    }

    .first-project,
    .second-project {
      min-width: 220px;
      height: auto;
    }

    .first-project-img,
    .second-project-img {
      width: 100px;
      height: 100px;
    }

    .first-project-txt h1,
    .second-project-txt h1 {
      font-size: 1.2rem;
    }

    .first-project-txt p,
    .second-project-txt p {
      font-size: 0.85rem;
      line-height: 1.2rem;
    }

    .first-project-button,
    .second-project-button {
      width: 6rem;
      height: 1.8rem;
      font-size: 0.9rem;
    }
  }