/* ============================================
   Alpha Tester Pages - Stylesheet
   ============================================ */

/* --- Alpha Hero --- */
.alpha-hero {
  min-height: 80vh;
}

.alpha-hero-graphic {
  width: 280px;
  height: 280px;
  background: linear-gradient(135deg, var(--primary-light) 0%, rgba(240,107,107,0.2) 100%);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: var(--shadow-xl);
  animation: float 6s ease-in-out infinite;
}

.alpha-graphic-icon {
  width: 80px;
  height: 80px;
  background: var(--primary);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.alpha-graphic-icon .material-icons {
  font-size: 40px;
  color: white;
}

.alpha-graphic-text {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.alpha-reward-badge {
  position: absolute;
  bottom: 20px;
  right: -20px;
  background: var(--green);
  color: white;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-md);
  animation: float 6s ease-in-out infinite;
  animation-delay: 2s;
}

.alpha-reward-badge .material-icons {
  font-size: 20px;
}

/* --- Alpha Steps --- */
.alpha-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 48px;
}

.alpha-step {
  text-align: center;
  padding: 36px 24px;
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform 0.3s;
}

.alpha-step:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.alpha-step .step-number {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 36px;
  min-width: 36px;
}

.alpha-step-icon {
  width: 64px;
  height: 64px;
  margin: 16px auto 16px;
  background: var(--primary-light);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.alpha-step-icon .material-icons {
  font-size: 32px;
  color: var(--primary);
}

.alpha-step h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.alpha-step p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- Alpha Form Section --- */
.alpha-form-section {
  padding: 100px 0;
  background: var(--bg-gray);
}

.alpha-form-wrapper {
  max-width: 680px;
  margin: 0 auto;
}

.alpha-form {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-md);
}

.alpha-form-group {
  margin-bottom: 20px;
}

.alpha-form-group label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.alpha-form-group input,
.alpha-form-group select,
.alpha-form-group textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg-white);
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.alpha-form-group input:focus,
.alpha-form-group select:focus,
.alpha-form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.alpha-form-group input.error,
.alpha-form-group select.error {
  border-color: #e53935;
}

.alpha-form-group small {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.alpha-form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.alpha-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.alpha-form-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 12px 0;
  margin-bottom: 12px;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.alpha-form-divider .material-icons {
  font-size: 20px;
  color: var(--primary);
}

.alpha-form-submit {
  width: 100%;
  margin-top: 8px;
}

.alpha-form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.alpha-form-error {
  background: #FFEBEE;
  color: #c62828;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alpha-form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* --- Portal Page --- */
.portal-page {
  padding-top: var(--nav-height);
  min-height: 100vh;
  background: var(--bg-gray);
}

.portal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.portal-invalid {
  padding: 120px 0;
}

.portal-header {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-dark-lighter) 100%);
  padding: 40px 0 32px;
  color: var(--text-white);
}

.portal-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.portal-header h1 {
  font-size: 1.8rem;
  color: var(--text-white);
  margin-bottom: 4px;
}

.portal-header p {
  color: rgba(255,255,255,0.6);
  font-size: 1rem;
}

.portal-credit-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(76,217,100,0.15);
  color: var(--green);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.95rem;
}

.portal-credit-badge .material-icons {
  font-size: 20px;
}

/* Portal Stats */
.portal-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.portal-stat {
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}

.portal-stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-white);
}

.portal-stat-open { color: var(--orange); }
.portal-stat-progress { color: var(--blue); }
.portal-stat-fixed { color: var(--green); }

.portal-stat-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Portal Main */
.portal-main {
  padding: 32px 0 80px;
}

.portal-new-bug-btn {
  margin-bottom: 24px;
}

