/**
 * Reader Hub Styling
 * Gamification and progress tracking interface
 * Sci-Fi Post-Apocalyptic aesthetic
 */

:root {
  --hub-primary: #ff6b35;
  --hub-secondary: #00bcd4;
  --hub-accent: #4caf50;
  --hub-warning: #f39c12;
  --hub-success: #27ae60;
  --hub-bg-dark: #1a1a2e;
  --hub-bg-card: #16213e;
  --hub-text-primary: #e0e0e0;
  --hub-text-secondary: #a0a0a0;
}

/* Hero Section - Reader Hub */
.hero-reader-hub {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
  overflow: hidden;
}

.hero-reader-hub::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 107, 53, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero-reader-hub .hero-particles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.hero-reader-hub .hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3rem 2rem;
}

.hero-reader-hub .level-display {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, var(--hub-primary), var(--hub-secondary));
  border-radius: 50%;
  width: 120px;
  height: 120px;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(255, 107, 53, 0.3);
  animation: float 6s ease-in-out infinite;
}

.level-display .level-number {
  font-size: 3rem;
  font-weight: bold;
  color: #fff;
}

.level-display .level-label {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.hero-reader-hub h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  color: #fff;
  margin-bottom: 1rem;
  text-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
  animation: fadeInUp 0.8s ease-out;
}

.hero-reader-hub .hero-subtitle {
  font-size: 1.25rem;
  color: var(--hub-text-secondary);
  margin-bottom: 3rem;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-stats .stat-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.hero-stats .stat-card:hover {
  transform: translateY(-5px);
  border-color: var(--hub-primary);
  box-shadow: 0 10px 30px rgba(255, 107, 53, 0.2);
}

.stat-card .stat-value {
  display: block;
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--hub-primary);
  margin-bottom: 0.5rem;
}

.stat-card .stat-label {
  font-size: 0.875rem;
  color: var(--hub-text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Main Content Grid */
.hub-section {
  background: var(--hub-bg-card);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.hub-section .section-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(255, 107, 53, 0.2);
}

.hub-section h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.75rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

.hub-section .section-subtitle {
  color: var(--hub-text-secondary);
  font-size: 0.925rem;
}

/* Reading Progress Grid */
.progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.progress-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.progress-card:hover {
  transform: translateY(-5px);
  border-color: var(--hub-primary);
  box-shadow: 0 10px 30px rgba(255, 107, 53, 0.2);
}

.progress-card .book-title {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

.progress-card .book-series {
  font-size: 0.875rem;
  color: var(--hub-secondary);
  margin-bottom: 1rem;
}

.progress-card .progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--hub-text-secondary);
}

.progress-card .progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-card .progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--hub-primary), var(--hub-secondary));
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-card .progress-actions {
  display: flex;
  gap: 0.5rem;
}

.progress-card .btn-sm {
  flex: 1;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Achievements Grid */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.achievement-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.5rem 1rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.achievement-card.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.achievement-card.locked::after {
  content: '🔒';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  opacity: 0.5;
}

.achievement-card.unlocked {
  border-color: var(--hub-warning);
  background: linear-gradient(135deg, rgba(243, 156, 18, 0.1), rgba(255, 255, 255, 0.03));
}

.achievement-card:hover {
  transform: translateY(-5px);
}

.achievement-card .achievement-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.achievement-card .achievement-name {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

.achievement-card .achievement-description {
  font-size: 0.875rem;
  color: var(--hub-text-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.achievement-card .achievement-points {
  font-size: 0.75rem;
  color: var(--hub-success);
  font-weight: bold;
}

.achievement-card .points-badge {
  display: inline-block;
  background: rgba(39, 174, 96, 0.2);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.achievements-progress {
  margin-top: 2rem;
}

.achievements-progress .progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--hub-text-secondary);
}

.achievements-progress .progress-bar-outer {
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
}

.achievements-progress .progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--hub-warning), var(--hub-success));
  border-radius: 5px;
  transition: width 0.5s ease;
}

/* Unlockable Content */
.unlockable-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.unlockable-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
}

.unlockable-card.locked {
  opacity: 0.6;
}

.unlockable-card.unlocked {
  border-color: var(--hub-secondary);
  box-shadow: 0 5px 20px rgba(0, 188, 212, 0.2);
}

.unlockable-card:hover {
  transform: translateY(-5px);
}

.unlockable-card .unlockable-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.unlockable-card .unlockable-name {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

.unlockable-card .unlockable-description {
  font-size: 0.875rem;
  color: var(--hub-text-secondary);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.unlockable-card .unlockable-type {
  display: inline-block;
  background: rgba(0, 188, 212, 0.2);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--hub-secondary);
  text-transform: uppercase;
}

.unlockable-card .action-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--hub-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.3s ease;
}

