/*
 * Ponpes Online — desktop web layer
 * This file extends the existing mobile-first UI without changing its palette
 * or the HTML/mobile reference folder.
 */

.desktop-site-header {
  display: none;
}

/* ── Full Width Page Container Override (Unconditional) ── */
body:has(.full-width-page),
body.has-full-width-page {
  display: block !important;
}

.app-container.full-width-page,
body:has(.full-width-page) .app-container {
  max-width: 100% !important;
  width: 100% !important;
  box-shadow: none !important;
  margin: 0 !important;
}

@media (min-width: 64rem) {

  /* Memaksa parent container search bar merentang penuh ke baris baru */
  #home-view .hero-section + *,
  #home-view .home-search-shell,
  #home-view [class*="search"] {
    grid-column: 1 / -1 !important; /* Jika parent-nya Grid */
    flex: 0 0 100% !important;     /* Jika parent-nya Flex */
    width: 100% !important;
    max-width: 100% !important;
    clear: both !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Memastikan input form di dalamnya terisi penuh */
  #home-view [class*="search"] form,
  #home-view [class*="search"] input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }


  /* ── Search Bar Base Rules (Cleaned) ── */
  .search-bar-container,
  .doa-search-container {
    width: 100%;
    margin: 0 auto;
    flex: 1;
  }

  .search-box,
  .doa-search-box {
    width: 100%;
    display: flex;
    justify-content: center;
  } /* <-- Kurung kurawal penutup sudah ditambahkan */

  /* ── Core Desktop Layout Overrides ── */
  body {
    display: block;
    background: var(--bg-light, #f8fafc);
  }

  .app-container {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    background: var(--bg-light, #f8fafc);
    box-shadow: none;
  }

  .desktop-site-header {
    width: 100%;
    height: 72px;
    padding: 0 clamp(28px, 5vw, 72px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid rgba(0, 51, 84, .08);
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 4px 18px rgba(15, 23, 42, .035);
  }

  .desktop-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--deep-navy);
    text-decoration: none;
    min-width: 150px;
  }

  .desktop-brand:hover,
  .desktop-profile-link:hover,
  .desktop-icon-link:hover {
    text-decoration: none;
  }

  .desktop-brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    overflow: hidden;
    background: var(--light-sky);
  }

  .desktop-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .desktop-brand strong,
  .desktop-brand small {
    display: block;
    line-height: 1.1;
  }

  .desktop-brand strong {
    font-size: .78rem;
    font-weight: 800;
  }

  .desktop-brand small {
    color: var(--teal-green);
    font-size: .68rem;
    font-weight: 600;
    margin-top: 2px;
  }

  .desktop-primary-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(18px, 3vw, 44px);
    flex: 1;
  }

  .desktop-primary-nav a {
    color: var(--charcoal-gray);
    text-decoration: none;
    font-size: .78rem;
    font-weight: 700;
    transition: color .2s ease;
  }

  .desktop-primary-nav a:hover {
    color: var(--teal-green);
  }

  .desktop-header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 150px;
    justify-content: flex-end;
  }

  .desktop-icon-link {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    color: var(--text-muted, #64748b);
    text-decoration: none;
    border-radius: 50%;
    transition: background .2s ease, color .2s ease;
  }

  .desktop-icon-link:hover {
    background: var(--light-sky);
    color: var(--deep-navy);
  }

  .desktop-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px 5px 5px;
    border-radius: 999px;
    background: var(--deep-navy);
    color: var(--white);
    text-decoration: none;
    font-size: .72rem;
    font-weight: 700;
  }

  .desktop-profile-avatar {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--teal-green);
    color: var(--white);
    font-size: .68rem;
  }

  .bottom-nav {
    display: none;
  }

  .page-content {
    padding-bottom: 32px;
  }

  /* ── Santri Home Desktop Layout ── */
  #home-view {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 28px 56px;
  }

  #home-view .hero-section {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, .95fr);
    gap: 20px;
    padding: 28px 0 0;
    background: transparent;
    border-radius: 0;
    overflow: visible;
  }

  #home-view .hero-copy {
    min-height: 316px;
    padding: 28px 34px;
    border-radius: 24px;
    overflow: hidden;
    background-color: var(--deep-navy);
    background-image: linear-gradient(90deg, rgba(0,51,84,.96), rgba(0,51,84,.45)),
      url("/static/images/hero-quran.jpg");
    background-size: cover;
    background-position: center right;
    box-shadow: 0 16px 32px rgba(0, 51, 84, .14);
  }

  #home-view .user-profile {
    margin-bottom: 14px;
  }

  #home-view .greeting h2 {
    font-size: .69rem;
    letter-spacing: .02em;
    opacity: .84;
  }

  #home-view .greeting h1 {
    font-size: 1rem;
  }

  #home-view .time-display {
    text-align: left;
    margin: 42px 0 20px;
  }

  #home-view .time-display h3 {
    font-size: clamp(2.8rem, 5vw, 4.6rem);
    line-height: 1;
    letter-spacing: -.06em;
  }

  #home-view .toggle-container {
    max-width: 340px;
    margin-bottom: 0;
  }

  #home-view .prayer-panel-inside {
    min-height: 316px;
    display: flex;
    align-items: center;
    padding: 26px 22px;
    border-radius: 24px;
    box-shadow: 0 16px 32px rgba(59, 130, 164, .12);
  }

  #home-view .prayer-grid-new {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 0;
    text-align: left;
  }

  #home-view .prayer-item-new {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "name time" "icon time";
    gap: 2px 10px;
    padding: 10px 2px;
    border-bottom: 1px solid rgba(0, 51, 84, .08);
  }

  #home-view .prayer-item-new:last-child {
    border-bottom: 0;
  }

  #home-view .prayer-name-new {
    grid-area: name;
    font-size: .72rem;
    color: var(--charcoal-gray);
  }

  #home-view .prayer-icon-box-new {
    grid-area: icon;
    width: 20px;
    height: 20px;
    border: 0;
    box-shadow: none;
    opacity: .76;
  }

  #home-view .prayer-time-new {
    grid-area: time;
    align-self: center;
    font-size: .86rem;
    color: var(--deep-navy);
  }

  /* ── Search Bar Full Width Desktop Override ── */