/* Bug Form */
.portal-bug-form {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.portal-bug-form h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.3rem;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.portal-bug-form h3 .material-icons {
  color: var(--primary);
}

/* Upload area */
.portal-upload-area {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.portal-upload-area:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.portal-upload-area .material-icons {
  font-size: 36px;
}

.portal-file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.portal-file-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-gray);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.portal-file-item .remove-file {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  transition: color 0.2s;
}

.portal-file-item .remove-file:hover {
  color: #e53935;
}

/* Bug Reports List */
.portal-bugs-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.portal-no-bugs {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.portal-no-bugs .material-icons {
  font-size: 48px;
  margin-bottom: 12px;
  display: block;
}

/* Bug Card */
.portal-bug-card {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s;
}

.portal-bug-card:hover {
  box-shadow: var(--shadow-md);
}

.portal-bug-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.portal-bug-card h4 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.portal-bug-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.portal-bug-severity {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.portal-bug-severity.low { background: #E8F5E9; color: #2E7D32; }
.portal-bug-severity.medium { background: #FFF3E0; color: #E65100; }
.portal-bug-severity.high { background: #FFEBEE; color: #C62828; }
.portal-bug-severity.critical { background: #F3E5F5; color: #6A1B9A; }

.portal-bug-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 8px;
}

.portal-bug-status.open { background: #FFF3E0; color: #E65100; }
.portal-bug-status.in_progress { background: #E3F2FD; color: #1565C0; }
.portal-bug-status.fixed { background: #E8F5E9; color: #2E7D32; }
.portal-bug-status.closed { background: var(--bg-gray); color: var(--text-muted); }

.portal-bug-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
  white-space: pre-wrap;
}

.portal-bug-steps {
  background: var(--bg-gray);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  white-space: pre-wrap;
}

.portal-bug-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.portal-bug-attachment {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.portal-bug-attachment img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-bug-device-info {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

.portal-bug-device-info span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.portal-bug-device-info .material-icons {
  font-size: 14px;
}

/* --- Admin Tabs --- */
.admin-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border-light);
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.admin-tab:hover {
  color: var(--text-primary);
}

.admin-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.admin-tab .material-icons {
  font-size: 20px;
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
}

/* --- Admin Settings --- */
.admin-settings-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.admin-settings-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.admin-settings-card h3 .material-icons {
  color: var(--primary);
}

.admin-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #f0f0f0;
}

.admin-setting-row:last-of-type {
  border-bottom: none;
}

.admin-setting-info strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.admin-setting-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.admin-input {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text-primary);
  margin-top: 8px;
  transition: border-color 0.2s;
}

.admin-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Toggle Switch */
.admin-toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.admin-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.admin-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 28px;
  transition: 0.3s;
}

.admin-toggle-slider::before {
  content: '';
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.admin-toggle input:checked + .admin-toggle-slider {
  background-color: var(--green);
}

.admin-toggle input:checked + .admin-toggle-slider::before {
  transform: translateX(24px);
}

/* --- Admin Tester Details --- */
.admin-tester-details {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.admin-tester-details span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.admin-tester-details .material-icons {
  font-size: 16px;
  color: var(--text-muted);
}

/* --- Admin Filters --- */
.admin-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.admin-filter-btn {
  padding: 8px 18px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-full);
  background: var(--bg-white);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}

.admin-filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.admin-filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Admin Bug Actions */
.admin-bug-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.admin-bug-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
}

.admin-bug-actions .btn .material-icons {
  font-size: 16px;
}

/* --- Fullscreen Overlay Spinner --- */
.alpha-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.alpha-overlay.active {
  opacity: 1;
  visibility: visible;
}

.alpha-overlay-spinner {
  width: 56px;
  height: 56px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* --- Toast Notification --- */
.admin-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-dark);
  color: var(--text-white);
  padding: 14px 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  z-index: 10001;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
  cursor: pointer;
}

.admin-toast.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.admin-toast-icon {
  font-size: 22px;
}

/* --- Modal --- */
.alpha-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.alpha-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.alpha-modal {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: 40px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-xl);
  transform: scale(0.9);
  transition: transform 0.3s;
}

.alpha-modal-backdrop.active .alpha-modal {
  transform: scale(1);
}

.alpha-modal-icon {
  margin-bottom: 16px;
}

.alpha-modal-icon .material-icons {
  font-size: 64px;
}

.alpha-modal-icon.success .material-icons {
  color: var(--green);
}

.alpha-modal-icon.error .material-icons {
  color: #e53935;
}

.alpha-modal h3 {
  font-size: 1.4rem;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.alpha-modal p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.alpha-modal .btn {
  min-width: 140px;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .alpha-steps {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 768px) {
  .alpha-hero {
    min-height: auto;
  }

  .alpha-hero-graphic {
    width: 200px;
    height: 200px;
  }

  .alpha-graphic-icon {
    width: 56px;
    height: 56px;
  }

  .alpha-graphic-icon .material-icons {
    font-size: 28px;
  }

  .alpha-graphic-text {
    font-size: 1.4rem;
  }

  .alpha-form {
    padding: 24px;
  }

  .alpha-form-row {
    grid-template-columns: 1fr;
  }

  .portal-header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .portal-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .portal-bug-form {
    padding: 20px;
  }

  .alpha-form-actions {
    flex-direction: column;
  }

  .alpha-form-actions .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .portal-stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .portal-stat {
    padding: 14px;
  }

  .portal-stat-number {
    font-size: 1.5rem;
  }
}
