/* --- Global Reset & Base Styles --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #0f172a; /* Sleek dark slate background matching modern weather apps */
  color: #f8fafc;
  padding: 20px;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  color: #ffffff;
}

/* --- Main Layout Container --- */
body > h1 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 24px;
  font-weight: 700;
}

section {
  background: #1e293b;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- Current Weather Section --- */
.current-weather-section {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  color: #ffffff;
}

.location-header h1 {
  font-size: 28px;
  margin-bottom: 4px;
}

.location-header p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 16px;
}

.current-card .temp-display {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -1px;
}

.current-card .condition-display {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.9);
}

.details-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 14px;
  font-size: 14px;
}

.current-main-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.main-weather-icon {
  width: 90px;
  height: 90px;
  object-fit: contain;
}

.current-main-info {
  display: flex;
  justify-content: space-between;
  align-items: center; /* Vertically centers icon with the text block */
  margin: 10px 0 20px 0;
  padding-right: 15px;
}

.current-main-info > div {
  display: flex;
  flex-direction: column;
}

.main-weather-icon {
  width: 100px;  /* Makes it a prominent, clean size */
  height: 100px;
  object-fit: contain;
}

/* --- Search & Location Button Layout --- */
.search-container {
  position: relative;
  max-width: 500px;
  margin: 0 auto 20px auto;
}

.search-wrapper-flex {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.search-box {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 10px 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  gap: 10px;
  flex: 1; /* Automatically scales so input length remains consistent within 500px */
}

.search-box i {
  color: #9ca3af;
}

.search-box input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 14px;
  color: #1f2937;
  background: transparent;
}

/* --- Location Button Styles --- */
.location-btn {
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: background 0.2s ease, transform 0.1s ease;
  flex-shrink: 0;
}

.location-btn:hover {
  background: #1d4ed8;
}

.location-btn:active {
  transform: scale(0.95);
}

.location-btn i {
  font-size: 16px;
  color: #ffffff;
}

/* --- Search Dropdown --- */
.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-top: 6px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: none;
  max-height: 250px;
  overflow-y: auto;
}

.search-item {
  padding: 12px 16px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
}

.search-item:hover {
  background: #f9fafb;
  color: #2563eb;
}

/* --- Outlook & Rain Chart Sections --- */
.outlook-section .insight-card {
  font-size: 14px;
  color: #cbd5e1;
}

.rain-chart-section h3 {
  margin-bottom: 6px;
}

.outlook-text {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 16px;
}

.chart-legend-labels {
  display: flex;
  justify-content: flex-start;
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  width: 100%;
  gap: 15px;
}

.rain-chart-container {
  display: flex;
  overflow-x: auto;
  align-items: flex-end;
  gap: 12px;
  height: 140px;
  padding: 10px 4px;
  scrollbar-width: thin;
}

.rain-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 36px;
  height: 100%;
  justify-content: flex-end;
}

.bar-wrapper {
  height: 90px;
  display: flex;
  align-items: flex-end;
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  padding-bottom: 4px;
}

.rain-bar-col .bar {
  background: linear-gradient(180deg, #34d399 0%, #059669 100%);
  width: 6px;
  margin: 0 auto;
  border-radius: 3px;
  min-height: 6px;
}

.rain-bar-col .time-label {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 6px;
  white-space: nowrap;
}

.chart-legend-labels {
  display: flex;
  justify-content: space-between; /* Pushes Heavy to left, Light to right */
  align-items: center;
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 100%;
}

.site-footer {
  text-align: center;
  padding: 20px;
  color: #94a3b8; /* Muted gray text color */
  font-size: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 40px;
}

.site-footer a.portfolio-link {
  color: #38bdf8; /* Bright accent color for your name */
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.site-footer a.portfolio-link:hover {
  color: #60a5fa; /* Lighter shade on hover */
  text-decoration: underline;
}

/* --- Forecast Sections (Hourly & Daily) --- */
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.small-label {
  font-size: 11px;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.section-heading h2 {
  font-size: 16px;
}

.heading-icon {
  font-size: 18px;
}

.hourly-forecast, .daily-forecast {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.hourly-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
  padding: 12px 8px;
  gap: 15px; /* Even spacing between time, icon, and temperature */
  border-radius: 12px;
  border: 1px solid #252f41;
  background-color: #252f41;
}

.hourly-card .temp{
  font-size: 15px;
  font-weight: bold;
  margin: 4px 0 0 0 ;
  color: #f8fafc;
}

.hourly-card .time {
  font-size: 15px;
  color: #f8fafc;
  white-space: nowrap; /* Prevents AM/PM from dropping to a new line */
  text-align: center;
  font-weight: 400;
  margin: 0 0 8px 0;
}


.loading-message {
  font-size: 13px;
  color: #94a3b8;
  padding: 10px 0;
}

/* Container for the 7-day forecast cards */
.daily-forecast-container, .forecast-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); /* Ensures cards are wide enough */
  gap: 16px; /* Adds clean spacing between each card */
  margin-top: 15px;
  overflow-x: auto;
}

/* Individual 7-day forecast card */
.daily-card, .forecast-card {
  background: #252f41;
  padding: 16px 12px;
  border-radius: 12px;
  border: 1px solid #252f41;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 170px; /* Gives plenty of vertical space so text never squishes */
  justify-content: space-between;
}

/* Day title styling */
.daily-card h4, .forecast-card h4 {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 8px 0;
}

/* Temperature and description text inside daily cards */
.daily-card p, .forecast-card p {
  font-size: 12px;
  color: #f8fafc;
  line-height: 1.4;
  margin: 4px 0;
}

/* --- Advanced Weather Metrics Grid --- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  background: transparent;
  padding: 0;
  box-shadow: none;
  border: none;
}

.metric-card {
  background: #1e293b;
  padding: 18px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-card h4 {
  margin: 0 0 10px 0;
  font-size: 13px;
  color: #94a3b8;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.metric-card h4 i {
  color: #60a5fa;
  font-size: 15px;
}

.metric-card p {
  margin: 0;
  font-size: 20px;
  font-weight: bold;
  color: #f8fafc;
}

.metric-card small {
  margin-top: 4px;
  color: #94a3b8;
  font-size: 11px;
}

  .metric-card  .metric-font{
    font-size: 13px;
  }

/* Rain percentage badge styling */
.precip-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #60a5fa; /* Soft light blue */
  margin-top: 4px;
}

