/**
 * assets_portal/css/portal_apple.css
 * Apple Look Design System for Krukeng Portal (krukengc_portal)
 * Optimized for Desktop, iPad / Tablets, and Smartphones
 */

:root {
  --brand-orange: #ff7f0e;
  --brand-orange-hover: #e66c00;
  --brand-orange-light: #fff2e5;
  --brand-orange-glow: rgba(255, 127, 14, 0.25);
  
  --bg-cream: #fff9f2;
  --bg-surface: rgba(255, 255, 255, 0.88);
  --bg-frosted: rgba(255, 249, 242, 0.84);
  
  --text-dark: #1d1d1f;
  --text-muted: #6e6e73;
  --text-light: #86868b;
  
  --border-subtle: rgba(255, 127, 14, 0.12);
  --border-glass: rgba(255, 255, 255, 0.85);
  
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;
  
  --shadow-apple: 0 4px 20px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(255, 127, 14, 0.05);
  --shadow-hover: 0 16px 36px rgba(255, 127, 14, 0.16), 0 2px 6px rgba(0, 0, 0, 0.04);
  --transition-smooth: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  --touch-target: 44px;
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--bg-cream);
  background-image: 
    radial-gradient(at 10% 20%, rgba(255, 127, 14, 0.07) 0px, transparent 50%),
    radial-gradient(at 90% 80%, rgba(255, 158, 64, 0.06) 0px, transparent 50%);
  background-attachment: fixed;
  font-family: 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-dark);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

/* Apple-style Frosted Navbar */
.apple-nav {
  position: sticky;
  top: 0;
  z-index: 1050;
  background: var(--bg-frosted);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition-smooth);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 600;
  font-size: 1.15rem;
  min-height: var(--touch-target);
}

.brand-logo-img {
  height: 38px;
  width: auto;
  max-width: 50px;
  object-fit: contain;
}

.brand-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff9436 0%, #ff7f0e 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 10px var(--brand-orange-glow);
}

.nav-pill-link {
  color: var(--text-muted) !important;
  font-weight: 500;
  padding: 8px 16px !important;
  border-radius: var(--radius-pill);
  transition: var(--transition-smooth);
  font-size: 0.95rem;
  min-height: var(--touch-target);
  display: inline-flex;
  align-items: center;
}

.nav-pill-link:hover {
  color: var(--brand-orange) !important;
  background: rgba(255, 127, 14, 0.08);
}

.btn-apple-primary {
  background: linear-gradient(135deg, #ff9436 0%, #ff7f0e 100%);
  color: #fff !important;
  font-weight: 500;
  border-radius: var(--radius-pill);
  padding: 8px 20px;
  border: none;
  box-shadow: 0 4px 12px var(--brand-orange-glow);
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  min-height: var(--touch-target);
  cursor: pointer;
}

.btn-apple-primary:hover {
  background: linear-gradient(135deg, #ffa34d 0%, #e66c00 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 127, 14, 0.35);
}

/* Hero Section */
.hero-container {
  padding: 45px 0 30px 0;
  text-align: center;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: var(--brand-orange-light);
  color: var(--brand-orange);
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 127, 14, 0.2);
}

.hero-title {
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-dark);
  margin-bottom: 14px;
  line-height: 1.3;
}

.hero-title span {
  background: linear-gradient(135deg, #ff7f0e 0%, #e65c00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 30px auto;
  font-weight: 400;
  line-height: 1.6;
}

/* Hero Featured Card (Spotlight) */
.hero-featured-card {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-apple);
  max-width: 820px;
  margin: 0 auto 36px auto;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-featured-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: rgba(255, 127, 14, 0.3);
  transform: translateY(-2px);
}

.hero-profile-img {
  max-width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  margin-bottom: 18px;
}

.hero-profile-fallback {
  display: none;
  width: 100%;
  height: 180px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #fff3e6 0%, #ffe0cc 100%);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: var(--brand-orange);
  margin-bottom: 18px;
}

/* Controls: Search & Segmented Control */
.controls-wrapper {
  max-width: 820px;
  margin: 0 auto 36px auto;
}

.search-box-apple {
  position: relative;
  margin-bottom: 18px;
}

