/* Responsive Design Enhancements for Purav Portfolio */

/* Global overflow prevention */
html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

/* Ensure all containers don't overflow */
.container, .container-fluid {
  overflow-x: hidden;
  max-width: 100%;
}

/* Prevent table overflow */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Extra Small Devices (phones, 576px and down) */
@media (max-width: 575.98px) {
  /* About Section - Extra small screens */
  #about .row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 15px;
  }

  #about .col-md-3 {
    flex: 0 0 80px;
    max-width: 80px;
  }

  #about .col-md-9 {
    flex: 1;
    text-align: left;
  }

  #about .img-thumbnail {
    max-width: 80px;
    width: 100%;
    height: auto;
  }

  #about .title {
    font-size: 18px;
    margin-bottom: 3px;
  }

  #about .subtitle {
    font-size: 14px;
    margin-bottom: 10px;
  }

  #about p {
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 8px;
  }

  #about .btn {
    font-size: 12px;
    padding: 6px 12px;
  }
  /* General responsive improvements */
  body {
    font-size: 14px;
    overflow-x: hidden; /* Prevent horizontal scrolling */
    width: 100%;
  }

  .container {
    padding-left: 15px;
    padding-right: 15px;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Ensure all sections don't overflow */
  .section {
    overflow-x: hidden;
    width: 100%;
  }
  /* Header Section */
  .header {
    height: auto;
    min-height: 100vh;
    padding: 80px 0 40px;
    overflow-x: hidden;
    width: 100%;
  }

  .header .container {
    flex-direction: column;
    text-align: center;
    padding: 0 15px;
  }

  .header .container .infos {
    margin: 0;
    margin-bottom: 30px;
    order: 2;
  }

  .header .container .infos .subtitle {
    font-size: 18px;
  }

  .header .container .infos .title {
    font-size: 42px;
    line-height: 1.2;
  }

  .header .container .infos p {
    font-size: 18px;
  }

  .header .container .infos .btn {
    display: block;
    margin: 10px auto;
    width: 200px;
    max-width: 100%;
  }

  .header .container .img-holder {
    order: 1;
    align-self: center;
    padding: 0;
    margin-bottom: 30px;
  }

  .header .container .img-holder img {
    position: relative;
    max-width: 280px;
    width: 100%;
    height: auto;
    max-width: 100%;
  }

  /* Widget */
  .header .widget {
    flex-direction: column;
    border-radius: 20px;
    padding: 15px;
    margin: 20px 15px;
    max-width: calc(100% - 30px);
    overflow-x: hidden;
  }

  .header .widget .widget-item {
    border-right: none;
    border-bottom: 1px solid #dee2e6;
    padding: 15px 0;
  }

  .header .widget .widget-item:last-child {
    border-bottom: none;
  }

  /* Navigation */
  .navbar {
    padding: 10px 15px;
    overflow-x: hidden;
    width: 100%;
  }

  .navbar .container {
    overflow-x: hidden;
  }

  .navbar .navbar-brand img {
    width: 60px;
  }

  .navbar .navbar-nav .nav-link {
    font-size: 14px;
    margin: 5px 0;
    text-align: center;
  }

  /* Sections */
  .section {
    padding: 3rem 0;
  }

  /* About Section - Small screens */
  #about .row {
    text-align: center;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
  }

  #about .col-md-3 {
    margin-bottom: 0;
    flex: 0 0 120px;
    max-width: 120px;
  }

  #about .col-md-9 {
    flex: 1;
    text-align: left;
  }

  #about .img-thumbnail {
    max-width: 120px;
    width: 100%;
    height: auto;
    margin: 0;
  }

  #about .pl-md-4 {
    padding-left: 0 !important;
  }

  #about .title {
    font-size: 20px;
    margin-bottom: 5px;
  }

  #about .subtitle {
    font-size: 16px;
    margin-bottom: 15px;
  }

  #about p {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
  }

  #about .btn {
    font-size: 14px;
    padding: 8px 16px;
  }

  /* Service Section */
  .custom-card {
    margin-bottom: 20px;
  }

  .custom-card .card-body {
    padding: 20px 15px;
  }

  .custom-card .card-body h5 {
    font-size: 16px;
  }

  /* Skills Section */
  .progress {
    margin-bottom: 20px;
  }

  /* Portfolio Section */
  .img-wrapper {
    margin-bottom: 20px;
    overflow: hidden;
    width: 100%;
  }

  .img-wrapper img {
    width: 100%;
    height: auto;
    max-width: 100%;
  }

  /* Testimonial Section */
  .testmonial-card {
    margin: 0 15px;
    max-width: calc(100% - 30px);
    overflow-x: hidden;
  }

  .testmonial-card img {
    width: 80px;
    height: 80px;
  }

  .testmonial-card .title {
    font-size: 18px;
  }

  .testmonial-card .subtitle {
    font-size: 14px;
  }

  /* Blog Section */
  .card {
    margin-bottom: 20px;
  }

  /* Contact Section */
  .contact {
    padding: 20px 15px;
    overflow-x: hidden;
    width: 100%;
  }

  .contact .form {
    margin-bottom: 30px;
  }

  .contact .contact-infos {
    display: block;
  }

  .contact .contact-infos .item {
    margin-bottom: 20px;
    text-align: center;
  }

  /* Footer */
  .page-footer {
    padding: 20px 15px;
    overflow-x: hidden;
    width: 100%;
  }

  .page-footer .row {
    height: auto;
    text-align: center;
  }

  .page-footer .socials {
    margin: 20px auto 0;
  }

  /* Map */
  #map {
    position: relative;
    height: 300px;
    overflow: hidden;
    width: 100%;
  }

  #map iframe {
    width: 100% !important;
    max-width: 100%;
  }

  /* Hire Me Section */
  .bg-gray .card {
    margin: 0 15px;
    max-width: calc(100% - 30px);
    overflow-x: hidden;
  }

  .bg-gray .card-body {
    padding: 20px;
  }

  .bg-gray .btn {
    margin-top: 15px;
  }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
  .header .container .infos .title {
    font-size: 52px;
  }

  .header .container .img-holder img {
    max-width: 350px;
  }

  .header .widget {
    flex-direction: row;
    margin: 20px 30px;
  }

  .header .widget .widget-item {
    border-right: 1px solid #dee2e6;
    border-bottom: none;
  }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
  /* Prevent horizontal scrolling */
  body {
    overflow-x: hidden;
  }

  .container {
    overflow-x: hidden;
  }
  .header .container {
    flex-direction: row;
    align-items: center;
  }

  .header .container .infos {
    margin-left: 0;
    margin-right: 30px;
    order: 1;
  }

  .header .container .img-holder {
    order: 2;
    align-self: center;
  }

  .header .container .img-holder img {
    position: relative;
    max-width: 400px;
  }

  .header .widget {
    flex-direction: row;
  }

  .header .widget .widget-item {
    border-right: 1px solid #dee2e6;
    border-bottom: none;
  }

  /* Portfolio Grid */
  .img-wrapper {
    margin-bottom: 30px;
  }

  /* About Section - Medium screens */
  #about .row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 30px;
  }

  #about .col-md-3 {
    flex: 0 0 150px;
    max-width: 150px;
  }

  #about .col-md-9 {
    flex: 1;
    text-align: left;
  }

  #about .img-thumbnail {
    max-width: 150px;
  }

  /* Contact Section */
  .contact {
    display: flex;
    flex-direction: row;
    gap: 30px;
  }

  .contact .form {
    flex: 1;
    margin-bottom: 0;
  }

  .contact .contact-infos {
    flex: 1;
    display: block;
  }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) {
  /* Prevent horizontal scrolling */
  body {
    overflow-x: hidden;
  }

  .container {
    overflow-x: hidden;
  }
  .header .container .infos {
    margin-left: 25%;
  }

  .header .container .img-holder img {
    position: absolute;
    max-width: 620px;
  }

  .header .widget {
    flex-direction: row;
  }

  .header .widget .widget-item {
    border-right: 1px solid #dee2e6;
  }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .header .container .infos .title {
    font-size: 74px;
  }

  .header .container .img-holder img {
    max-width: 700px;
  }
}

