/* ==========================================================================
   Applixir Rewarded Video Demo - Modern Glassmorphism Theme
   ========================================================================== */

:root {
  --bg-primary: #0a0e17;
  --bg-card: rgba(18, 25, 42, 0.75);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --bg-card-hover: rgba(26, 35, 58, 0.85);

  --accent-purple: #7c3aed;
  --accent-purple-glow: rgba(124, 58, 237, 0.4);
  --accent-cyan: #06b6d4;
  --accent-gold: #f59e0b;
  --accent-green: #10b981;
  --accent-red: #ef4444;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;

  --transition-smooth: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Background Ambient Glows */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

.bg-glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  top: -100px;
  left: -100px;
}

.bg-glow-2 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #a855f7 0%, transparent 70%);
  bottom: -50px;
  right: -50px;
}

.bg-glow-3 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, #0ea5e9 0%, transparent 70%);
  top: 40%;
  left: 45%;
  transform: translate(-50%, -50%);
  opacity: 0.25;
}

/* Container */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 40px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--bg-card-border);
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}

.brand-info h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.version-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(139, 92, 246, 0.18);
  color: #c4b5fd;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

/* User Stats Badges */
.user-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--bg-card-border);
  border-radius: 30px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.coins-badge {
  border-color: rgba(245, 158, 11, 0.25);
}

.gems-badge {
  border-color: rgba(6, 182, 212, 0.25);
}

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

.stat-value {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  min-width: 32px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.stat-value.pulse-gain {
  animation: counterGain 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes counterGain {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); color: #34d399; }
  100% { transform: scale(1); }
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* Main Layout Grid */
.main-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  flex: 1;
}

@media (max-width: 920px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* Base Card Style */
.card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
}

.card-header .card-subtitle {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #a78bfa;
  display: block;
  margin-bottom: 6px;
}

.card-header h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: #fff;
}

.card-desc {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

.highlight-text {
  color: #fbbf24;
  font-weight: 600;
}

/* Reward Preview Box */
.reward-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 28px 0;
}

.reward-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.item-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.gold-box {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.gem-box {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.item-text {
  display: flex;
  flex-direction: column;
}

.item-text .amount {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.item-text .name {
  font-size: 12px;
  color: var(--text-muted);
}

.plus-sign {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-muted);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #ffffff;
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.45);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.6);
  transform: translateY(-2px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Button Shine Effect */
.btn-shine {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent,
    rgba(255, 255, 255, 0.18),
    transparent
  );
  transform: rotate(30deg) translateX(-100%);
  animation: buttonShine 4s infinite ease-in-out;
  pointer-events: none;
}

@keyframes buttonShine {
  0% { transform: rotate(30deg) translateX(-100%); }
  25%, 100% { transform: rotate(30deg) translateX(100%); }
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.7);
  color: #cbd5e1;
  border: 1px solid var(--bg-card-border);
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.85);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Status Bar */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 20px;
  font-size: 13px;
  flex-wrap: wrap;
  gap: 10px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-idle {
  background-color: #94a3b8;
}

.dot-loading {
  background-color: var(--accent-gold);
  box-shadow: 0 0 10px var(--accent-gold);
  animation: pulseDot 1.2s infinite;
}

.dot-playing {
  background-color: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  animation: pulseDot 1.2s infinite;
}

.dot-success {
  background-color: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
}

.dot-error {
  background-color: var(--accent-red);
  box-shadow: 0 0 10px var(--accent-red);
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}

.status-msg {
  color: var(--text-secondary);
}

.api-key-badge code {
  background: rgba(0, 0, 0, 0.35);
  padding: 3px 6px;
  border-radius: 4px;
  color: #93c5fd;
  font-family: monospace;
}

/* Tips */
.info-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: auto;
}

.info-tip svg {
  flex-shrink: 0;
  margin-top: 2px;
  stroke: var(--text-muted);
}

/* Monitor Card & Live Console */
.monitor-card {
  display: flex;
  flex-direction: column;
  min-height: 480px;
}

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

.monitor-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background-color: #ef4444; }
.terminal-dot.yellow { background-color: #f59e0b; }
.terminal-dot.green { background-color: #10b981; }

.monitor-title h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: #e2e8f0;
  margin-left: 4px;
}

.btn-text-only {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: var(--transition-smooth);
}

.btn-text-only:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* Log Console Area */
.log-console {
  flex: 1;
  background: #060911;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 12.5px;
  overflow-y: auto;
  max-height: 380px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-console::-webkit-scrollbar {
  width: 6px;
}

.log-console::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.log-entry {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.45;
  animation: fadeIn 0.2s ease-out;
  word-break: break-all;
}

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

.log-time {
  color: var(--text-muted);
  flex-shrink: 0;
  font-size: 11px;
}

.log-message {
  color: #cbd5e1;
}

.log-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.tag-system { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }
.tag-event { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.tag-progress { background: rgba(168, 85, 247, 0.2); color: #d8b4fe; }
.tag-success { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.tag-skip { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.tag-error { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }

/* Monitor Footer Stats */
.monitor-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  gap: 8px;
}

.stat-pill {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-pill strong {
  color: #fff;
  font-family: var(--font-display);
  font-size: 13px;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  position: relative;
  background: #131b2e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(124, 58, 237, 0.25);
  transform: scale(1);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.hidden .modal-card {
  transform: scale(0.9);
}

.modal-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.5), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}

.modal-icon-wrap {
  font-size: 54px;
  margin-bottom: 12px;
  animation: bounceEmoji 1s ease infinite alternate;
}

@keyframes bounceEmoji {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

.modal-card h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}

.modal-card p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

.reward-gain-boxes {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 28px;
}

.gain-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: #fff;
}

.modal-claim-btn {
  width: 100%;
}

/* Footer */
.footer {
  margin-top: 32px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
