/* ------------------------------------------------------
   1) Base (Large) styles
------------------------------------------------------ */

/* Utility Classes */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  html, body {
    font-family: "Roboto Slab", serif;
    background-image: linear-gradient(97deg, #373A3E 0%, #373A3E 100%);
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
  }

  a {
    text-decoration: none;
    color: inherit;
  }
  
  /* Custom Scrollbar Styles */
  .content::-webkit-scrollbar {
    width: 10px;
  }
  
  .content::-webkit-scrollbar-track {
    background: #1F1F1F;
    border-radius: 5px;
  }
  
  .content::-webkit-scrollbar-thumb {
    background: #a6a6a6;
    border-radius: 5px;
  }
  
  .content::-webkit-scrollbar-thumb:hover {
    background: #a6a6a6;
  }
  
  .container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 4fr 8fr;
    grid-template-rows: auto 1fr;
    gap: 20px;
    padding: 200px 20px 20px 20px; /* extra top padding */
    position: relative;
  }
  
  .sidebar {
    background-color: #1F1F1F;
    color: white;
    padding: 80px 20px 20px 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    max-height: 700px;
  }
  
  .profile-image {
    width: 240px;
    height: 240px;
    border-radius: 20px;
    overflow: hidden;
    margin: auto;
    margin-bottom: 21px;
    margin-top: -230px;
    object-fit: cover;
  }
  
  .sidebar-content {
    flex-grow: 1;
    width: 100%;
    text-align: center;
  }
  
  .main-area {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 20px;
  }
  
  .site-header {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    background-color: #1F1F1F;
    color: white;
    border-radius: 12px;
    padding: 25px 0;
    width: 75%;
    justify-self: end;
    margin-top: -150px;
    height: 135px;
  }
  
  .header-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    background-color: #373A3E;
    border-radius: 12px;
    transition: all 0.3s ease;
  }
  
  .header-icon i {
    font-size: 24px;
    color: #a6a6a6;
  }
  
  .header-section p {
    margin-top: 5px;
    color: #a6a6a6;
    font-size: 14px;
  }
  
  .content {
    background-color: #1F1F1F;
    color: #fff;
    border-radius: 12px;
    padding: 60px;
    height: 700px;
    margin-top: -20px;
    overflow-y: auto;
  }

  /* Mobile header: hidden by default for large screens */
  .mobile-header {
    display: none;
  }
  
  /* Active header section styles */
  .header-section.active {
    background: linear-gradient(97deg, #E8A222 0%, #BE294D 100%);
    box-shadow: 0 5px 15px rgba(232, 162, 34, 0.3);
  }
  
  .header-section.active i,
  .header-section.active p {
    color: #fff;
  }
  
  .header-section:hover {
    background-color: #202425;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .header-section:hover i,
  .header-section:hover p {
    color: #E8A222;
  }
  
  /* Sidebar specific text sections */
  .person-name h4 {
    font-size: 24px;
    margin: 0;
  }
  
  .person-profession {
    font-size: 14px;
    margin: 10px auto 0;
    color: #a6a6a6;
    background-color: #373A3E;
    padding: 10px;
    border-radius: 12px;
    width: 60%;
    text-align: center;
  }
  
  .social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
  }
  
  .social-links i {
    background-color: #373A3E;
    padding: 15px;
    margin: 5px 20px 0 20px;
    border-radius: 12px;
    color: #a6a6a6;
    transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  }
  
  .social-links i:hover {
    background: linear-gradient(97deg, #E8A222 0%, #BE294D 100%);
    color: #fff;
    cursor: pointer;
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 20px rgba(190, 41, 77, 0.2);
  }
  
  .person-contact {
    margin-top: 20px;
    width: 100%;
    padding: 15px 40px;
    background-color: #373A3E;
    border-radius: 12px;
  }
  
  .person-contact-method {
    display: flex;
    align-items: center;
    margin: 10px 0;
  }
  
  .person-contact-method-icon {
    padding: 20px;
    background-color: #1F1F1F;
    font-size: 20px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
  }
  
  .person-contact-method-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    margin-left: 10px;
  }
  
  .person-contact-method-text span {
    color: #a6a6a6;
  }
  
  .person-cv {
    padding: 20px;
    background: linear-gradient(97deg, #E8A222 0%, #BE294D 100%);
    border-radius: 12px;
    width: 50%;
    text-align: center;
    margin: 35px auto;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  
  .person-cv:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(232, 162, 34, 0.3);
  }
  
  /* Content spacing */
  .content h2 {
    font-size: 36px;
  }
  
  .content h3 {
    font-size: 24px;
    margin: 10px 0;
  }
  
  .content p,
  .content li {
    font-size: 18px;
    color: #C9C9C9;
    margin: 10px 0;
  }

  .content strong{
    color: #E9E9E9;
  }
  
  .content ul {
    padding-left: 40px;
  }
  
  .content ul li {
    padding-left: 10px;
  }
  
  /* About Section */
.about-content h3 {
  margin-top: 30px;
  margin-bottom: 15px;
}

  .about-content-all-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .about-content-card {
    display: grid;
    grid-template-columns: 1fr 5fr;
    gap: 10px;
    align-items: center;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 0;
    border: 1px solid #a6a6a6;
    width: 100%;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  
  .about-content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(166, 166, 166, 0.2);
  }
  
  .card-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #1F1F1F;
    width: 70px;
    height: 70px;
    border-radius: 12px;
  }
  
  .card-icon i {
    font-size: 36px;
    color: #a6a6a6;
  }
  
  .card-content h4 {
    margin: 0 0 10px 0;
    color: #fff;
  }
  
  .card-content p {
    margin: 0;
    color: #a6a6a6;
    font-size: 14px;
    line-height: 1.5;
  }
  
  /* Timeline Cards (Education & Work Experience) */
  .timeline-card {
    display: grid;
    grid-template-columns: 1fr 5fr;
    gap: 10px;
    align-items: center;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 0;
    border: 1px solid #a6a6a6;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 80%;
    margin-top: 30px;
  }
  
  .timeline-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(166, 166, 166, 0.2);
  }
  
  /* Unified margin for headings/paragraphs inside .timeline-card */
  .timeline-card h3,
  .timeline-card h4,
  .timeline-card h5,
  .timeline-card p {
    margin: 5px 0;
  }
  
  .timeline-card .card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: invert(80%) sepia(0%) saturate(0%) hue-rotate(137deg) brightness(82%) contrast(90%);
  }
  
  /* Projects Section */
  .project-content-all-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 30px;
  }
  
  .project-content-card {
    border: 1px solid #a6a6a6;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 450px; /* Fixed height for all cards */
    display: flex;
    flex-direction: column;
  }
  
  .project-content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(166, 166, 166, 0.2);
  }
  
  .project-content-card .card-img {
    height: 200px;
    width: 100%;
    overflow: hidden;
    flex-shrink: 0;
  }
  
  .project-content-card .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top; /* Display image from the top */
  }
  
  .project-card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
  }
  
  .project-content-card h3 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 500;
  }
  
  .project-content-card h4 {
    color: #a6a6a6;
    font-size: 14px;
    margin-bottom: 12px;
    font-weight: normal;
  }
  
  .project-content-card p {
    margin-top: 0;
    margin-bottom: 16px;
    color: #d1d1d1;
    font-size: 14px;
    line-height: 1.5;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .about-content .bio p {
    font-size: 18px;
    color: #C9C9C9;
    margin: 10px 0;
    line-height: 1.5;
    margin-block: 1lh;
  }
  
  .project-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
  }
  
  .project-categories .category {
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 12px;
    color: #fff;
  }
  
  .project-categories .category-web {
    background-color: #EC5037;
  }
  
  .project-categories .category-ml {
    background-color: #BE294D;
  }

  /* Individual Project Page */
  .project-meta-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin: 1rem 0;
  }
  
  .github-link {
    margin-bottom: 1rem;
  }

  .github-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #24292e;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  }

  .github-button:hover {
    background-color: #2c3136;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  }

  .github-button:hover i {
    transform: rotate(10deg) scale(1.2);
  }

  .github-button i {
    font-size: 18px;
    transition: transform 0.3s ease;
  }

  .project-image {
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  .project-image img {
    width: 50%;
    border-radius: 8px;
    height: auto;
    display: block;
    margin: 0 auto;
  }

  /* Contact Section */
  
  .contact-form {
    max-width: 600px;
    margin: 30px auto;
  }
  
  .form-group {
    margin-bottom: 24px;
  }
  
  .form-group label {
    display: block;
    margin-bottom: 5px;
    color: #a6a6a6;
    font-family: "Roboto Slab", serif;
    font-size: 16px;
  }
  
  .form-group input,
  .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #373A3E;
    border-radius: 5px;
    background-color: #1F1F1F;
    color: #fff;
    margin-bottom: 8px;
    font-family: "Roboto Slab", serif;
    transition: all 0.3s ease;
  }
  
  .form-group textarea {
    height: 150px;
    resize: vertical;
  }
  
  .form-group input:focus,
  .form-group textarea:focus {
    outline: none;
    border-color: #E8A222;
    box-shadow: 0 0 0 2px rgba(232, 162, 34, 0.2);
  }
  
  .form-group input::placeholder,
  .form-group textarea::placeholder {
    color: #a6a6a6;
    font-family: "Roboto Slab", serif;
  }
  
  .contact-form button {
    background: linear-gradient(97deg, #E8A222 0%, #BE294D 100%);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  
  .contact-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(232, 162, 34, 0.3);
  }
  
  /* Footer */
  .footer {
    text-align: center;
    padding: 20px;
    color: #a6a6a6;
  }

  /* Modal Styles */
  /* Modal animation keyframes */
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  @keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
  }

  @keyframes scaleIn {
    from { transform: scale(0.9); }
    to { transform: scale(1); }
  }

  @keyframes scaleOut {
    from { transform: scale(1); }
    to { transform: scale(0.9); }
  }

  .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    animation: fadeIn 0.3s ease-out forwards;
  }

  .modal {
    background-color: #1F1F1F;
    color: #fff;
    padding: 2rem;
    border-radius: 12px;
    width: 800px;
    height: 600px;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    animation: scaleIn 0.3s ease-out forwards;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }

  /* Modal Scrollbar Styles */
  .modal::-webkit-scrollbar {
    width: 10px;
  }

  .modal::-webkit-scrollbar-track {
    background: #1F1F1F;
    border-radius: 10px;
  }

  .modal::-webkit-scrollbar-thumb {
    background: #a6a6a6;
    border-radius: 10px;
  }

  .modal::-webkit-scrollbar-thumb:hover {
    background: #a6a6a6;
  }

  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #373A3E;
  }

  .modal-header .header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .modal-header .card-icon img {
    height: 70px;
    filter: invert(80%) sepia(0%) saturate(0%) hue-rotate(137deg) brightness(82%) contrast(90%);
    display: none;
  }

  .modal-header[data-type='work'] .card-icon img,
  .modal-header[data-type='education'] .card-icon img {
    display: block;
  }

  .modal-header .card-icon i {
    font-size: 2.5rem;
    color: #a6a6a6;
  }

  .individual-work-exp,
  .individual-education-exp {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    margin-top: 0;
  }

  .individual-work-exp-title {
    display: flex;
    align-items: center;
    gap: 0rem;
  }

  .individual-education-exp-title {
    display: flex;
    align-items: center;
    gap: 0rem;
  }

  .individual-education-exp-title h2 {
    font-size: 36px;
  }

  .individual-education-exp .card-icon img {
    height: 50px;
    filter: invert(80%) sepia(0%) saturate(0%) hue-rotate(137deg) brightness(82%) contrast(90%);
  }

  .individual-work-exp .fa-chevron-left,
  .individual-education-exp .fa-chevron-left {
    font-size: 2rem;
    cursor: pointer;
    color: #a6a6a6;
    margin-right: 1rem;
  }

  .individual-work-exp .card-icon img {
    height: 70px;
    filter: invert(80%) sepia(0%) saturate(0%) hue-rotate(137deg) brightness(82%) contrast(90%);
  }

  .individual-work-exp-info h3,
  .individual-education-exp-info h3,
  .individual-education-exp-info h4 {
    text-align: right;
  }

 .individual-work-exp-info p,
 .individual-education-exp-info p {
    text-align: right;
    color: #a6a6a6;
  }

  .individual-content strong {
    color: #fff;
    font-weight: bold;
  }

  .individual-content p,
  .individual-content li {
    line-height: 1.6;
    margin-top: 1.2em;
    margin-block: 1lh;
  }
    

  .close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: #a6a6a6;
    transition: color 0.3s ease;
  }

  .close-button:hover {
    color: #E8A222;
  }

  .hidden {
    display: none;
  }
  
  .footer p {
    margin: 0;
    font-size: 14px;
  }
  
  /* ------------------------------------------------------
     2) Medium devices (<= 1124px)
  ------------------------------------------------------ */
  @media (max-width: 1124px) {
    .modal {
      width: 600px;
      height: 500px;
      margin: 20px;
    }

    .site-header {
      width: 100%;
      justify-self: center;
    }
    .header-section {
      width: 74px;
      height: 74px;
    }
    .content {
      padding: 45px;
    }

    .about-content-all-cards {
      grid-template-columns: 1fr;
    }
  
    .project-content-all-cards {
      grid-template-columns: 1fr;
      gap: 30px;
    }
  
    .timeline-card,
    .about-content-card {
      width: 100%;
    }
  
    .form-group {
      margin-bottom: 29px;
    }

    .individual-education-exp-title h2,
    .individual-work-exp-title h2 {
      font-size: 28px;
    }
  }
  
  /* ------------------------------------------------------
     3) Small devices (<= 768px)
  ------------------------------------------------------ */
  @media (max-width: 768px) {
    .modal {
      width: 90%;
      height: 80vh;
      margin: 15px;
      padding: 1.5rem;
    }

    .modal-header {
      padding-bottom: 0.75rem;
      margin-bottom: 0.75rem;
    }

    html, body {
      overflow: visible;
    }
    .site-header {
      display: none;
    }
  
    /* Stack layout in one column */
    .container {
      display: flex;
      flex-direction: column;
      padding: 20px;
    }
  
    .sidebar {
      width: 100%;
      max-height: none;
      padding-top: 20px;
    }
  
    .main-area {
      width: 100%;
      display: flex;
      flex-direction: column;
    }
  
    /* "Dropdown" style header for mobile */
    .mobile-header {
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 75%;
      margin: 0 auto;
      position: relative;
      z-index: 5;
    }

    .dropdown-menu {
      display: flex;
      color: #fff;
      justify-content: space-between;
      align-items: center;
      background-color: #202425;
      padding: 15px 20px;
      border-radius: 5px;
      cursor: pointer;
      width: 100%;
      transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    }
    
    .dropdown-menu:hover {
      background-color: #2a2e2f;
      transform: translateY(-2px);
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }
    
    .menu-arrow i {
      transition: transform 0.3s ease;
    }

    .dropdown-menu.active {
      background-color: #373A3E;
      color: #E8A222;
      border-radius: 5px 5px 0 0;
    }

    .menu-content {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .mobile-menu-items {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      background-color: #202425;
      border-radius: 0 0 5px 5px;
      overflow: hidden;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
      z-index: 10;
      max-height: 0;
      opacity: 0;
      transition: max-height 0.4s ease-in-out, opacity 0.3s ease-in-out;
    }

    .mobile-menu-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 20px;
      color: #fff;
      transition: all 0.3s ease;
      transform: translateX(-20px);
      opacity: 0;
    }
    
    .mobile-menu-items.show .mobile-menu-item {
      transform: translateX(0);
      opacity: 1;
      transition: transform 0.4s ease, opacity 0.4s ease, background-color 0.3s ease, color 0.3s ease;
    }
    
    /* Staggered animation for menu items */
    .mobile-menu-items.show a:nth-child(1) .mobile-menu-item { transition-delay: 0.05s; }
    .mobile-menu-items.show a:nth-child(2) .mobile-menu-item { transition-delay: 0.1s; }
    .mobile-menu-items.show a:nth-child(3) .mobile-menu-item { transition-delay: 0.15s; }
    .mobile-menu-items.show a:nth-child(4) .mobile-menu-item { transition-delay: 0.2s; }
    .mobile-menu-items.show a:nth-child(5) .mobile-menu-item { transition-delay: 0.25s; }

    .mobile-menu-items a {
      display: block;
    }

    .mobile-menu-items.show {
      max-height: 500px; /* Adjust based on your menu height */
      opacity: 1;
    }

    .mobile-menu-items a.active .mobile-menu-item,
    .mobile-menu-item:hover {
      background-color: #373A3E;
      color: #E8A222;
    }
  

  
    .menu-content {
      display: flex;
      align-items: center;
    }
  
    /* Combine icon and arrow styling */
    .menu-icon,
    .menu-arrow {
      font-size: 14px;
    }
  
    .menu-icon {
      margin-right: 10px;
    }
  
    .menu-text {
      font-size: 18px;
      font-weight: bold;
    }
  
    /* Remove top negative margin on smaller screens */
    .profile-image {
      margin-top: -30px;
    }
  
    .content {
      width: 100%;
      margin-top: 0;
      min-height: 100vh;
      height: auto;
      overflow-y: auto;
      padding: 30px 20px;
    }

    .about-content-all-cards {
      grid-template-columns: 1fr;
    }

    .about-content-card {
      padding: 15px;
    }

    .about-content p {
      font-size: 16px;
      line-height: 1.6;
    }

    .project-content-all-cards {
      gap: 20px;
    }

    .individual-education-exp-title h2,
    .individual-work-exp-title h2 {
      font-size: 22px;
    }
  }