/* Landscape Orientation for Mobile */
@media (max-width: 767.98px) and (orientation: landscape) {
  .header {
    min-height: 100vh;
    padding: 60px 0 20px;
  }

  .header .container .infos .title {
    font-size: 36px;
  }

  .header .container .img-holder img {
    max-width: 250px;
  }

  .header .widget {
    flex-direction: row;
    padding: 10px;
  }

  .header .widget .widget-item {
    border-right: 1px solid #dee2e6;
    border-bottom: none;
    padding: 10px 0;
  }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .header .container .img-holder img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Print Styles */
@media print {
  .navbar,
  .header .widget,
  .socials,
  #map,
  .page-footer {
    display: none !important;
  }

  .header {
    height: auto;
    min-height: auto;
    padding: 20px 0;
  }

  .section {
    padding: 20px 0;
    page-break-inside: avoid;
  }

  .img-wrapper .overlay {
    display: none !important;
  }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #ff7a57;
    --secondary: #6c757d;
  }
}

/* Focus Styles for Better Accessibility */
.nav-link:focus,
.btn:focus,
.form-control:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  .img-wrapper .overlay {
    opacity: 1;
    background: rgba(0, 0, 0, 0.7);
  }

  .img-wrapper .overlay .overlay-infos {
    transform: translateY(0);
  }

  .btn {
    min-height: 44px;
    padding: 12px 20px;
  }

  .navbar .navbar-nav .nav-link {
    padding: 12px 15px;
  }
}

