/* Add viewport meta tag for all screens */
html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

/* Improved responsive base styles for all screens */
img {
  height: auto;
}

/* Improved container responsiveness */
.container {
  width: 100%;
  padding-left: 15px;
  padding-right: 15px;
  margin: 0 auto;
  box-sizing: border-box;
}

@media screen and (max-width: 1400px) {
  .container {
    max-width: 1140px;
  }

  .logoipsum-slider figure {
    padding: 30px 18px;
  }

  .team-img {
    min-width: 277px;
  }
}

@media screen and (max-width: 1200px) {
  .container {
    max-width: 960px;
  }

  .team-img {
    min-width: 232px;
  }

  /* Reduce padding for sections */
  .hero,
  .logoipsum,
  .about,
  .portfolio-1,
  .service-1,
  .experience,
  .work,
  .team,
  #team,
  .pricing,
  .faq,
  .blog,
  footer {
    padding: 100px 0;
  }

  /* Adjust text padding for better fit */
  .portfolio-1 p,
  .blog p,
  .service-1 .col-lg-8 p,
  .footer-hr p {
    padding-right: 100px;
  }
}

@media screen and (max-width: 1000px) {
  /* Fix navigation toggle button for mobile */
  .navbar-toggler {
    display: block !important;
    position: absolute;
    right: 15px;
    top: 15px;
    z-index: 1000;
  }

  /* Show sidebar when opened */
  .sidepanel.active {
    left: 0;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.2);
  }

  /* Improved header menu for mobile */
  .navbar-nav,
  .nav-right {
    display: none !important;
  }

  .navbar {
    padding: 20px 0;
  }

  /* Adjust search form on mobile */
  #search-bar form {
    width: 85%;
  }
}

@media screen and (max-width: 960px) {
  .container {
    max-width: 95%;
  }

  .feature .flex {
    flex-wrap: wrap;
  }

  .header-card {
    width: 50%;
  }

  .header-card:nth-child(3),
  .header-card:nth-child(4) {
    margin: 0;
  }

  .feature h4 {
    width: 100%;
    margin: 19px 0 15px 0;
  }

  /* Improve video backgrounds */
  video {
    object-fit: cover;
    width: 100%;
    height: 100%;
  }

  /* Adjust padding for better mobile view */
  .work-para,
  .footer-hr p,
  .portfolio-1 p,
  .blog p {
    padding: 0 50px;
  }
}

