/* Complete Mobile Fixes - Updated */

/* Force mobile menu button to show on mobile */
@media (max-width: 992px) {
  .header__navigation {
    display: none !important;
  }
  
  .mobile-menu-toggle {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: 3.5rem !important;
    height: 3.5rem !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0.5rem !important;
    gap: 0.4rem !important;
    z-index: 10000 !important;
    position: relative !important;
  }
  
  .mobile-menu-toggle span {
    display: block !important;
    width: 2.2rem !important;
    height: 0.3rem !important;
    background-color: var(--t-bright) !important;
    border-radius: 0.2rem !important;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
    transform-origin: center !important;
  }
  
  .mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(0.6rem, 0.6rem) !important;
  }
  
  .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0 !important;
    transform: scale(0) !important;
  }
  
  .mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(0.6rem, -0.6rem) !important;
  }
  
  .mobile-menu-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(17, 17, 17, 0.98) !important;
    backdrop-filter: blur(15px) !important;
    z-index: 9999 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    transform: translateY(-100%) !important;
  }
  
  .mobile-menu-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
  }
  
  .mobile-menu-overlay .menu__list {
    flex-direction: column !important;
    gap: 4rem !important;
    text-align: center !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  .mobile-menu-overlay .menu__link {
    font-size: 2.4rem !important;
    font-weight: 600 !important;
    color: var(--t-bright) !important;
    text-decoration: none !important;
    padding: 1.5rem 3rem !important;
    border-radius: 1rem !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 1rem !important;
    border: 2px solid transparent !important;
  }
  
  .mobile-menu-overlay .menu__link:hover {
    color: var(--accent) !important;
    background: rgba(135, 206, 235, 0.1) !important;
    border-color: var(--accent) !important;
    transform: translateY(-3px) !important;
  }
  
  .mobile-menu-overlay .menu__link i {
    font-size: 2rem !important;
  }
  
  .mobile-menu-close {
    position: absolute !important;
    top: 3rem !important;
    right: 3rem !important;
    background: transparent !important;
    border: none !important;
    color: var(--t-bright) !important;
    font-size: 4rem !important;
    cursor: pointer !important;
    z-index: 10001 !important;
    transition: all 0.3s ease !important;
  }
  
  .mobile-menu-close:hover {
    color: var(--accent) !important;
    transform: rotate(90deg) !important;
  }
}

/* Mobile Text Centering - Complete Fix */
@media (max-width: 768px) {
  /* Force center alignment for ALL text elements */
  .headline {
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 2rem 1rem !important;
  }
  
  .headline__subtitle {
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    margin: 0 auto 2rem auto !important;
    font-size: 1.6rem !important;
  }
  
  .headline__title {
    text-align: center !important;
    width: 100% !important;
    margin: 0 auto 3rem auto !important;
    font-size: 3.2rem !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
  }
  
  .headline__btnholder {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    gap: 2rem !important;
    margin: 3rem auto 0 auto !important;
    padding: 0 2rem !important;
  }
  
  .headline__btnholder .btn {
    width: 100% !important;
    max-width: 30rem !important;
    min-height: 5.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    margin: 0 auto !important;
    font-size: 1.6rem !important;
    font-weight: 600 !important;
    padding: 1.5rem 2rem !important;
    border-radius: 1rem !important;
  }
  
  .headline__btnholder .btn .btn-caption {
    text-align: center !important;
    width: 100% !important;
  }
  
  /* Section spacing improvements */
  .content__block {
    margin-bottom: 5rem !important;
  }
  
  .inner {
    padding: 5rem 0 !important;
  }
  
  .inner-first {
    padding-top: 3rem !important;
  }
  
  .section-grid-title {
    margin-bottom: 4rem !important;
    text-align: center !important;
    padding: 0 2rem !important;
  }
  
  .h2__title {
    font-size: 2.8rem !important;
    line-height: 1.3 !important;
    text-align: center !important;
    margin: 0 auto !important;
    padding: 0 1rem !important;
  }
  
  .h2__subtitle {
    font-size: 1.4rem !important;
    text-align: center !important;
    margin: 0 auto 2rem auto !important;
    justify-content: center !important;
  }
  
  /* Better content spacing */
  .content {
    padding-top: 8rem !important;
  }
  
  .content__wrapper {
    padding: 0 2rem !important;
  }
  
  /* Header improvements */
  .header {
    padding: 1.5rem 2rem !important;
    min-height: 7rem !important;
  }
  
  .header__controls {
    gap: 1rem !important;
  }
  
  /* Portfolio section improvements */
  .portfolio .gallery__descr {
    text-align: center !important;
    padding: 2rem 1rem !important;
  }
  
  .portfolio .gallery__descr h5 {
    text-align: center !important;
    margin-bottom: 1.5rem !important;
  }
  
  .portfolio .gallery__descr p {
    text-align: center !important;
    margin: 0 auto !important;
  }
  
  .portfolio .card__tags {
    justify-content: center !important;
    margin: 1.5rem auto !important;
  }
  
  /* About section improvements */
  .about .about-descr__text {
    text-align: center !important;
    font-size: 1.7rem !important;
    line-height: 1.6 !important;
    margin: 0 auto 2rem auto !important;
    padding: 0 1rem !important;
  }
  
  .about .about-descr__btnholder {
    text-align: center !important;
    margin: 3rem auto !important;
    display: flex !important;
    justify-content: center !important;
  }
  
  .about .about-info__item {
    text-align: center !important;
    margin-bottom: 3rem !important;
  }
  
  /* Resume section improvements */
  .resume .resume-column__title {
    text-align: center !important;
    margin-bottom: 3rem !important;
  }
  
  .resume .resume-item {
    text-align: center !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
  }
  
  .resume .resume-item__data {
    text-align: center !important;
  }
  
  .resume .resume-item__data h5 {
    text-align: center !important;
  }
  
  .resume .resume-item__data p {
    text-align: center !important;
  }
  
  .resume .skills-list__item {
    text-align: center !important;
  }
  
  .resume .skills-list__item h6 {
    text-align: center !important;
  }
  
  .resume .skills-list__tags {
    justify-content: center !important;
  }
  
  /* Contact section improvements */
  .contact .contact-info h6,
  .contact .contact-form h6 {
    text-align: center !important;
    margin-bottom: 3rem !important;
  }
  
  .contact .contact-info__item {
    text-align: center !important;
    justify-content: center !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
  }
  
  .contact .contact-info__item-content {
    text-align: center !important;
  }
  
  .contact .contact-info__item-content h6 {
    text-align: center !important;
  }
  
  .contact .contact-info__item-content p {
    text-align: center !important;
  }
}