/* Container Responsive Adjustments */
@media (max-width: 575.98px) {
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* Typography Responsive Adjustments */
@media (max-width: 767.98px) {
  .section-title {
    font-size: 28px;
  }

  .subtitle {
    font-size: 16px;
  }

  h1, .h1 { font-size: 2rem; }
  h2, .h2 { font-size: 1.75rem; }
  h3, .h3 { font-size: 1.5rem; }
  h4, .h4 { font-size: 1.25rem; }
  h5, .h5 { font-size: 1.1rem; }
  h6, .h6 { font-size: 1rem; }
}

/* Form Responsive Improvements */
@media (max-width: 575.98px) {
  .form-control {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .btn {
    font-size: 16px;
    padding: 12px 20px;
  }
}

/* Carousel Responsive Adjustments */
@media (max-width: 767.98px) {
  .carousel {
    overflow: hidden;
    width: 100%;
  }

  .carousel .carousel-indicators {
    bottom: -40px;
  }

  .carousel .carousel-indicators li {
    width: 10px;
    height: 10px;
  }

  .carousel-inner {
    overflow: hidden;
  }
}

  /* Social Icons Responsive */
  @media (max-width: 575.98px) {
    .socials {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 10px;
      overflow-x: hidden;
    }

    .socials .social-item {
      width: 40px;
      height: 40px;
      font-size: 18px;
      line-height: 40px;
      flex-shrink: 0;
    }
  }

/* Progress Bar Responsive */
@media (max-width: 575.98px) {
  .progress .progress-bar span {
    font-size: 12px;
    bottom: 15px;
  }
}

/* Card Responsive Improvements */
@media (max-width: 767.98px) {
  .card {
    margin-bottom: 20px;
  }

  .card-body {
    padding: 20px 15px;
  }
}

/* Image Responsive Improvements */
@media (max-width: 575.98px) {
  .img-fluid {
    max-width: 100%;
    height: auto;
  }

  .img-thumbnail {
    max-width: 100%;
    height: auto;
  }
}

/* Utility Classes for Responsive Design */
.d-mobile-none {
  display: none;
}

@media (min-width: 768px) {
  .d-mobile-none {
    display: block;
  }
}

.d-desktop-none {
  display: block;
}

@media (min-width: 768px) {
  .d-desktop-none {
    display: none;
  }
}

/* Spacing Utilities for Mobile */
@media (max-width: 575.98px) {
  .mt-mobile-3 {
    margin-top: 1rem !important;
  }

  .mb-mobile-3 {
    margin-bottom: 1rem !important;
  }

  .pt-mobile-3 {
    padding-top: 1rem !important;
  }

  .pb-mobile-3 {
    padding-bottom: 1rem !important;
  }
} 