/* Responsive styles */
@media only screen and (max-width: 767px) {
  /* General responsive fixes */
  body {
    overflow-x: hidden;
  }
  
  /* Container adjustments */
  .container, .container-fluid {
    padding-left: 30px;
    padding-right: 5px;
  }
  
  /* Make images responsive */
  img {
    max-width: 100%;
    height: auto;
  }
  
  /* Navigation menu adjustments */
  .navbar-toggler {
    display: block;
  }
  
  .navbar-nav {
    flex-direction: column;
    width: 100%;
  }
  
  /* Typography adjustments */
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  h3 {
    font-size: 1.5rem;
  }
  
  /* Spacing adjustments */
  .section {
    padding: 40px 0;
  }
  
  /* Grid adjustments */
  .row {
    margin-left: -10px;
    margin-right: -10px;
  }
  
  .col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, 
  .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
    padding-left: 5px;
    padding-right: 5px;
  }
  
  /* Common responsive class adjustments */
  .d-flex {
    flex-direction: column;
  }
  
  /* Stack elements vertically on mobile */
  .mobile-stack {
    display: flex;
    flex-direction: column;
  }
  
  /* Center elements on mobile */
  .mobile-center {
    text-align: center;
  }
  
  /* Adjust button sizes */
  .btn {
    padding: 8px 16px;
    font-size: 0.9rem;
  }
  
  /* Fix for tables on mobile */
  table {
    display: block;
    overflow-x: auto;
    width: 100%;
  }

  /* Fix horizontal scrolling in all sections */
  section {
    max-width: 100vw;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
  }

  /* Fix all containers that might cause horizontal scrolling */
  .about, .skills-section, .projects-section, .container {
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
    padding-left: 10px;
    padding-right: 10px;
    box-sizing: border-box;
  }

  /* Fix scrollbar issues in the projects grid */
  .projects-grid {
    max-width: 100%;
    overflow-x: hidden;
    margin-left: 0;
    margin-right: 0;
    padding: 0 5px;
  }

  /* Fix project cards causing overflow */
  .project-card {
    width: 100%;
    margin: 0 0 20px 0;
  }

  /* Fix hero section */
  .hero, .hero-content {
    max-width: 100%;
    overflow-x: hidden;
    padding-left: 10px;
    padding-right: 10px;
  }

  /* Fix skills slideshow */
  .modern-skills-container {
    max-width: 100%;
    padding: 0 10px;
    overflow: hidden;
  }

  .skill-slideshow, .logo-slideshow-container {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Hide card move buttons in Professional Journey section for mobile */
  .timeline-swipe-controls,
  .swipe-btn,
  .card-control-btn {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  
  /* Also hide any other navigation elements that might control card movement */
  .timeline-content-wrapper .prev-card-btn,
  .timeline-content-wrapper .next-card-btn,
  .timeline-content-wrapper .card-navigation {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }

  /* Fix certifications section */
  .certifications-section {
    max-width: 100%;
    overflow-x: hidden;
    padding: 40px 0;
  }

  .certifications-container {
    padding: 0 10px;
    gap: 15px;
  }

  .certification-card {
    margin: 0 0 15px 0;
    width: 100%;
  }
}

/* Small mobile devices */
@media only screen and (max-width: 480px) {
  /* Further size reductions */
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.25rem;
  }
  
  .section {
    padding: 30px 0;
  }
  
  /* Full width on extra small screens */
  .col-xs-12 {
    width: 100%;
  }

  /* Additional padding adjustments for extra small screens */
  .container, .container-fluid, section {
    padding-left: 10px;
    padding-right: 10px;
  }

  /* Fix skills logo slideshow on very small screens */
  .logo-slide {
    margin: 0 10px;
  }
  
  .logo-slide img {
    width: 40px;
    height: 40px;
  }

  /* Make project cards more compact on small screens */
  .project-card {
    padding: 10px;
  }

  .project-details {
    padding: 10px;
  }

  /* Fix the project media gallery overflow */
  .project-media-gallery {
    max-width: 100%;
    overflow-x: hidden;
  }

  .media-thumbnails {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
  }
}