/* Small mobile improvements */
@media (max-width: 480px) {
  .headline__title {
    font-size: 2.8rem !important;
    line-height: 1.1 !important;
  }
  
  .headline__subtitle {
    font-size: 1.4rem !important;
  }
  
  .headline__btnholder {
    padding: 0 1rem !important;
  }
  
  .headline__btnholder .btn {
    max-width: 28rem !important;
    min-height: 5rem !important;
    font-size: 1.5rem !important;
  }
  
  .h2__title {
    font-size: 2.4rem !important;
    padding: 0 0.5rem !important;
  }
  
  .content__wrapper {
    padding: 0 1.5rem !important;
  }
  
  .section-grid-title {
    padding: 0 1rem !important;
  }
}

/* Extra small mobile */
@media (max-width: 375px) {
  .headline__title {
    font-size: 2.4rem !important;
  }
  
  .headline__btnholder .btn {
    max-width: 25rem !important;
    font-size: 1.4rem !important;
  }
  
  .h2__title {
    font-size: 2.2rem !important;
  }
  
  .content__wrapper {
    padding: 0 1.2rem !important;
  }
}

/* Back to Top Button Enhancements */
.rotating-btn__link.back-to-top-mode {
  background: linear-gradient(135deg, #87CEEB 0%, #B0E0E6 100%);
  box-shadow: 0 8px 32px rgba(135, 206, 235, 0.4);
  transform: rotate(0deg);
  transition: all 0.3s ease;
}

.rotating-btn__link.back-to-top-mode:hover {
  background: linear-gradient(135deg, #B0E0E6 0%, #87CEEB 100%);
  box-shadow: 0 12px 48px rgba(135, 206, 235, 0.6);
  transform: scale(1.1) rotate(0deg);
}

.rotating-btn__link.back-to-top-mode svg {
  animation-direction: reverse;
}

/* Enhanced hover effects for scroll button */
.rotating-btn__link:hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rotating-btn__link i {
  transition: transform 0.3s ease;
}

.rotating-btn__link:hover i {
  transform: translateY(-2px);
}

/* Smooth transitions for arrow changes */
.rotating-btn__link i.ph-arrow-up,
.rotating-btn__link i.ph-arrow-down {
  transition: all 0.3s ease;
}

/* Component spacing improvements for all screen sizes */
.component-spacing {
  margin-bottom: 4rem;
}

@media (max-width: 768px) {
  .component-spacing {
    margin-bottom: 3rem;
  }
}

@media (max-width: 480px) {
  .component-spacing {
    margin-bottom: 2.5rem;
  }
}