/* ==========================================================================
   PWA Installer Component (Student Courses Area)
   ========================================================================== */

/* Header Install Button */
.pwa-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  background: rgba(65, 44, 250, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-full, 9999px);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pwa-header-btn:hover {
  background: rgba(65, 44, 250, 0.24);
  border-color: rgba(129, 140, 248, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(65, 44, 250, 0.3);
}

.pwa-header-icon {
  font-size: 1rem;
  line-height: 1;
}

.pwa-header-pill {
  background: #412cfa;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.12rem 0.45rem;
  border-radius: 9999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pwa-header-btn.pwa-installed-mode {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

/* PWA Banner Card */
.pwa-banner-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.15rem 1.5rem;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, rgba(65, 44, 250, 0.14) 0%, rgba(12, 18, 34, 0.95) 45%, rgba(17, 26, 51, 0.9) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 16px;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.6), 0 0 24px rgba(65, 44, 250, 0.12);
  animation: pwaBannerFadeIn 0.3s ease-out;
}

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

.pwa-banner-glow {
  position: absolute;
  top: -40%;
  left: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(65, 44, 250, 0.22) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.pwa-banner-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1.15rem;
  flex: 1;
  min-width: 0;
}

.pwa-app-icon-wrapper {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 14px;
  background: #000;
  padding: 2px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.pwa-app-icon-img {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
  display: block;
}

.pwa-app-online-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: #10b981;
  border: 2px solid #0c1222;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

.pwa-banner-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.pwa-banner-title-line {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.pwa-banner-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.01em;
}

.pwa-device-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #cbd5e1;
}

.pwa-banner-description {
  font-size: 0.88rem;
  color: var(--text-secondary, #94a3b8);
  margin: 0;
  line-height: 1.45;
}

.pwa-banner-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.btn-pwa-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: var(--radius-md, 12px);
  box-shadow: 0 4px 14px rgba(65, 44, 250, 0.4);
  white-space: nowrap;
}

.pwa-banner-dismiss-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pwa-banner-dismiss-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* Modal Dialog and Styling */
.pwa-modal-dialog {
  max-width: 580px !important;
  width: 95% !important;
  margin: auto;
}

.pwa-modal-content {
  background: #0c1222 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(99, 102, 241, 0.3) !important;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pwa-modal-header {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pwa-modal-header-branding {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.pwa-modal-icon-squircle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.15);
  overflow: hidden;
  flex-shrink: 0;
}

.pwa-modal-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pwa-modal-header-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: #818cf8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}

.pwa-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.pwa-modal-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.6rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s;
}

.pwa-modal-close-btn:hover {
  color: #ffffff;
}

/* Platform Tabs */
.pwa-platform-tabs {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem 1.5rem;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pwa-platform-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md, 12px);
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-platform-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.pwa-platform-tab.active {
  background: rgba(65, 44, 250, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(65, 44, 250, 0.3);
}

.pwa-tab-name {
  white-space: nowrap;
}

/* Modal Body & Panels */
.pwa-modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: calc(88vh - 160px);
}

.pwa-tab-panel {
  display: none;
  animation: pwaPanelFade 0.2s ease-out;
}

.pwa-tab-panel.active {
  display: block;
}

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

/* Notice Box */
.pwa-notice-box {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md, 12px);
  margin-bottom: 1.15rem;
  font-size: 0.84rem;
  line-height: 1.45;
}

.pwa-notice-ios {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fcd34d;
}

.pwa-notice-icon {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}

.pwa-notice-text strong {
  color: #ffffff;
}

/* Native Install Box */
.pwa-native-box {
  background: linear-gradient(135deg, rgba(65, 44, 250, 0.2) 0%, rgba(12, 18, 34, 0.8) 100%);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-md, 12px);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

.pwa-native-icon {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.pwa-native-details strong {
  display: block;
  font-size: 1rem;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.pwa-native-details p {
  font-size: 0.82rem;
  color: var(--text-secondary, #94a3b8);
  margin-bottom: 0.85rem;
}

.pwa-btn-full {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-md, 12px);
}

/* Steps List & Card */
.pwa-steps-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pwa-step-card {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1rem 1.15rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md, 12px);
  transition: border-color 0.2s;
}

.pwa-step-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.pwa-step-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #412cfa, #818cf8);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(65, 44, 250, 0.4);
}

.pwa-step-content {
  flex: 1;
  min-width: 0;
}

.pwa-step-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.25rem 0;
}

.pwa-step-desc {
  font-size: 0.84rem;
  color: var(--text-secondary, #94a3b8);
  margin: 0 0 0.65rem 0;
  line-height: 1.45;
}

.pwa-step-desc strong {
  color: #e2e8f0;
}

/* Visual Mockups */
.pwa-visual-demo {
  margin-top: 0.4rem;
}

.pwa-ios-share-demo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pwa-ios-share-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: #1c2640;
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-md, 12px);
  color: #38bdf8;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.pwa-ios-share-icon {
  stroke: #38bdf8;
}

.pwa-visual-hint {
  font-size: 0.75rem;
  color: #64748b;
  font-style: italic;
}

