/* ==========================================================================
   RESPONSIVE STYLES - MILAN MATRIMONY
   ========================================================================== */

/* Laptop Screens (max-width: 1599px) */
@media (max-width: 1599px) {
  .slider-item {
    flex: 0 0 calc(100% / 8 - 15px); /* 8 visible profiles */
  }

  .profiles-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .about-features {
    gap: 15px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }

  .team-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Small Laptop Screens (max-width: 1199px) */
@media (max-width: 1199px) {
  .profiles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet Screens (max-width: 768px) */
@media (max-width: 768px) {
  .slider-item {
    flex: 0 0 calc(100% / 6 - 15px); /* 6 visible profiles */
  }

  main {
    padding: 30px 0;
  }

  /* Sticky Navigation on Mobile */
  .hamburger {
    display: block;
  }

  .nav-menu {
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background-color: var(--card-bg);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    border-top: 1px solid var(--border-color);
  }

  .nav-menu.open {
    max-height: 450px;
  }

  .nav-item {
    border-bottom: 1px solid #F0F0F0;
  }

  .nav-item a {
    display: block;
    padding: 15px 20px;
    font-weight: 500;
  }

  .nav-item a::after {
    display: none; /* Hide hover line effect */
  }

  .nav-item a:hover {
    background-color: var(--bg-color);
    padding-left: 25px;
  }

  .nav-login {
    margin: 15px 20px;
  }

  .nav-login .btn {
    width: 100%;
  }

  /* Hamburger Menu Cross Toggle animation */
  .hamburger.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .hamburger.open span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* Home layout - stack filters on top */
  .home-layout {
    flex-direction: column;
    gap: 25px;
  }

  .filters-sidebar {
    width: 100%;
    flex: none;
    position: static;
    padding: 20px;
  }

  /* Profiles Grid Tablet */
  .profiles-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Profile Details Page Tablet */
  .profile-detail-layout {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .profile-panel-left {
    position: static;
  }

  .profile-avatar-container {
    max-width: 320px;
    margin: 0 auto 20px auto;
  }

  /* About & Contact Page */
  .about-features {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  /* Lightbox Controls Adjustment */
  .lightbox-prev {
    left: -40px;
  }
  .lightbox-next {
    right: -40px;
  }
}

/* Mobile Screens (max-width: 767px) */
@media (max-width: 767px) {
  .container {
    width: 95%;
    padding: 0 10px;
  }

  .hero-section {
    padding: 40px 0;
  }

  .hero-title {
    font-size: 26px;
  }

  .hero-subtitle {
    font-size: 14px;
    margin-bottom: 25px;
  }

  /* Search bar stack */
  .search-container {
    padding: 10px;
    border-radius: var(--border-radius);
  }

  .search-bar-form {
    flex-direction: column;
    gap: 10px;
  }

  .search-group {
    width: 100%;
  }

  .search-input {
    padding: 12px 15px 12px 40px;
    font-size: 14px;
  }

  .search-icon {
    left: 15px;
  }

  .search-submit {
    width: 100%;
    height: 48px;
  }

  .feed-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
  }

  .slider-item {
    flex: 0 0 calc(100% / 4 - 15px); /* 4 visible profiles */
  }

  /* Mobile Filter Toggle Button Display */
  .mobile-filter-toggle-container {
    display: block !important;
    width: 100%;
    margin-top: 15px;
    margin-bottom: 5px;
  }

  #mobileFilterToggleBtn {
    width: 100%;
    height: 48px;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: transparent;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
  }

  #mobileFilterToggleBtn:hover, #mobileFilterToggleBtn:active {
    background-color: rgba(233, 30, 99, 0.05);
  }

  /* Transform Sidebar to Bottom Sheet */
  .filters-sidebar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-height: 80vh !important;
    background-color: #ffffff !important;
    border-radius: 20px 20px 0 0 !important;
    z-index: 1500 !important;
    padding: 24px 20px !important;
    margin: 0 !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15) !important;
    overflow-y: auto !important;
    display: block !important;
    
    /* CSS Hidden State */
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(100%) !important;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease, visibility 0.4s !important;
  }

  .filters-sidebar.open {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
  }

  .filters-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 20px !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding-bottom: 12px !important;
  }

  .filters-header .btn-reset {
    display: none !important; /* Hide header reset button */
  }

  .filter-close-btn {
    display: block !important;
    font-size: 28px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-color);
    line-height: 1;
  }

  .filters-grid {
    grid-template-columns: 1fr !important; /* 1 column on mobile */
    gap: 15px !important;
  }

  .filter-actions-mobile {
    display: flex !important;
    gap: 12px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    background-color: #ffffff;
    position: sticky;
    bottom: -24px;
    z-index: 20;
  }

  .filter-actions-mobile button {
    flex: 1;
    padding: 12px 15px;
    font-weight: 600;
  }

  /* Mobile Full-Width Profile Cards & Equal Margins */
  .profiles-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    width: 100% !important;
    padding: 0 !important; /* Let container handle margins */
  }

  .profile-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    border-radius: var(--border-radius) !important;
  }

  .profile-card-image {
    width: 100% !important;
    aspect-ratio: 1 / 1 !important; /* Clean square scaling */
  }

  .container {
    width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* Profile Details Page Mobile */
  .profile-info-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .profile-section-card {
    padding: 20px;
  }

  /* Form & Contact details padding */
  .contact-form-card {
    padding: 25px 15px;
  }

  .policy-card {
    padding: 25px 15px;
  }

  .team-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  /* Lightbox Mobile Adjustments */
  .lightbox-content {
    max-width: 95%;
  }
  .lightbox-nav {
    font-size: 30px;
  }
  .lightbox-prev {
    left: 10px;
    background-color: rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .lightbox-next {
    right: 10px;
    background-color: rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .error-code {
    font-size: 80px;
  }
}

/* Premium Profile Mobile Adaptations */
@media (max-width: 767px) {
  body.profile-page .form-row-2 {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  body.profile-page .services-edit-grid {
    grid-template-columns: 1fr;
  }
  
  body.profile-page .gallery-edit-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  body.profile-page .rate-edit-row {
    grid-template-columns: 80px 1fr;
    gap: 10px;
  }
  
  body.profile-page .languages-checklist {
    grid-template-columns: 1fr;
  }
}