.precip-badge .drop-icon {
  font-size: 0.75rem;
}  

/* --- Media Queries for Responsiveness --- */

/* --- Tablets & Medium Screens (768px and up) --- */
@media (min-width: 768px) {
  body {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px;
  }
  
  .current-card .temp-display {
    font-size: 64px;
  }

        .daily-card {
    min-width: 15%;
    padding: 10px 6px;
    gap: 10px;
  }

  .daily-card p {
    font-size: 13px;
  }

  .daily-card .day-name {
    font-size: 13px;
  }


}

/* --- Desktops & Large Screens (1024px and up) --- */
@media (min-width: 1024px) {
  body {
    max-width: 1150px; /* Slightly wider to comfortably fit 3-column metrics */
    padding: 40px;
  }

  .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  /* Ensure containers have smooth breathing room on desktop */
  section {
    padding: 24px;
  }

      .daily-card {
    min-width: 15%;
    padding: 10px 6px;
    gap: 10px;
  }

  .daily-card p {
    font-size: 13px;
  }

  .daily-card .day-name {
    font-size: 13px;
  }
}

/* --- Mobile Responsiveness (Devices below 768px) --- */
@media (max-width: 767px) {

    body {
    max-width: 900px;
    margin: 0 auto;
    padding: 15px;
  }

  /* Current Weather Section Mobile Adjustments */
  .location-header h1 {
    font-size: 22px;
  }

  .current-card .temp-display {
    font-size: 44px;
    letter-spacing: -0.5px;
  }

  .current-card .condition-display {
    font-size: 15px;
    margin-bottom: 12px;
  }

  .main-weather-icon {
    width: 75px;
    height: 75px;
  }

  .details-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    font-size: 12px;
    padding-top: 10px;
  }

  .location-btn {
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: background 0.2s ease, transform 0.1s ease;
  flex-shrink: 0;
}

  .search-container {
    max-width: 70%;
    margin-bottom: 14px;
  }

  .search-box {
    padding: 8px 12px;
  }

  /* Hourly Forecast Cards Mobile Sizing */
  .hourly-card {
    min-width: 70px;
    padding: 10px 6px;
    gap: 10px;
  }

  .hourly-card .temp {
    font-size: 13px;
  }

  .hourly-card .time {
    font-size: 13px;
  }

  .daily-card {
    min-width: 25%;
    padding: 10px 6px;
    gap: 10px;
  }

  .daily-card p {
    font-size: 13px;
  }

  .daily-card .day-name {
    font-size: 13px;
  }

  /* Advanced Weather Metrics Grid Mobile Stack */
  .metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
  }

  .metric-card {
    padding: 14px;
  }

  .metric-card p {
    font-size: 15px;
  }
}