.pwa-ios-action-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  background: #182238;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md, 12px);
}

.pwa-ios-action-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.pwa-ios-action-icon-box {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.pwa-ios-action-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
}

.pwa-ios-action-arrow {
  color: #64748b;
  font-size: 1.2rem;
  font-weight: 700;
}

.pwa-ios-confirm-preview {
  padding: 0.55rem 0.85rem;
  background: #182238;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md, 12px);
}

.pwa-ios-confirm-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}

.pwa-ios-confirm-btn {
  color: #38bdf8;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.12);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}

.pwa-android-dots-preview {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: #1c2640;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md, 12px);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
}

.pwa-android-dots-icon {
  font-size: 1.25rem;
  line-height: 1;
  color: #38bdf8;
}

.pwa-android-menu-preview {
  padding: 0.55rem 0.85rem;
  background: #182238;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md, 12px);
}

.pwa-android-menu-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #ffffff;
  font-size: 0.85rem;
}

.pwa-android-menu-item svg {
  stroke: #38bdf8;
}

/* Benefits Bar */
.pwa-benefits-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.pwa-benefit-item {
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* QR Code Section (Desktop) */
.pwa-qr-section {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.pwa-qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: #ffffff;
  border-radius: var(--radius-lg, 18px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.pwa-qr-image-wrapper {
  width: 170px;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwa-qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.pwa-qr-caption {
  margin-top: 0.5rem;
}

.pwa-qr-scan-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #070a14;
}

.pwa-qr-instructions {
  flex: 1;
  min-width: 0;
}

.pwa-qr-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.65rem 0;
}

.pwa-qr-list {
  padding-left: 1.2rem;
  margin: 0 0 1rem 0;
  color: var(--text-secondary, #94a3b8);
  font-size: 0.84rem;
  line-height: 1.6;
}

.pwa-qr-list strong {
  color: #ffffff;
}

.pwa-desktop-tip {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md, 12px);
  font-size: 0.78rem;
  line-height: 1.45;
  color: #94a3b8;
}

.pwa-desktop-tip-icon {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}

.pwa-desktop-tip-text strong {
  color: #ffffff;
}

/* Modal Footer */
.pwa-modal-footer {
  padding: 0.85rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  justify-content: flex-end;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .pwa-banner-card {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    gap: 1rem;
  }

  .pwa-banner-actions {
    justify-content: space-between;
    width: 100%;
  }

  .btn-pwa-cta {
    flex: 1;
    justify-content: center;
  }

  .pwa-platform-tabs {
    padding: 0.4rem 0.75rem;
  }

  .pwa-platform-tab {
    padding: 0.5rem 0.4rem;
    font-size: 0.78rem;
  }

  .pwa-qr-section {
    flex-direction: column;
    text-align: center;
  }

  .pwa-qr-list {
    text-align: left;
  }

  .pwa-modal-body {
    padding: 1rem;
  }

  .pwa-step-card {
    padding: 0.85rem;
  }
}

/* ==========================================================================
   PWA Components Light Mode Support
   ========================================================================== */
[data-theme="light"] .pwa-banner-card {
  background: linear-gradient(135deg, rgba(65, 44, 250, 0.08) 0%, #ffffff 45%, #f8fafc 100%);
  border: 1px solid rgba(65, 44, 250, 0.22);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .pwa-banner-title {
  color: #0f172a;
}

[data-theme="light"] .pwa-banner-description {
  color: #475569;
}

[data-theme="light"] .pwa-modal-content {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="light"] .pwa-modal-header {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .pwa-modal-title {
  color: #0f172a;
}

[data-theme="light"] .pwa-modal-close-btn {
  color: #64748b;
}

[data-theme="light"] .pwa-modal-close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .pwa-platform-tab {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #64748b;
}

[data-theme="light"] .pwa-platform-tab:hover {
  background: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .pwa-platform-tab.active {
  background: #412cfa;
  border-color: #412cfa;
  color: #ffffff;
}

[data-theme="light"] .pwa-step-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .pwa-step-title {
  color: #0f172a;
}

[data-theme="light"] .pwa-step-desc {
  color: #475569;
}

[data-theme="light"] .pwa-qr-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .pwa-qr-title {
  color: #0f172a;
}

[data-theme="light"] .pwa-qr-instructions {
  color: #475569;
}

[data-theme="light"] .pwa-header-btn {
  background: rgba(65, 44, 250, 0.08);
  border-color: rgba(65, 44, 250, 0.25);
  color: #4338ca;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .pwa-header-btn:hover {
  background: rgba(65, 44, 250, 0.15);
  border-color: #412cfa;
  color: #311de6;
}

[data-theme="light"] .pwa-notice-box {
  background: rgba(65, 44, 250, 0.05);
  border-color: rgba(65, 44, 250, 0.2);
  color: #334155;
}

[data-theme="light"] .pwa-desktop-tip {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #475569;
}

[data-theme="light"] .pwa-modal-footer {
  border-top-color: #e2e8f0;
  background: #f8fafc;
}
