/* applications.css */

.applications-page {
  background-color: #fafbfc;
  color: #1c1c1c;
}

/* Ensure global background doesn't block interactions */
.applications-page #bg-placeholder {
  pointer-events: none;
  opacity: 0.1; 
}

/* Applications Hero */
.applications-hero {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.applications-hero-bg {
  width: 100%;
  height: auto;
  display: block;
}

.applications-hero-content {
  position: absolute;
  top: 50%;
  left: 10%;
  transform: translateY(-50%);
  text-align: left;
  width: 90%;
  max-width: 700px;
  z-index: 2;
}

.applications-hero-title {
  font-size: 56px;
  font-weight: 700;
  color: #000000;
  margin-bottom: 20px;
}

.applications-hero-desc {
  font-size: 20px;
  color: #000000;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .applications-hero {
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .applications-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .applications-hero-content {
    left: 5%;
    width: 90%;
  }

  .applications-hero-title {
    font-size: 28px;
    margin-bottom: 10px;
  }

  .applications-hero-desc {
    font-size: 14px;
    line-height: 1.5;
  }
}

.apps-layout-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 50px;
  max-width: 1440px;
  margin: 120px auto 60px; /* Space for fixed header */
  padding: 0 40px;
  position: relative;
  z-index: 5;
}

/* ==========================================================================
   Sidebar Styles
   ========================================================================== */
.apps-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 120px;
  align-self: start;
  height: calc(100vh - 140px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none; /* Firefox */
}
.apps-sidebar::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Edge */
}

.sidebar-header {
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #4a5568;
}

.sidebar-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #2d3748;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: transparent;
  color: #4a5568;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
}

.app-item-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.app-icon {
  font-size: 18px;
  opacity: 0.7;
}

.app-name {
  white-space: normal;
  line-height: 1.3;
}

.app-item i.fa-chevron-right {
  font-size: 12px;
  opacity: 0.5;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.app-item:hover {
  background-color: rgba(11, 94, 215, 0.05);
  color: var(--clr-primary-dark);
}

.app-item.active {
  background-color: var(--clr-primary-dark);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(11, 94, 215, 0.3);
}

.app-item.active .app-icon {
  opacity: 1;
}

.app-item.active i.fa-chevron-right {
  opacity: 1;
  transform: translateX(3px);
}


/* Help Card */
.app-help-card {
  margin-top: 20px;
  background: linear-gradient(135deg, #eef2f6 0%, #e0e8f0 100%);
  border-radius: 16px;
  padding: 24px;
  text-align: left;
  border: 1px solid rgba(255,255,255,0.5);
}

.app-help-card h4 {
  color: var(--clr-primary-dark);
  font-size: 16px;
  margin-bottom: 8px;
  font-weight: 700;
}

.app-help-card p {
  color: #4a5568;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.app-help-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #ffffff;
  color: var(--clr-primary-dark);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.app-help-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  color: var(--clr-primary);
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.apps-main {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.app-hero-container {
  width: 100%;
  height: 400px;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  background-color: #e2e8f0; /* placeholder loading color */
}

#app-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.4s ease-in-out;
}

.app-hero-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.2) 0%, transparent 50%);
  pointer-events: none;
}

/* Details Section */
.app-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#app-title {
  font-size: 36px;
  font-weight: 700;
  color: #1a202c;
  position: relative;
  padding-bottom: 15px;
}

#app-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background-color: var(--clr-primary);
  border-radius: 2px;
}

#app-desc {
  font-size: 16px;
  color: #4a5568;
  line-height: 1.7;
  max-width: 900px;
}

/* Features Grid */
.app-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 10px;
}

.app-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.app-feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--clr-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-primary);
  font-size: 20px;
  flex-shrink: 0;
  background-color: #ffffff;
  box-shadow: 0 4px 10px rgba(11, 94, 215, 0.08);
}

.app-feature-text h4 {
  font-size: 16px;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 6px;
}

.app-feature-text p {
  font-size: 13px;
  color: #718096;
  line-height: 1.5;
}

/* Animation class added via JS */
.fade-in {
  animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .apps-layout-container {
    grid-template-columns: 1fr;
    gap: 30px;
    margin: 30px auto 40px;
    padding: 0 24px;
  }

  .apps-sidebar {
    position: relative;
    top: 0;
    height: auto;
    max-height: none;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 15px;
    width: 100%;
  }

  .sidebar-header {
    display: none;
  }

  .app-list {
    flex-direction: row;
    gap: 10px;
    white-space: nowrap;
    width: 100%;
  }

  .app-item {
    padding: 10px 18px;
    white-space: nowrap;
    border-radius: 25px;
    background-color: #edf2f7;
    flex-shrink: 0;
  }

  .app-item i.fa-chevron-right {
    display: none;
  }

  .app-help-card {
    display: none;
  }

  .app-hero-container {
    height: 300px;
    border-radius: 16px;
  }

  .app-features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .app-products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .apps-layout-container {
    padding: 0 15px;
    margin-top: 80px;
  }

  .applications-hero-content {
    left: 5%;
    width: 90%;
  }

  .applications-hero-title {
    font-size: 26px;
    margin-bottom: 10px;
  }

  .applications-hero-desc {
    font-size: 14px;
    line-height: 1.5;
  }

  #app-title {
    font-size: 26px;
  }

  #app-desc {
    font-size: 14px;
  }

  .app-hero-container {
    height: 220px;
  }

  .app-features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .app-products-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .app-product-img-wrapper {
    height: 160px;
  }
}

/* ==========================================================================
   Application Products Section
   ========================================================================== */
.app-products-section {
  margin-top: 20px;
  padding-top: 30px;
  border-top: 1px solid #e2e8f0;
}

.app-products-heading {
  font-size: 18px;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.5px;
}

.app-products-heading i {
  color: var(--clr-primary);
}

.app-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.app-product-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.app-product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(11, 94, 215, 0.12);
  border-color: rgba(11, 94, 215, 0.3);
}

.app-product-img-wrapper {
  width: 100%;
  height: 180px;
  background-color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.app-product-img-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.app-product-card:hover .app-product-img-wrapper img {
  transform: scale(1.06);
}

.app-product-info {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.app-product-cat-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--clr-primary);
  background-color: rgba(11, 94, 215, 0.08);
  padding: 4px 10px;
  border-radius: 20px;
  align-self: flex-start;
}

.app-product-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #2d3748;
  margin: 4px 0 8px 0;
  line-height: 1.3;
}

.app-product-link-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--clr-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}

.app-product-card:hover .app-product-link-btn {
  color: var(--clr-primary-dark);
}

.app-no-products-msg {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}