.unlockable-card .action-link:hover {
  color: #fff;
}

.unlockable-card.locked .unlock-lock {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  opacity: 0.5;
}

/* Challenges Grid */
.challenges-grid {
  display: grid;
  gap: 1.5rem;
}

.challenge-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: all 0.3s ease;
}

.challenge-card:hover {
  transform: translateY(-3px);
  border-color: var(--hub-accent);
}

.challenge-card .challenge-icon {
  font-size: 3rem;
  flex-shrink: 0;
}

.challenge-card .challenge-content {
  flex: 1;
}

.challenge-card .challenge-title {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

.challenge-card .challenge-description {
  font-size: 0.875rem;
  color: var(--hub-text-secondary);
  margin-bottom: 0.5rem;
}

.challenge-card .challenge-progress {
  margin-top: 0.5rem;
}

.challenge-card .challenge-progress .progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--hub-text-secondary);
  margin-bottom: 0.25rem;
}

.challenge-card .challenge-progress .progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.challenge-card .challenge-progress .progress-bar-fill {
  height: 100%;
  background: var(--hub-accent);
  transition: width 0.3s ease;
}

.challenge-card .challenge-rewards {
  flex-shrink: 0;
  text-align: center;
}

.challenge-card .challenge-rewards .reward-badge {
  font-size: 0.875rem;
  color: var(--hub-accent);
  margin-bottom: 0.25rem;
}

.challenge-card .challenge-rewards .reward-points {
  font-size: 0.75rem;
  color: var(--hub-success);
}

/* Activity Timeline */
.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border-left: 3px solid var(--hub-primary);
}

.activity-item .activity-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.activity-item .activity-content {
  flex: 1;
}

.activity-item .activity-title {
  font-size: 0.925rem;
  color: #fff;
  margin-bottom: 0.25rem;
}

.activity-item .activity-date {
  font-size: 0.75rem;
  color: var(--hub-text-secondary);
}

.activity-item .activity-points {
  font-size: 0.75rem;
  color: var(--hub-success);
}

/* Settings */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.setting-item .setting-info {
  flex: 1;
}

.setting-item .setting-info strong {
  display: block;
  color: #fff;
  margin-bottom: 0.25rem;
}

.setting-item .setting-info p {
  font-size: 0.875rem;
  color: var(--hub-text-secondary);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

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

.toggle-switch .toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.2);
  transition: 0.3s;
  border-radius: 26px;
}

.toggle-switch .toggle-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background: #fff;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--hub-primary);
}

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

/* Settings Actions */
.settings-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.settings-actions .btn {
  padding: 0.75rem 1.5rem;
}

.settings-actions .btn-danger {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.4);
}

.settings-actions .btn-danger:hover {
  background: rgba(231, 76, 60, 0.3);
  border-color: rgba(231, 76, 60, 0.6);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--hub-text-secondary);
}

.empty-state p {
  margin: 0;
}

.empty-state a {
  color: var(--hub-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.empty-state a:hover {
  color: #fff;
}

/* Achievement Notification */
.achievement-notification {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: linear-gradient(135deg, var(--hub-bg-card), var(--hub-bg-dark));
  border: 2px solid var(--hub-warning);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 10px 40px rgba(243, 156, 18, 0.3);
  z-index: 1000;
  animation: slideInRight 0.5s ease-out;
  max-width: 400px;
}

.achievement-notification.hidden {
  display: none;
}

.achievement-notification .notification-content {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.achievement-notification .achievement-icon-lg {
  font-size: 3rem;
  flex-shrink: 0;
}

.achievement-notification .achievement-text h4 {
  color: var(--hub-warning);
  margin-bottom: 0.5rem;
  font-family: 'Cinzel', serif;
}

.achievement-notification .achievement-text p {
  color: #fff;
  margin-bottom: 0.25rem;
}

.achievement-notification .achievement-points {
  color: var(--hub-success);
  font-weight: bold;
  font-size: 0.875rem;
}

.achievement-notification .notification-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--hub-text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.achievement-notification .notification-close:hover {
  opacity: 1;
}

/* Animations */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .hero-reader-hub {
    min-height: 50vh;
  }
  
  .hero-reader-hub .level-display {
    width: 100px;
    height: 100px;
  }
  
  .level-display .level-number {
    font-size: 2.5rem;
  }
  
  .hero-stats {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
  }
  
  .stat-card .stat-value {
    font-size: 2rem;
  }
  
  .progress-grid,
  .achievements-grid,
  .unlockable-grid {
    grid-template-columns: 1fr;
  }
  
  .challenge-card {
    flex-direction: column;
    text-align: center;
  }
  
  .setting-item {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .achievement-notification {
    top: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
  }
}