@media screen and (max-width: 992px) {
  .footer-main {
    gap: 30px;
  }

  .footer-brand {
    min-width: 100%;
    max-width: 100%;
    text-align: center;
  }

  .footer-address {
    text-align: center;
  }

  .footer-social {
    justify-content: center;
  }

  .footer-links {
    width: 100%;
    justify-content: space-between;
  }

  .footer-links-column h4::after,
  .footer-contact h4::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .footer-links-column h4,
  .footer-contact h4 {
    text-align: center;
  }

  .footer-links-column ul {
    text-align: center;
  }

  .footer-links-column a:hover {
    transform: translateY(-3px);
  }

  .contact-items {
    align-items: center;
  }

  .contact-item:hover {
    transform: translateY(-5px);
  }

  .newsletter-content {
    text-align: center;
    margin: 0 auto;
  }

  .newsletter-form .form-group {
    margin: 0 auto;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer-legal {
    justify-content: center;
  }
}

@media screen and (max-width: 768px) {
  .container {
    max-width: 100%;
    padding-left: 20px;
    padding-right: 20px;
  }

  .hero-social-icon {
    position: relative;
    flex-direction: row !important;
    justify-content: center !important;
  }

  .hero-social-icon hr {
    display: none;
  }

  .team-img {
    min-width: 232px;
    object-position: center;
    background-repeat: no-repeat;
  }

  /* Fix responsive typography */
  h1 {
    font-size: 60px;
    font-weight: 800;
    line-height: 66px;
  }

  h2 {
    font-size: 34px;
    font-weight: 800;
    line-height: 48px;
  }

  h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 24px;
  }

  h4 {
    font-size: 16px;
    font-weight: 700;
    line-height: 22px;
  }

  h5 {
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
  }

  h6 {
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
  }

  p {
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
  }

  button {
    font-size: 14px;
    font-weight: 400;
    line-height: 18px;
    padding: 14px 30px 14px 30px;
  }

  a {
    font-size: 14px;
    font-weight: 400;
    line-height: 18px;
    padding: 14px 30px 14px 30px !important;
  }

  .h2_margin {
    margin: 13px 0;
  }

  /* Properly adjust section padding */
  .hero {
    padding: 110px 0 180px 0;
  }

  .ab-feature {
    padding: 10px 0 60px 0;
  }

  .logoipsum {
    padding: 80px 0;
  }

  .logoipsum .hr1 {
    width: 80px;
    margin: 0 auto 33px auto;
  }

  .logoipsum .hr2 {
    width: 80px;
    margin: 33px auto 0 auto;
  }

  .logoipsum-slider {
    margin-top: 12px;
  }

  .logoipsum .slide figure {
    padding: 0 25px;
    width: 200px;
  }

  .logoipsum .slide img {
    max-height: 140px;
    width: auto;
  }

  .about {
    padding: 70px 0;
  }

  .ab-count {
    width: 155px;
    height: 155px;
  }

  .ab-count h5 {
    width: 110px;
  }

  .portfolio-1 {
    padding: 70px 0 70px 0;
  }

  .gallary {
    padding-bottom: 70px;
  }

  .tab button {
    padding: 11px 19px;
  }

  .gallary img {
    height: 300px;
  }

  .gallary img[alt="sm_img"] {
    height: 150px;
  }

  .gallary .container {
    margin-top: -355px;
  }

  .gallary .mt {
    margin-top: -258px;
  }

  .service-1 {
    padding: 70px 0;
  }

  .service-1 .flex-column {
    flex-wrap: wrap;
  }

  .service-card {
    width: 100%;
    margin: 15px 0;
    height: auto;
    min-height: 500px;
  }

  .service-1 .s-card {
    flex-wrap: wrap;
  }

  .service-card img[alt="slider1"] {
    width: 85px;
  }

  .service-card img[alt="slider2"] {
    width: 62px;
  }

  .service-card img[alt="slider3"] {
    width: 52px;
  }

  .experience {
    padding: 70px 0;
  }

  .ex-card .flex {
    padding: 26px 2px;
  }

  .ex-card p {
    margin-top: 5px;
  }

  .work-line div {
    padding: 33px 8px 32px 29px;
  }

  .work {
    padding: 70px 0;
  }

  .work-para {
    padding: 0 30px;
  }

  .work-line div:first-child {
    width: 185px;
    min-height: 185px;
  }

  .work-line div:nth-child(2) {
    width: 170px;
    min-height: 170px;
  }

  .work-line div:nth-child(3) {
    width: 185px;
    min-height: 185px;
  }

  .work-line div:last-child {
    width: 170px;
    min-height: 170px;
  }

  .testimonial {
    padding: 120px 0 70px 0;
  }

  .team {
    padding: 70px 0 0 0;
  }

  #team {
    padding: 70px 0 70px 0;
  }

  .overlay_text i {
    font-size: 18px;
  }

  .team-btn {
    margin-top: 70px;
  }

  .team h2 {
    padding: 0;
  }

  .team p {
    padding: 0;
  }

  .pricing {
    padding: 70px 0;
  }

  #pricing {
    padding: 70px 0;
  }

  .pricing-hr {
    display: none !important;
  }

  .faq {
    padding: 70px 0;
  }

  #faq {
    padding: 70px 0;
  }

  .faq .text-center h2 {
    padding: 0 10px 0 0;
  }

  .faq .text-center p {
    padding: 0 10px 0 0;
  }

  .blog {
    padding: 70px 0;
  }

  .footer-hr p {
    padding: 0 30px;
  }

  .service-page {
    padding: 70px 0 50px 0;
  }

  /* Improve contact form */
  .contact form {
    padding: 30px;
  }

  .contact-address hr {
    display: none;
  }

  /* Fix flexbox layouts */
  .flex-sb {
    flex-wrap: wrap;
  }

  .w-50 {
    width: 100%;
  }

  .about-imgs {
    margin-top: 50px;
  }

  /* Fix footer form */
  #footer-form {
    overflow: hidden;
    width: 100%;
    justify-content: center;
    flex-direction: column;
  }

  #footer-form input {
    width: 100%;
    padding: 20px;
    margin-bottom: 10px;
  }

  #footer-form button {
    width: 100%;
  }

  .blog p {
    padding: 0;
  }

  /* Make footer more responsive */
  .footer-menu .flex-start {
    flex-direction: column;
    align-items: center;
  }

  /* Fix image display in mobile */
  .about-imgs img,
  .experience_mask img {
    max-width: 100%;
    margin: 0 auto;
    display: block;
  }

  .footer-links {
    flex-direction: column;
    gap: 40px;
  }

  .footer-links-column {
    min-width: 100%;
  }

  .newsletter-form .form-group {
    flex-direction: column;
    gap: 15px;
  }

  .newsletter-form button {
    width: 100%;
  }

  /* Fix work section positioning */
  .work-hr {
    right: -40px;
  }
}