/* ── Perbaikan Lebar Search Bar di Desktop ── */
  #home-view .home-search-shell,
  #home-view .search-bar-container,
  #home-view .doa-search-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 16px 0 !important;
  }

  #home-view .search-box,
  #home-view .doa-search-box,
  #home-view .home-search-shell form {
    width: 100% !important;
    max-width: 100% !important;
  }

  #home-view .home-search-shell input,
  #home-view .search-box input,
  #home-view .doa-search-box input {
    width: 100% !important;
  }



  #home-view .home-banner-shell {
    padding: 16px 0 4px !important;
  }

  #home-view #hero-banner-slider {
    height: 176px !important;
    border-radius: 20px !important;
  }

  #home-view > .section-title,
  #home-view .home-section-heading {
    padding-left: 0;
    padding-right: 0;
  }

  #home-view > .section-title {
    padding-top: 30px;
    padding-bottom: 16px;
  }

  /* ── Fitur Utama Desktop (Grid 5 Kolom) ── */
  #home-view .features-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 18px !important;
    padding: 0 !important;
    overflow: visible !important;
    white-space: normal !important;
  }

  #home-view .feature-item {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 140px;
    padding: 20px 12px;
    border-radius: 18px;
    background: var(--white);
    border: 1px solid rgba(0, 51, 84, .06);
    box-shadow: 0 4px 14px rgba(0, 51, 84, .03);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  }

  #home-view .feature-item:hover {
    border-color: rgba(20, 143, 135, .35);
    box-shadow: 0 12px 24px rgba(0, 51, 84, .08);
    transform: translateY(-4px);
  }

  #home-view .feature-icon-wrapper {
    width: 64px;
    height: 64px;
    max-width: none;
    margin-bottom: 10px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #home-view .feature-icon-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  #home-view .feature-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--deep-navy, #003354);
    line-height: 1.25;
    text-align: center;
  }

  #home-view .home-courses-shell {
    overflow: visible !important;
    padding: 0 !important;
  }

  #home-view .course-slider-container {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    display: grid;
    gap: 16px;
    padding: 0;
    overflow: visible;
  }

  #home-view .course-slider-container .course-card {
    min-width: 0;
    max-width: none;
    flex: initial;
  }

  #home-view .course-slider-container .card-img-container {
    height: 138px;
  }

  #home-view .course-footer-container {
    padding: 0;
    margin: 16px 0 0;
    display: flex;
    justify-content: flex-end;
  }

  #home-view .see-all-btn {
    width: auto;
    padding: 10px 18px;
  }

  #home-view .home-products-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding: 0;
    overflow: visible;
  }

  #home-view .home-products-grid::after {
    display: none;
  }

  #home-view .home-products-grid .product-card {
    min-width: 0;
    flex: initial;
    display: grid;
    grid-template-columns: 76px 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 4px 12px;
    padding: 12px;
    text-align: left;
  }

  #home-view .home-products-grid .product-image-placeholder {
    width: 76px;
    height: 76px;
    grid-row: 1 / -1;
    margin: 0;
  }

  #home-view .home-products-grid .product-card h5 {
    align-self: end;
  }

  #home-view .home-products-grid .product-card > div:last-child {
    align-self: start;
  }

  .panel-content-hub {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border: 1px solid rgba(20,143,135,.14);
    background: linear-gradient(105deg, rgba(203,239,255,.34), #fff 66%);
  }

  .panel-content-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
  }
}

@media (max-width: 63.999rem) {
  .desktop-site-header {
    display: none;
  }

  .panel-content-hub {
    display: block;
  }

  .panel-content-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
  }
}