.search-input {
  width: 100%;
  padding: 14px 20px 14px 50px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-dark);
  box-shadow: var(--shadow-apple);
  transition: var(--transition-smooth);
  min-height: 50px;
}

.search-input:focus {
  outline: none;
  border-color: var(--brand-orange);
  background: #ffffff;
  box-shadow: 0 0 0 4px var(--brand-orange-glow);
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 1.25rem;
  pointer-events: none;
}

/* Horizontal Scrollable Segmented Filter Chips for Mobile & iPad */
.segmented-control-wrapper {
  overflow-x: auto;
  padding: 4px 2px 8px 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

.segmented-control-wrapper::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

.segmented-control {
  display: inline-flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.7);
  padding: 6px;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 127, 14, 0.1);
  white-space: nowrap;
}

.filter-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition-smooth);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  user-select: none;
}

.filter-btn:hover {
  color: var(--brand-orange);
  background: rgba(255, 127, 14, 0.08);
}

.filter-btn.active {
  background: #ffffff;
  color: var(--brand-orange);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Section Heading */
.section-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-top: 10px;
}

.section-heading {
  font-size: clamp(1.15rem, 2.5vw, 1.4rem);
  font-weight: 600;
  color: var(--text-dark);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.section-badge {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--brand-orange-light);
  color: var(--brand-orange);
}

/* Multi-Breakpoint Responsive Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 22px;
  margin-bottom: 45px;
}

/* Bento Card Component */
.bento-card {
  background: var(--bg-surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-apple);
  text-decoration: none;
  color: var(--text-dark);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: var(--transition-smooth);
  overflow: hidden;
  min-height: 220px;
}

.bento-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ff9436, #ff7f0e);
  opacity: 0;
  transition: var(--transition-smooth);
}

.bento-card:hover {
  background: #ffffff;
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(255, 127, 14, 0.35);
  color: var(--text-dark);
}

.bento-card:hover::before {
  opacity: 1;
}

.bento-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.bento-icon-wrapper {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: var(--brand-orange-light);
  color: var(--brand-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  transition: var(--transition-smooth);
}

.bento-card:hover .bento-icon-wrapper {
  background: linear-gradient(135deg, #ff9436, #ff7f0e);
  color: white;
  transform: scale(1.05);
}

.arrow-indicator {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.bento-card:hover .arrow-indicator {
  background: var(--brand-orange-light);
  color: var(--brand-orange);
  transform: translate(2px, -2px);
}

.bento-banner-img {
  width: 100%;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  object-fit: cover;
  max-height: 120px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.bento-card-category {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-orange);
  font-weight: 600;
  margin-bottom: 6px;
}

.bento-card-title {
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.bento-card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.bento-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-light);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 10px;
  margin-top: auto;
}

.card-url-chip {
  font-family: -apple-system, monospace;
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.03);
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--text-muted);
}

.click-badge {
  font-size: 0.75rem;
  color: var(--text-light);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Apple Minimalist Footer */
footer.apple-footer {
  background: rgba(255, 245, 235, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-top: 1px solid var(--border-subtle);
  padding: 40px 0 30px 0;
  margin-top: 60px;
  text-align: center;
}

.footer-author-box {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.85);
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-apple);
  margin-bottom: 18px;
  text-decoration: none;
  color: var(--text-dark);
  transition: var(--transition-smooth);
  min-height: var(--touch-target);
}

.footer-author-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  color: var(--brand-orange);
}

.footer-copyright {
  font-size: 0.88rem;
  color: var(--text-light);
}

/* ====================================================
   Responsive Breakpoints: Desktop, iPad & Tablets, Mobile
   ==================================================== */

/* 1. iPad & Tablets (768px to 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
  .hero-container {
    padding: 35px 0 25px 0;
  }
}

/* 2. Smartphones (< 768px) */
@media (max-width: 767px) {
  .hero-container {
    padding: 30px 0 20px 0;
  }
  .hero-title {
    font-size: 1.85rem;
  }
  .bento-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .segmented-control-wrapper {
    display: flex;
    justify-content: flex-start;
  }
  .segmented-control {
    width: max-content;
  }
  .filter-btn {
    padding: 8px 14px;
    font-size: 0.88rem;
  }
  .brand-badge span {
    font-size: 1.05rem;
  }
}