@media screen and (max-width: 630px) {
  /* Improve header cards */
  .header-card {
    width: 100%;
    margin: 10px 0;
    padding: 0 15px;
  }

  /* Fix gallery layout */
  .gallary .w-33,
  .gallary .w-66 {
    width: 100%;
  }

  /* Center portfolio items */
  .portfo-center {
    width: 100% !important;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  /* Fix alignment for all gap elements */
  .portfo-center .gap-1,
  .service-data .gap-1,
  .exp-center .gap-1,
  .blog-center .gap-1,
  .team-center .gap-1 {
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
  }

  /* Full-width layout for all sections */
  .portfo-center .w-50,
  .portfo-center .w-100,
  .service-data .w-66,
  .service-data .w-33,
  .exp-center .w-66,
  .exp-center .w-33,
  .blog-center .w-33,
  .blog-center .w-66,
  .team-center .w-66,
  .team-center .w-33,
  .w-33,
  .w-66 {
    width: 100% !important;
    max-width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
    margin: 10px 0;
  }

  /* Wrap team and blog sections properly */
  .team-center,
  .blog-center,
  .flex-column {
    flex-wrap: wrap;
  }

  /* Single column cards */
  .blog-cards {
    flex-wrap: wrap;
  }

  .blog-card {
    flex: none !important;
    width: 100%;
    margin-bottom: 20px;
    height: auto;
    min-height: 400px;
  }

  .portfo-center .w-100 {
    margin-top: 1rem;
  }

  .portfolio-1 p {
    padding: 0;
  }

  /* Service cards at full width */
  .service-card {
    width: 100%;
    margin: 15px 0;
    height: auto;
    min-height: 500px;
  }

  /* Fix work section spacing */
  .work-para {
    padding: 0 10px;
  }

  /* Fix process flow on mobile */
  .work-line {
    background-image: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    margin: 80px 0;
  }

  .work-line div {
    position: relative !important;
    padding: 20px !important;
    text-align: center;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    margin: 10px 0;
    width: 180px !important;
    height: 180px !important;
    min-height: unset !important;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1/1;
    border-radius: 50% !important;
  }

  .work-line h4 {
    padding: 0 10px;
    text-align: center;
  }

  .work-hr {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    display: flex;
    justify-content: center;
    margin-top: 30px;
    width: 100%;
    margin-bottom: 20px;
  }

  .work-hr h6 {
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-left: 10px;
  }

  /* Stack pricing cards */
  .pricing-card {
    flex-wrap: wrap;
    gap: 20px;
  }

  .pricing p {
    padding: 0 10px;
  }

  /* Remove scaling to keep consistent layout */
  .pricing-card div:nth-child(2) {
    transform: scale(1);
  }

  .pricing-card {
    align-items: center;
  }

  /* Fix pricing cards */
  .pricing-card div {
    padding: 40px 20px;
  }

  .blog p {
    padding: 0;
  }

  /* Improve footer layout */
  .footer-menu .flex-start {
    flex-wrap: wrap;
    align-items: center !important;
    justify-content: center !important;
  }

  .footer-center .w-33,
  .footer-center .w-16,
  .footer-center .w-16,
  .footer-center .w-33 {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px 0;
  }

  .footer-menu p {
    text-align: center;
    padding: 0;
  }

  .footer-menu a {
    text-align: center;
  }

  .footer-menu h4 {
    text-align: center;
  }

  /* Fix team image sizes */
  .team-img {
    width: 100%;
    min-width: unset;
    max-width: 250px;
  }

  .team-slider {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Adjust search form */
  #search-bar form {
    width: 90%;
  }

  /* Fix fixed position elements */
  .header-right-sidebar {
    width: 100%;
    right: -100%;
  }

  /* Better hero section */
  .hero h1 {
    font-size: 42px;
    line-height: 1.3;
    letter-spacing: 2px;
  }

  /* Fix video backgrounds */
  video {
    object-fit: cover;
    height: 100%;
  }
}

@media screen and (max-width: 500px) {
  /* Fix partner logos on small screens */
  .logoipsum .slide figure {
    padding: 0 20px;
    width: 160px;
  }

  .logoipsum .slide img {
    max-height: 70px;
  }

  /* Improved typography for small devices */
  h1 {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
  }

  h2 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
  }

  h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
  }

  h4 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
  }

  h5 {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
  }

  h6 {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
  }

  p {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
  }

  /* More appropriate button sizing for small screens */
  button,
  a.btn_hover1,
  a.btn_hover2 {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    padding: 10px 20px !important;
    white-space: nowrap;
  }

  a {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    padding: 10px 20px !important;
  }

  /* Improve spacing for mobile */
  .hero,
  .about,
  .portfolio-1,
  .service-1,
  .experience,
  .work,
  .team,
  #team,
  .pricing,
  .faq,
  .blog,
  footer {
    padding: 50px 0;
  }

  /* Adjust header for better mobile experience */
  .header {
    padding: 15px 0;
  }

  /* Spacing adjustments */
  .mb-15 {
    margin-bottom: 10px !important;
  }

  /* Service cards adjustments */
  .service-card {
    padding: 25px 15px;
  }

  /* Fix for tabs */
  .tab {
    justify-content: center;
  }

  .tab button {
    margin: 5px;
    padding: 8px 15px;
  }

  /* Fix accordion in FAQ section */
  .accordion-button {
    padding: 15px;
    font-size: 14px;
  }

  /* Hero section adjustments */
  .hero {
    padding: 40px 0 100px 0;
  }

  /* Improve background attachment for mobile */
  .header-index,
  .experience,
  .work,
  .team,
  .faq {
    background-attachment: scroll;
  }
}