/* Tablet and Mobile Styles for Professional Journey Section */
@media only screen and (max-width: 991px) {
  /* Timeline block modifications for mobile */
  .timeline-block {
    position: relative !important;
    opacity: 0;
    visibility: hidden;
    transform: none !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    filter: none !important;
    animation: none !important;
  }
  
  /* Active timeline block for mobile */
  .timeline-block.active {
    opacity: 1;
    visibility: visible;
    transform: none !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  }
  
  /* Remove all animation classes on mobile */
  .timeline-block.prev,
  .timeline-block.next,
  .timeline-block.to-center,
  .timeline-block.from-center,
  .timeline-block.with-stick {
    animation: none !important;
    transform: none !important;
  }
  
  /* Timeline content wrapper adjustment */
  .timeline-content-wrapper {
    min-height: auto !important;
    height: auto !important;
    perspective: none !important;
    overflow: visible;
    max-width: 100%;
  }
  
  /* Ensure proper spacing between timeline blocks */
  .timeline-block {
    margin-bottom: 20px;
  }
  
  /* Enhance timeline navigation buttons for mobile */
  .timeline-nav-btn {
    padding: 8px 15px;
    font-size: 14px;
    flex: 1 0 auto;
    min-width: 30%;
    text-align: center;
    justify-content: center;
    position: relative;
    z-index: 30;
    cursor: pointer;
    outline: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  }
  
  .timeline-nav-btn.active {
    background-color: rgba(30, 144, 255, 0.8);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
  }
  
  .timeline-nav-btn:focus {
    outline: none;
  }
  
  /* Improve indication that these are clickable */
  .timeline-nav-btn:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid transparent;
    transition: all 0.3s ease;
    opacity: 0;
  }
  
  .timeline-nav-btn.active:after {
    border-top-color: rgba(30, 144, 255, 0.8);
    opacity: 1;
    bottom: -8px;
  }

  /* Improve education items display */
  .education-item {
    padding: 15px;
  }
  
  .education-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .education-date-container {
    margin-top: 10px;
    align-items: flex-start;
    width: 100%;
  }
  
  /* Fix the goals list on mobile */
  .career-goals-list li {
    padding: 12px;
  }
  
  .goal-content h4 {
    font-size: 18px;
  }
  
  .goal-content p {
    font-size: 14px;
  }

  /* Fix horizontal scrolling in projects section */
  .projects-section .container {
    max-width: 100%;
    padding: 0 10px;
    margin: 0;
    overflow-x: hidden;
  }

  /* Ensure project details don't overflow */
  .project-details, .project-summary {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Fix media gallery overflow */
  .main-media {
    width: 100%;
    max-width: 100%;
  }

  .main-media img, 
  .main-media video {
    width: 100%;
    height: auto;
    max-width: 100%;
  }

  /* Hide card movement controls specifically in Professional Journey section */
  #skills .swipe-btn,
  #skills .timeline-swipe-controls,
  #professional-journey + div .swipe-btn,
  .timeline-content-wrapper .card-navigation-controls,
  .timeline-content-wrapper .swipe-controls {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }
  
  /* Hide any media navigation buttons that might trigger card movements */
  .timeline-content-wrapper .media-control-btn:not(.prev-media):not(.next-media) {
    display: none !important;
  }
}

/* Additional fixes for very small screens */
@media only screen and (max-width: 480px) {
  /* Further adjustments for very small screens */
  .timeline-nav-btn {
    min-width: 30%;
    margin: 3px;
    padding: 6px 10px;
    font-size: 12px;
  }
  
  .timeline-nav-btn i {
    font-size: 14px;
    margin-right: 3px;
  }
  
  /* Make active button more prominent */
  .timeline-nav-btn.active {
    transform: scale(1.05);
  }
  
  /* Make education items more compact */
  .education-item {
    padding: 12px;
    margin-bottom: 15px;
  }
  
  .education-header h3 {
    font-size: 16px;
  }
  
  .education-item h4 {
    font-size: 14px;
  }
  
  /* More compact timeline responsibilities */
  .timeline-responsibilities h5 {
    font-size: 15px;
  }
  
  .timeline-responsibilities ul li {
    font-size: 13px;
    padding: 4px 0;
  }

  /* Prevent overflow in technical skills logo slideshow */
  .modern-skills-container {
    width: 100%;
    max-width: 100%;
    padding: 0 5px;
    overflow: hidden;
  }

  /* Adjust padding for containers */
  .container, .container-fluid {
    padding-left: 5px;
    padding-right: 5px;
  }

  /* Fix project cards on very small screens */
  .project-card {
    margin-left: 0;
    margin-right: 0;
  }

  .project-summary, .project-details {
    padding: 10px;
  }

  /* Fix long text in project descriptions */
  .project-overview {
    word-break: break-word;
  }
}

/* Fix for section title background text overflow */
@media only screen and (max-width: 767px) {
  .section-title.with-bg-text::before {
    width: 300%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  /* Fix specific sections */
  #projects, #skills, #certifications, #contact {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }

  /* Fix the detailed tech stack display */
  .detailed-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }

  .detailed-tech-stack span {
    margin: 3px;
    font-size: 12px;
  }
}