/* --- Extra Small Phones (Below 380px, e.g., iPhone SE / older devices) --- */
@media (max-width: 511px) {

    .search-container {
    max-width: 70%;
    margin-bottom: 14px;
  }

  .search-box {
    padding: 8px 12px;
  }

.current-card .temp-display {
    font-size: 38px !important;
  }
  
  .main-weather-icon {
    width: 60px !important;
    height: 60px !important;
  }

  .daily-card {
    min-width: 25% !important;
    padding: 10px 6px !important;
    gap: 10px !important;
  }

  .daily-card p,
  .daily-card .day-name {
    font-size: 13px !important;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important; /* Forces a strict 2-column layout */
    gap: 8px !important;
  }
}

/* ==========================================================================
   APK DOWNLOAD PROMO & SHOWCASE (Fully Responsive Across All Devices)
   ========================================================================== */

/* --- Top Quick Banner (Desktop & Base) --- */
.apk-top-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(90deg, rgba(30, 58, 138, 0.45) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 14px;
  padding: 10px 16px;
  margin: 0 auto 20px auto;
  max-width: 680px;
  width: 100%;
  box-sizing: border-box;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  animation: fadeInDown 0.4s ease;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.apk-top-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #e2e8f0;
  min-width: 0;
}

.apk-top-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  font-size: 18px;
  flex-shrink: 0;
}

.apk-top-text {
  min-width: 0;
  line-height: 1.35;
}

.apk-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.apk-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.apk-top-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.5);
  color: #ffffff;
}

.apk-top-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
}

.apk-top-close:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.1);
}

/* --- Showcase Section (Desktop & Base) --- */
.apk-showcase-section {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.4), 0 0 25px -10px rgba(59, 130, 246, 0.15);
  box-sizing: border-box;
}

.apk-showcase-section::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.apk-showcase-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 26px;
  align-items: center;
}

.apk-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.apk-showcase-info h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #ffffff;
  line-height: 1.25;
}

.apk-showcase-desc {
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 18px;
}

.apk-features-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.apk-feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  color: #e2e8f0;
}

.apk-feature-item i {
  color: #38bdf8;
  font-size: 13px;
  flex-shrink: 0;
}

.apk-action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.apk-download-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  padding: 12px 22px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-sizing: border-box;
}

.apk-download-cta:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.5);
  color: #ffffff;
}

.apk-download-cta .apk-cta-icon {
  font-size: 26px;
  color: #4ade80;
  flex-shrink: 0;
}

.apk-download-cta .apk-cta-dl-icon {
  font-size: 16px;
  margin-left: auto;
  opacity: 0.9;
  flex-shrink: 0;
}

.apk-cta-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.apk-cta-sub {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.7);
}

.apk-cta-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
}

.apk-guide-link {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease, border-color 0.15s ease;
  box-sizing: border-box;
}

.apk-guide-link:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

/* App Card Preview */
.apk-card-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  box-sizing: border-box;
}

.apk-app-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  margin-bottom: 12px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.apk-app-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.apk-card-details {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.apk-app-name {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.apk-app-meta {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 10px;
}

.apk-app-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.apk-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 3px 8px;
  border-radius: 6px;
}

/* Install Guide Dropdown */
.apk-install-guide {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 14px;
  padding: 16px 20px;
  margin-top: 18px;
  width: 100%;
  box-sizing: border-box;
  animation: fadeIn 0.25s ease;
}

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

.apk-install-guide h4 {
  font-size: 14px;
  margin-bottom: 10px;
  color: #60a5fa;
  display: flex;
  align-items: center;
  gap: 8px;
}

.apk-install-guide ol {
  padding-left: 20px;
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.7;
}

.apk-install-guide ol strong {
  color: #f1f5f9;
}

/* ==========================================================================
   MEDIA QUERIES FOR ALL PLATFORMS & DEVICES
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TABLETS & iPADS (768px to 1024px)
   -------------------------------------------------------------------------- */
@media (min-width: 768px) and (max-width: 1024px) {
  .apk-showcase-section {
    padding: 22px 18px;
  }
  .apk-showcase-grid {
    grid-template-columns: 0.9fr 1.3fr;
    gap: 18px;
  }
  .apk-showcase-info h2 {
    font-size: 21px;
  }
  .apk-features-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .apk-feature-item {
    font-size: 12px;
    padding: 7px 10px;
  }
  .apk-top-banner {
    padding: 10px 14px;
  }
  .apk-card-preview {
    padding: 20px 16px;
  }
}

/* --------------------------------------------------------------------------
   2. MOBILE PHONES & COMPACT SCREENS (max-width: 767px)
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  /* Top Banner: Streamlined single row */
  .apk-top-banner {
    padding: 8px 12px;
    margin-bottom: 16px;
    border-radius: 12px;
    gap: 8px;
  }
  .apk-top-content {
    gap: 8px;
    font-size: 12px;
  }
  .apk-top-subtext {
    display: none; /* Hide verbose sentence so weather remains above the fold */
  }
  .apk-top-icon {
    width: 28px;
    height: 28px;
    font-size: 15px;
    border-radius: 6px;
  }
  .apk-top-btn {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
  }
  .apk-top-close {
    font-size: 16px;
    padding: 2px 4px;
  }

  /* Showcase Section Mobile Stack */
  .apk-showcase-section {
    padding: 20px 16px;
    border-radius: 18px;
    margin-bottom: 18px;
  }
  .apk-showcase-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* Reorder App Preview Card to top like Google Play / App Store header */
  .apk-card-preview {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.55);
  }
  .apk-app-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    margin-bottom: 0;
  }
  .apk-card-details {
    align-items: flex-start;
  }
  .apk-app-name {
    font-size: 15px;
    margin-bottom: 2px;
  }
  .apk-app-meta {
    font-size: 11.5px;
    margin-bottom: 4px;
  }

  /* Text & Feature Grid */
  .apk-showcase-info h2 {
    font-size: 20px;
    line-height: 1.3;
    margin-bottom: 8px;
  }
  .apk-showcase-desc {
    font-size: 13.5px;
    line-height: 1.5;
    margin-bottom: 16px;
  }
  .apk-features-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 18px;
  }
  .apk-feature-item {
    font-size: 11.5px;
    padding: 7px 10px;
    border-radius: 8px;
  }

  /* Action Buttons Full-Width */
  .apk-action-group {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }
  .apk-download-cta {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
  }
  .apk-guide-link {
    width: 100%;
    justify-content: center;
    padding: 10px 14px;
    font-size: 12.5px;
  }
  .apk-install-guide {
    padding: 14px 16px;
    margin-top: 14px;
  }
  .apk-install-guide ol {
    padding-left: 18px;
    font-size: 12.5px;
    line-height: 1.6;
  }
}