@media screen and (max-width: 400px) {
  /* Further typography optimization for very small screens */
  h1 {
    font-size: 32px;
    line-height: 1.2;
  }

  h2 {
    font-size: 24px;
    line-height: 1.3;
  }

  /* Extra small screen adjustments */
  .hero {
    padding: 40px 0 80px 0;
  }

  /* Simplify layout for xs screens */
  .work-line div {
    width: 160px !important;
    height: 160px !important;
    padding: 15px !important;
  }

  .work-line div h2 {
    font-size: 1.8rem;
    margin-bottom: 5px;
  }

  .work-line div h4 {
    font-size: 0.9rem;
    line-height: 1.2;
  }

  /* Smaller buttons for very small screens */
  button,
  a.btn_hover1,
  a.btn_hover2 {
    padding: 8px 16px !important;
  }

  a {
    padding: 8px 16px !important;
  }

  /* Better navigation for xs screens */
  .sidepanel {
    width: 100%;
    left: -100%;
  }

  /* Adjust footer form */
  footer form {
    width: 95%;
  }
}

@media screen and (max-width: 576px) {
  footer {
    padding-top: 60px;
  }

  .footer-main {
    margin-bottom: 40px;
  }

  .footer-newsletter {
    padding: 20px;
  }

  .contact-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .contact-info {
    align-items: center;
  }

  .footer-legal {
    flex-direction: column;
    gap: 10px;
  }
}
