/* Install surfaces: promote banner, platform-specific install instructions
   modal, footer floating install button, version stamp easter egg. Split
   out of css/05-modals.css in 1.1.0. */

  /* Promote banner: dedicated "Install" invitation strip near the top of
     the page. Hidden via [hidden] when the app is already installed or the
     user has dismissed it. */
  .install-banner[hidden] {
    display: none !important;
  }
  .install-banner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 56px 16px 20px;
    margin: 0 0 22px;
    border-radius: var(--radius);
    background: linear-gradient(120deg, rgba(249, 115, 22, 0.14) 0%, rgba(251, 146, 60, 0.06) 50%, rgba(34, 197, 94, 0.04) 100%);
    border: 1px solid var(--accent);
    box-shadow: 0 6px 18px rgba(249, 115, 22, 0.12);
    overflow: hidden;
    animation: bannerIn 0.45s cubic-bezier(0.2, 0.9, 0.3, 1);
  }
  [data-theme="light"] .install-banner {
    background: linear-gradient(120deg, rgba(249, 115, 22, 0.10) 0%, rgba(251, 146, 60, 0.05) 50%, rgba(34, 197, 94, 0.04) 100%);
    box-shadow: 0 6px 18px rgba(249, 115, 22, 0.08);
  }
  .install-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 0% 0%, rgba(249, 115, 22, 0.10), transparent 60%);
    pointer-events: none;
  }
  @keyframes bannerIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .install-banner-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.30);
  }
  .install-banner-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .install-banner-text strong {
    font-size: 14.5px;
    color: var(--text);
    font-weight: 600;
    letter-spacing: -0.005em;
  }
  .install-banner-text span {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
  }
  .btn.btn-install-cta {
    background: linear-gradient(180deg, var(--accent-2), var(--accent));
    color: #0b0f17;
    border: 0;
    font-weight: 700;
    padding: 11px 18px;
    font-size: 13.5px;
    border-radius: 10px;
    cursor: pointer;
    flex-shrink: 0;
    transition: filter 0.15s, transform 0.1s;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
    font-family: inherit;
  }
  .btn.btn-install-cta:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
  }
  .btn.btn-install-cta:active {
    transform: translateY(0);
  }
  .install-banner-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: transparent;
    border: 0;
    color: var(--text-mute);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.15s;
  }
  .install-banner-close:hover {
    color: var(--text);
    background: rgba(0, 0, 0, 0.18);
  }
  [data-theme="light"] .install-banner-close:hover {
    background: rgba(0, 0, 0, 0.06);
  }

  @media (max-width: 600px) {
    .install-banner {
      flex-wrap: wrap;
      padding: 14px 44px 14px 16px;
      gap: 12px;
    }
    .install-banner-icon {
      width: 44px;
      height: 44px;
      font-size: 22px;
    }
    .install-banner-text {
      flex: 1 1 calc(100% - 60px);
    }
    .btn.btn-install-cta {
      width: 100%;
      padding: 10px 16px;
    }
  }

  /* Install instructions modal: platform-specific step-by-step cards
     (iOS Safari, Android Chrome, desktop). Used as fallback when the
     native beforeinstallprompt event is unavailable. */
  .modal-content.modal-install {
    max-width: 540px;
  }
  .install-intro {
    font-size: 14px !important;
    margin: 0 0 18px !important;
    color: var(--text-dim) !important;
    line-height: 1.6 !important;
  }
  .install-platform-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 14px;
  }
  .install-platform-title {
    font-size: 14px !important;
    margin: 0 0 12px !important;
    color: var(--text) !important;
    text-transform: none !important;
    letter-spacing: -0.005em !important;
    font-weight: 600 !important;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .install-platform-title .platform-emoji {
    font-size: 18px;
  }
  .install-steps {
    list-style: decimal;
    padding-left: 22px !important;
    margin: 0 0 12px !important;
    counter-reset: step;
  }
  .install-steps li {
    padding: 5px 0 !important;
    padding-left: 4px !important;
    font-size: 13.5px !important;
    color: var(--text-dim) !important;
    line-height: 1.55 !important;
    position: static !important;
  }
  .install-steps li::before {
    display: none !important;
  }
  .install-steps li::marker {
    color: var(--accent-2);
    font-weight: 700;
  }
  .install-steps strong {
    color: var(--text);
    font-weight: 600;
  }
  .install-note {
    background: rgba(249, 115, 22, 0.08) !important;
    border-left: 3px solid var(--accent) !important;
    padding: 10px 14px !important;
    border-radius: 0 8px 8px 0 !important;
    font-size: 13px !important;
    color: var(--text-dim) !important;
    margin: 0 !important;
    text-align: left !important;
  }
  [data-theme="light"] .install-note {
    background: rgba(234, 88, 12, 0.06) !important;
  }
  .install-secondary {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 12.5px !important;
    color: var(--text-mute) !important;
  }

  /* Version stamp: hidden GitHub easter egg (same behavior as the author
     badge: press and hold for 3 seconds to open github.com/OzcanOrhanDemirci).
     The ::after fill bar animates over 3s while .pressing is applied. */
  footer .foot-version {
    font-size: 10.5px;
    color: var(--text-mute);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin: 18px 0 0;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    opacity: 0.7;
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
    transition: opacity 0.2s ease, color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  }
  footer .foot-version:hover {
    opacity: 1;
    border-color: rgba(249, 115, 22, 0.32);
    background: rgba(249, 115, 22, 0.06);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.14);
  }
  footer .foot-version:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.10);
  }
  footer .foot-version::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.42), rgba(34, 197, 94, 0.36));
    pointer-events: none;
    z-index: 0;
    transition: width 0s linear;
  }
  footer .foot-version.pressing::after {
    width: 100%;
    transition: width 3s linear;
  }
  footer .foot-version > * {
    position: relative;
    z-index: 1;
  }
  footer .foot-version.triggered {
    opacity: 1;
    color: var(--mvp);
    border-color: var(--mvp);
    background: var(--mvp-bg);
    animation: instructorPulse 0.7s ease;
  }
  footer .foot-version .version-dot {
    color: var(--accent-2);
    margin: 0 6px;
  }

  /* ==================== FOOTER FLOATING INSTALL BUTTON ====================
     Small round button shown when the orange install banner at the top is
     dismissed. Contains an SVG download icon (no label). Clicking triggers
     the same install flow as the banner: native prompt if supported, or the
     platform-specific instructions modal as fallback. Hidden in standalone
     mode or when the "already installed" flag is set (JS-controlled).
     Footer order: Author badge, install button, version stamp. The button
     is centered with equal spacing above and below. */
  .install-floating-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin: 16px auto;
    padding: 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-mute);
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.18s, box-shadow 0.18s;
  }
  .install-floating-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
  }
  .install-floating-btn:active {
    transform: translateY(0);
  }
  .install-floating-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
  }
  .install-floating-btn[hidden] { display: none; }
  /* Never visible in print output */
  @media print {
    .install-floating-btn { display: none !important; }
  }