/* --------------------------------------------------------------------------
   3. SMALL MOBILE PHONES (max-width: 480px, e.g. iPhone SE, Galaxy A-series)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .apk-top-banner {
    padding: 6px 10px;
    margin-bottom: 12px;
  }
  .apk-top-content strong {
    font-size: 11.5px;
  }
  .apk-top-btn {
    padding: 5px 8px;
    font-size: 11px;
  }

  .apk-showcase-section {
    padding: 16px 12px;
    border-radius: 16px;
    margin-bottom: 16px;
  }
  .apk-card-preview {
    padding: 10px 12px;
    gap: 12px;
  }
  .apk-app-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 10px;
  }
  .apk-app-name {
    font-size: 14px;
  }
  .apk-app-meta {
    font-size: 11px;
  }
  .apk-verified-badge {
    font-size: 10px;
    padding: 2px 6px;
  }
  .apk-badge {
    font-size: 10.5px;
    padding: 3px 10px;
    margin-bottom: 8px;
  }
  .apk-showcase-info h2 {
    font-size: 18px;
  }
  .apk-showcase-desc {
    font-size: 12.5px;
    margin-bottom: 14px;
  }
  .apk-features-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-bottom: 16px;
  }
  .apk-feature-item {
    font-size: 11px;
    padding: 6px 8px;
    gap: 6px;
  }
  .apk-download-cta {
    padding: 10px 14px;
  }
  .apk-download-cta .apk-cta-icon {
    font-size: 22px;
  }
  .apk-cta-title {
    font-size: 14px;
  }
  .apk-cta-sub {
    font-size: 10px;
  }
  .apk-guide-link {
    font-size: 12px;
    padding: 9px 12px;
  }
  .apk-install-guide {
    padding: 12px 14px;
  }
  .apk-install-guide h4 {
    font-size: 13px;
  }
  .apk-install-guide ol {
    padding-left: 16px;
    font-size: 12px;
    line-height: 1.55;
  }
}

/* --------------------------------------------------------------------------
   4. EXTRA SMALL & OLDER COMPACT DEVICES (max-width: 360px, e.g. 320px screens)
   -------------------------------------------------------------------------- */
@media (max-width: 360px) {
  .apk-top-banner {
    padding: 5px 8px;
  }
  .apk-top-btn span {
    display: none; /* Icon-only button on ultra-narrow screens */
  }
  .apk-top-btn {
    padding: 5px 8px;
  }

  .apk-showcase-section {
    padding: 14px 10px;
  }
  .apk-features-list {
    grid-template-columns: 1fr; /* Single column to guarantee zero text truncation */
    gap: 6px;
  }
  .apk-feature-item {
    font-size: 11px;
    padding: 6px 8px;
  }
  .apk-showcase-info h2 {
    font-size: 16.5px;
  }
  .apk-card-preview {
    gap: 10px;
    padding: 8px 10px;
  }
  .apk-app-icon-wrap {
    width: 42px;
    height: 42px;
  }
  .apk-cta-title {
    font-size: 13px;
  }
}
