.skills-container {
    width: 90%;
    width: 90%;
    justify-self: center;
    padding: 4rem 0;
}

.skills-container h2 {
    color: #000;
    font-size: 4rem;
    text-align: left;
    margin-bottom: 3rem;
    font-weight: 800;
    margin-left: 10%;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    justify-content: center;
}

.skill {
 
    color: #000;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border: 2px solid #000;
    border-radius: 4px;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.skill:hover {
    transform: scale(1.1);
    background-color: #E32D30;
    color: #fff;
}

.stack-skills {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    transition: .25s ease;
}

.stack-skills:hover {
    transform: rotate(5deg);
}

.stack-skills:hover .card-skills:before {
    transform: translatey(-2%) rotate(-4deg);
}

.stack-skills:hover .card-skills:after {
    transform: translatey(2%) rotate(4deg);
}

.card-skills {
   
    border: 4px solid #000;
    background-color: #fff;
    position: relative;
    transition: 0.15s ease;
    height:auto; /* Changed from fixed height to auto for flexibility */
    aspect-ratio: 1/1.2; /* Maintains a consistent aspect ratio */
    width: 70%;
    cursor: pointer;
    padding: 0.5rem; /* Reduced from 1.5rem to minimize inner space */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertically centers content */
    align-items: center; /* Horizontally centers content */
    gap: 0.5rem; /* Reduced gap between icon and text */
}

.icons-skills {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.icons-skills i {
    font-size: 3rem; /* Adjust icon size if needed */
}

.icons-skills p {
    margin: 0; /* Removes default margin below the text */
    font-weight: bold;
}

.card-skills:before, .card-skills:after {
    content: "";
    display: block;
    position: absolute;
    height: 100%;
    width: 100%;
    border: 4px solid #000;
    background-color: #fff;
    transform-origin: center center;
    z-index: -1;
    transition: .15s ease;
    top: 0;
    left: 0;
}

.card-skills:before {
    transform: translatey(-2%) rotate(-6deg);
}

.card-skills:after {
    transform: translatey(2%) rotate(6deg);
}

.icons-skills {
    width: 50%;
    border: #000 4px solid;
    aspect-ratio: 8/6;
    position: relative;
    overflow: hidden;
    width: 90%;
}
.icons-info {
    
    display: flex;
    flex-direction: column;
    gap: 1rem;
    
}

.icons-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* Add this to your skills.css */
@media (max-width: 768px) {
    .skills-container {
        padding: 2rem 0;
      }

    .skills-container h2 {
      font-size: 2.5rem;
      margin-bottom: 1.5rem;
    }
  
    .skills-grid {
      grid-template-columns: repeat(2, 1fr); /* 2 columns instead of auto-fit */
      gap: 1.5rem;
    }
  
    .card-skills {
      aspect-ratio: 1/1; /* More square shape */
      padding: 0.5rem;
      width: 90%; /* Smaller width */
      margin: 0 auto; /* Center the cards */
    }
  
    .icons-skills i {
      font-size: 2rem; /* Smaller icons */
    }
  
    .icons-info h4 {
      font-size: 1rem; /* Smaller text */
    }
  
    .stack-skills {
      max-width: 100%; /* Full width of grid cell */
    }
  
    .stack-skills:hover {
      transform: none; /* Remove rotation on mobile */
    }
  
    .card-skills:before,
    .card-skills:after {
      display: none; /* Remove the layered effect on mobile */
    }
  }
  
  /* For very small screens */
  @media (max-width: 480px) {
    .skills-grid {
      grid-template-columns: 1fr; /* Single column on very small screens */
      gap: 1rem;
    }
  
    .card-skills {
      width: 80%;
    }
  }
