/* Authentic Neon City Gazette Color Palette */
:root {
  /* Official Neon City Colors */
  --rose: #f72585;
  --grape: #7209b7;
  --zaffre: #3a0ca3;
  --neon-blue: #4361ee;
  --vivid-sky-blue: #4cc9f0;
  
  /* Mapped UI Colors */
  --electric-blue: var(--neon-blue);     /* Primary accent */
  --deep-blue: var(--zaffre);           /* Deep backgrounds */
  --hot-magenta: var(--rose);           /* Danger/warning */
  --cyber-gold: #ffd60a;                /* Complementary gold */
  --neon-green: #06ffa5;                /* Success/confirm */
  --dark-grey: #0a0a0a;                 /* Base background */
  --med-grey: #1a1a1a;                  /* Card backgrounds */
  --light-grey: #333333;                /* Subtle elements */
  --white: #ffffff;
  --danger-red: var(--rose);
  
  /* Neon City Gradients */
  --gradient-primary: linear-gradient(135deg, var(--rose), var(--grape), var(--zaffre));
  --gradient-secondary: linear-gradient(45deg, var(--zaffre), var(--neon-blue), var(--vivid-sky-blue));
  --gradient-full: linear-gradient(135deg, var(--rose), var(--grape), var(--zaffre), var(--neon-blue), var(--vivid-sky-blue));
  
  /* Fonts */
  --font-primary: 'Orbitron', monospace;
  --font-mono: 'Share Tech Mono', monospace;
  
  /* Glitch animation timing */
  --glitch-speed: 2s;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-mono);
  background: var(--dark-grey);
  color: var(--electric-blue);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Animated Background - Neon City Style */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse at 20% 80%, rgba(247, 37, 133, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(114, 9, 183, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 40% 40%, rgba(67, 97, 238, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 70%, rgba(76, 201, 240, 0.06) 0%, transparent 45%);
  z-index: -1;
  animation: backgroundShift 15s infinite alternate;
}

@keyframes backgroundShift {
  0% { transform: translateX(0) translateY(0); }
  100% { transform: translateX(-10px) translateY(-5px); }
}

/* Scanlines Effect */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    transparent 50%,
    rgba(67, 97, 238, 0.03) 50%
  );
  background-size: 100% 4px;
  z-index: 1000;
  pointer-events: none;
  animation: scanlines 0.1s linear infinite;
}

@keyframes scanlines {
  0% { transform: translateY(0); }
  100% { transform: translateY(4px); }
}

/* App Container */
#app {
  position: relative;
  z-index: 10;
  min-height: 100vh;
}

/* Screen Management */
.screen {
  display: none;
  min-height: 100vh;
  padding: 20px;
  position: relative;
}

.screen.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Glitch Text Effect */
.glitch {
  font-family: var(--font-primary);
  font-weight: 900;
  text-transform: uppercase;
  position: relative;
  color: var(--white);
  letter-spacing: 0.1em;
  animation: glitch var(--glitch-speed) infinite;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch::before {
  animation: glitch-before var(--glitch-speed) infinite;
  color: var(--hot-magenta);
  z-index: -1;
}

.glitch::after {
  animation: glitch-after var(--glitch-speed) infinite;
  color: var(--electric-blue);
  z-index: -2;
}

@keyframes glitch {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
}

@keyframes glitch-before {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(2px, -2px); }
  40% { transform: translate(2px, 2px); }
  60% { transform: translate(-2px, -2px); }
  80% { transform: translate(-2px, 2px); }
}

@keyframes glitch-after {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-2px, -2px); }
  40% { transform: translate(-2px, 2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
}

/* Title Styling */
.title {
  font-size: 3rem;
  margin-bottom: 1rem;
  text-align: center;
}

.subtitle {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--cyber-gold);
  text-align: center;
  margin-bottom: 2rem;
  letter-spacing: 0.2em;
  animation: textFlicker 2s infinite;
}

/* Neon City Gazette Logo */
.gazette-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.logo-image {
  max-width: 120px;
  height: auto;
  filter: drop-shadow(0 0 10px rgba(0, 255, 255, 0.5));
  animation: logoGlow 3s infinite alternate;
}

@keyframes logoGlow {
  0% { filter: drop-shadow(0 0 10px rgba(0, 255, 255, 0.5)); }
  100% { filter: drop-shadow(0 0 20px rgba(255, 0, 255, 0.8)); }
}

/* Terminal Window */
.terminal-window {
  background: var(--med-grey);
  border: 2px solid var(--electric-blue);
  border-radius: 10px;
  width: 100%;
  max-width: 600px;
  box-shadow: 
    0 0 20px rgba(0, 255, 255, 0.3),
    inset 0 0 20px rgba(0, 255, 255, 0.1);
  animation: terminalGlow 3s infinite alternate;
}

@keyframes terminalGlow {
  0% { box-shadow: 0 0 20px rgba(0, 255, 255, 0.3), inset 0 0 20px rgba(0, 255, 255, 0.1); }
  100% { box-shadow: 0 0 30px rgba(0, 255, 255, 0.5), inset 0 0 30px rgba(0, 255, 255, 0.2); }
}

.terminal-header {
  background: var(--light-grey);
  padding: 10px 15px;
  border-bottom: 1px solid var(--electric-blue);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px 8px 0 0;
}

.terminal-buttons {
  display: flex;
  gap: 8px;
}

.terminal-button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-button.red { background: var(--danger-red); }
.terminal-button.yellow { background: var(--cyber-gold); }
.terminal-button.green { background: var(--neon-green); }

.terminal-title {
  color: var(--electric-blue);
  font-size: 0.9rem;
  font-weight: bold;
}

.terminal-body {
  padding: 20px;
  background: var(--dark-grey);
  border-radius: 0 0 8px 8px;
}

.terminal-line {
  margin-bottom: 15px;
  font-family: var(--font-mono);
}

.prompt {
  color: var(--neon-green);
}

.command {
  color: var(--cyber-gold);
}

/* Input Styling */
.input-section {
  margin: 20px 0;
}

.input-label {
  display: block;
  margin-bottom: 8px;
  color: var(--electric-blue);
  font-size: 0.9rem;
}

.cyber-input {
  width: 100%;
  padding: 12px 15px;
  background: var(--dark-grey);
  border: 2px solid var(--electric-blue);
  border-radius: 5px;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.cyber-input:focus {
  outline: none;
  border-color: var(--hot-magenta);
  box-shadow: 0 0 15px rgba(255, 0, 255, 0.5);
  background: rgba(255, 0, 255, 0.1);
}

.cyber-input::placeholder {
  color: var(--light-grey);
}

/* Button Styling */
.cyber-button {
  position: relative;
  background: var(--gradient-secondary);
  border: none;
  padding: 15px 30px;
  color: var(--white);
  font-family: var(--font-primary);
  font-weight: bold;
  font-size: 1rem;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.3s ease;
  overflow: hidden;
  letter-spacing: 0.1em;
  box-shadow: 0 0 15px rgba(67, 97, 238, 0.4);
}

.cyber-button.dangerous {
  background: var(--gradient-primary);
  color: var(--white);
  border: 2px solid var(--rose);
  box-shadow: 0 0 20px rgba(247, 37, 133, 0.6);
  animation: dangerPulse 2s infinite;
}

@keyframes dangerPulse {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(247, 37, 133, 0.6);
    border-color: var(--rose);
  }
  50% { 
    box-shadow: 0 0 30px rgba(247, 37, 133, 0.9);
    border-color: var(--grape);
  }
}

.cyber-button:disabled {
  background: var(--light-grey);
  color: var(--med-grey);
  cursor: not-allowed;
  opacity: 0.5;
}

.cyber-button:not(:disabled):hover {
  background: var(--gradient-full);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(76, 201, 240, 0.5);
}

.button-glow {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.cyber-button:not(:disabled):hover .button-glow {
  left: 100%;
}

/* Status Bar */
.status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--med-grey);
  border-top: 1px solid var(--electric-blue);
  padding: 8px 20px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  z-index: 100;
}

.status-item {
  color: var(--electric-blue);
  animation: statusBlink 2s infinite;
}

.status-item.blinking {
  color: var(--danger-red);
  animation: dangerBlink 0.8s infinite;
}

.status-item.danger {
  color: var(--hot-magenta);
}

@keyframes statusBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.7; }
}

@keyframes dangerBlink {
  0%, 50% { opacity: 1; color: var(--danger-red); }
  51%, 100% { opacity: 0.3; color: var(--hot-magenta); }
}

/* Warning Popup */
.warning-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(5px);
  animation: popupAppear 0.5s ease;
}

.warning-popup.hidden {
  display: none;
}

@keyframes popupAppear {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

.popup-content {
  background: var(--dark-grey);
  border: 3px solid var(--danger-red);
  border-radius: 10px;
  padding: 30px;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 0 50px rgba(255, 0, 102, 0.8);
  animation: warningShake 0.5s infinite;
}

@keyframes warningShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.popup-header {
  font-family: var(--font-primary);
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--danger-red);
  margin-bottom: 20px;
  animation: textFlicker 1s infinite;
}

.popup-content p {
  color: var(--white);
  margin-bottom: 15px;
  font-family: var(--font-mono);
  font-size: 1.1rem;
}

.popup-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 25px;
}

.popup-btn {
  padding: 12px 20px;
  border: none;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.danger-btn {
  background: var(--danger-red);
  color: var(--white);
}

.danger-btn:hover {
  background: var(--hot-magenta);
  transform: scale(1.05);
}

.safe-btn {
  background: var(--light-grey);
  color: var(--white);
}

.safe-btn:hover {
  background: var(--electric-blue);
  color: var(--dark-grey);
}

/* Audio Toggle Button */
.audio-toggle {
  background: var(--light-grey);
  color: var(--electric-blue);
  border: 1px solid var(--electric-blue);
  padding: 4px 8px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: auto;
}

.audio-toggle:hover {
  background: var(--electric-blue);
  color: var(--dark-grey);
  transform: scale(1.05);
}

.audio-toggle.disabled {
  background: var(--med-grey);
  color: var(--light-grey);
  border-color: var(--light-grey);
}

/* Challenge Screen */
#challenge-screen {
  background: radial-gradient(circle at center, var(--med-grey) 0%, var(--dark-grey) 100%);
}

.challenge-container {
  max-width: 800px;
  width: 100%;
}

.warning-message {
  background: var(--dark-grey);
  border: 3px solid var(--danger-red);
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  box-shadow: 
    0 0 30px rgba(255, 0, 102, 0.5),
    inset 0 0 30px rgba(255, 0, 102, 0.1);
  animation: warningPulse 2s infinite;
}

@keyframes warningPulse {
  0%, 100% { border-color: var(--danger-red); }
  50% { border-color: var(--hot-magenta); }
}

.warning-header {
  font-family: var(--font-primary);
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--danger-red);
  margin-bottom: 20px;
  animation: textFlicker 1.5s infinite;
}

@keyframes textFlicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.challenge-text {
  font-size: 1.2rem;
  margin-bottom: 25px;
  color: var(--electric-blue);
  font-style: italic;
}

.challenge-display {
  background: var(--med-grey);
  border: 1px solid var(--electric-blue);
  border-radius: 5px;
  padding: 20px;
  margin: 20px 0;
  font-family: var(--font-mono);
  color: var(--white);
  min-height: 100px;
  text-align: left;
}

.challenge-input-section {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-top: 20px;
}

.challenge-input-section .cyber-input {
  flex: 1;
}

.challenge-input-section .cyber-button {
  flex-shrink: 0;
}

/* Library Screen */
.library-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 30px;
  padding: 0 20px;
}

.library-title {
  font-size: 2.5rem;
  margin: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 20px;
}

#current-user {
  color: var(--electric-blue);
  font-family: var(--font-mono);
}

.username {
  color: var(--cyber-gold);
  font-weight: bold;
}

.logout-button {
  background: var(--danger-red);
  color: var(--white);
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.logout-button:hover {
  background: var(--hot-magenta);
  transform: translateY(-1px);
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  padding: 20px;
  width: 100%;
}

.book-card {
  background: var(--med-grey);
  border: 2px solid var(--electric-blue);
  border-radius: 12px;
  padding: 0;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 320px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.book-card:hover {
  border-color: var(--hot-magenta);
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(255, 0, 255, 0.3);
}

/* New Cinematic Layout Styles */
.book-hero-cover {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  flex-shrink: 0;
}

.book-landscape-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.3s ease;
}

.book-card:hover .book-landscape-cover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.book-cover-overlay {
  position: absolute;
  top: 0;
  right: 0;
  padding: 10px;
  background: linear-gradient(135deg, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
}

.book-info {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.book-header {
  margin-bottom: 10px;
}

.book-meta-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.book-footer {
  margin-top: auto;
}

.book-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 10px;
  overflow: hidden;
  min-width: 0;
}

.book-size {
  color: var(--light-grey);
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.book-year {
  color: var(--cyber-gold);
  font-weight: bold;
  font-size: 0.8rem;
}

/* Update badges to work with overlay positioning */
.badges {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
}

.book-title {
  font-family: var(--font-primary);
  font-size: 1.1rem;
  color: var(--cyber-gold);
  margin: 0;
  flex: 1;
}

.book-author {
  color: var(--electric-blue);
  margin-bottom: 5px;
  font-size: 0.9rem;
}

.book-date {
  color: var(--light-grey);
  font-size: 0.8rem;
  margin-bottom: 10px;
}

.book-description {
  color: var(--white);
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 15px;
  max-height: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-tags {
  margin-bottom: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.book-tag {
  background: var(--electric-blue);
  color: var(--dark-grey);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.category-badge {
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: bold;
  white-space: nowrap;
}

.category-badge.romance { background: var(--hot-magenta); color: var(--white); }
.category-badge.family { background: var(--neon-green); color: var(--dark-grey); }
.category-badge.spiritual { background: var(--danger-red); color: var(--white); }
.category-badge.thriller { background: var(--light-grey); color: var(--white); }
.category-badge.horror { background: var(--dark-grey); color: var(--danger-red); border: 1px solid var(--danger-red); }
.category-badge.music { background: var(--cyber-gold); color: var(--dark-grey); }

/* Trilogy Badge Styling */
.trilogy-badge {
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 6px;
  font-family: var(--font-primary);
  font-weight: bold;
  white-space: nowrap;
  background: var(--gradient-primary);
  color: var(--white);
  border: 2px solid var(--rose);
  box-shadow: 0 0 12px rgba(247, 37, 133, 0.4);
  animation: trilogyGlow 3s infinite alternate;
  position: relative;
  overflow: hidden;
}

@keyframes trilogyGlow {
  0% { 
    box-shadow: 0 0 12px rgba(247, 37, 133, 0.4);
    border-color: var(--rose);
  }
  50% { 
    box-shadow: 0 0 18px rgba(114, 9, 183, 0.6);
    border-color: var(--grape);
  }
  100% { 
    box-shadow: 0 0 15px rgba(58, 12, 163, 0.5);
    border-color: var(--zaffre);
  }
}

.trilogy-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: trilogySweep 4s infinite;
}

@keyframes trilogySweep {
  0% { left: -100%; }
  100% { left: 100%; }
}

.trilogy-book {
  position: relative;
}

.trilogy-book::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: var(--gradient-primary);
  border-radius: 12px;
  z-index: -1;
  opacity: 0.3;
  animation: trilogyAura 2s infinite alternate;
}

@keyframes trilogyAura {
  0% { opacity: 0.2; transform: scale(1); }
  100% { opacity: 0.4; transform: scale(1.02); }
}

.coming-soon-book {
  opacity: 0.7;
  position: relative;
  overflow: hidden;
}

.coming-soon-book::before {
  content: 'COMING SOON';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  background: var(--gradient-primary);
  color: var(--white);
  padding: 8px 16px;
  border-radius: 5px;
  font-family: var(--font-primary);
  font-weight: bold;
  font-size: 1.2rem;
  border: 2px solid var(--rose);
  box-shadow: 0 0 20px rgba(247, 37, 133, 0.8);
  z-index: 10;
  animation: comingSoonPulse 2s infinite;
}

@keyframes comingSoonPulse {
  0%, 100% { 
    transform: translate(-50%, -50%) rotate(-15deg) scale(1);
    box-shadow: 0 0 20px rgba(247, 37, 133, 0.8);
  }
  50% { 
    transform: translate(-50%, -50%) rotate(-15deg) scale(1.1);
    box-shadow: 0 0 30px rgba(247, 37, 133, 1);
  }
}

.coming-soon-book .book-title,
.coming-soon-book .book-author,
.coming-soon-book .book-description {
  filter: blur(1px);
  opacity: 0.6;
}

/* Article Card Styling */
.article-card {
  background: var(--med-grey);
  border: 2px solid var(--electric-blue);
  border-radius: 10px;
  padding: 20px;
  transition: all 0.3s ease;
  cursor: pointer;
  display: block;
  min-height: auto;
}

.article-card:hover {
  border-color: var(--cyber-gold);
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(255, 215, 10, 0.3);
}

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

.article-section-badge {
  background: var(--gradient-secondary);
  color: var(--white);
  padding: 4px 12px;
  border-radius: 6px;
  font-family: var(--font-primary);
  font-weight: bold;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  box-shadow: 0 0 10px rgba(67, 97, 238, 0.4);
}

.article-date {
  color: var(--light-grey);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.article-content {
  display: flex;
  flex-direction: column;
}

.article-title {
  font-family: var(--font-primary);
  font-size: 1.2rem;
  color: var(--cyber-gold);
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.article-author {
  color: var(--electric-blue);
  margin-bottom: 12px;
  font-size: 0.9rem;
  font-style: italic;
}

.article-summary {
  color: var(--white);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 15px;
  flex-grow: 1;
}

.article-tags {
  margin-bottom: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.article-tag {
  background: var(--electric-blue);
  color: var(--dark-grey);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.read-article-button {
  background: var(--gradient-secondary);
  color: var(--white);
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(67, 97, 238, 0.3);
  font-size: 0.9rem;
}

.read-article-button:hover {
  background: var(--gradient-primary);
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(247, 37, 133, 0.5);
}

/* Article Modal Styling */
.article-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(8px);
  animation: modalAppear 0.3s ease;
}

@keyframes modalAppear {
  0% { 
    opacity: 0; 
    transform: scale(0.8); 
  }
  100% { 
    opacity: 1; 
    transform: scale(1); 
  }
}

.article-modal-content {
  background: var(--dark-grey);
  border: 3px solid var(--electric-blue);
  border-radius: 15px;
  padding: 30px;
  max-width: 800px;
  max-height: 80vh;
  width: 90%;
  overflow-y: auto;
  box-shadow: 
    0 0 50px rgba(67, 97, 238, 0.6),
    inset 0 0 30px rgba(67, 97, 238, 0.1);
  animation: modalContentGlow 2s infinite alternate;
  position: relative;
}

@keyframes modalContentGlow {
  0% { 
    box-shadow: 
      0 0 50px rgba(67, 97, 238, 0.6),
      inset 0 0 30px rgba(67, 97, 238, 0.1);
  }
  100% { 
    box-shadow: 
      0 0 70px rgba(67, 97, 238, 0.8),
      inset 0 0 50px rgba(67, 97, 238, 0.2);
  }
}

.article-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--electric-blue);
}

.article-banner {
  text-align: center;
  margin-bottom: 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--light-grey);
}

.gazette-banner-image {
  max-width: 100%;
  height: auto;
  max-height: 80px;
  filter: drop-shadow(0 0 8px rgba(67, 97, 238, 0.6));
  animation: bannerGlow 3s infinite alternate;
}

@keyframes bannerGlow {
  0% { 
    filter: drop-shadow(0 0 8px rgba(67, 97, 238, 0.6));
  }
  100% { 
    filter: drop-shadow(0 0 15px rgba(247, 37, 133, 0.8));
  }
}

.article-modal-close {
  background: var(--danger-red);
  color: var(--white);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-modal-close:hover {
  background: var(--hot-magenta);
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(247, 37, 133, 0.8);
}

.article-modal-title {
  font-family: var(--font-primary);
  font-size: 1.8rem;
  color: var(--cyber-gold);
  margin: 0 0 15px 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.article-modal-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--light-grey);
}

.article-modal-author {
  color: var(--electric-blue);
  font-style: italic;
}

.article-modal-date {
  color: var(--light-grey);
  font-family: var(--font-mono);
}

.article-modal-body {
  color: var(--white);
  line-height: 1.7;
  margin-bottom: 25px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.article-modal-body p {
  margin-bottom: 16px;
  font-size: 1.1rem;
  color: #f0f0f0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.article-full-content {
  background: rgba(26, 26, 26, 0.9);
  border: 1px solid var(--electric-blue);
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
  color: #f0f0f0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.article-full-content p {
  color: #f0f0f0 !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  margin-bottom: 16px;
}

.article-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.no-books-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--light-grey);
}

.no-books-message h3 {
  color: var(--electric-blue);
  margin-bottom: 10px;
}

.download-button {
  background: var(--gradient-secondary);
  color: var(--white);
  border: none;
  padding: 8px 12px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(67, 97, 238, 0.3);
  flex-shrink: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 200px;
  font-size: 0.8rem;
}

.download-button:hover {
  background: var(--gradient-primary);
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(247, 37, 133, 0.5);
}

/* Section Toggle */
.section-toggle {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 30px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--electric-blue);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.section-btn {
  flex: 1;
  background: var(--dark-grey);
  color: var(--electric-blue);
  border: none;
  padding: 12px 20px;
  font-family: var(--font-primary);
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  position: relative;
}

.section-btn:hover {
  background: var(--electric-blue);
  color: var(--dark-grey);
  transform: translateY(-1px);
}

.section-btn.active {
  background: var(--gradient-primary);
  color: var(--white);
  box-shadow: 0 0 15px rgba(247, 37, 133, 0.5);
  border-color: var(--rose);
}

.section-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--vivid-sky-blue);
  animation: sectionGlow 2s infinite alternate;
}

@keyframes sectionGlow {
  0% { box-shadow: 0 0 5px var(--vivid-sky-blue); }
  100% { box-shadow: 0 0 15px var(--vivid-sky-blue); }
}

/* Filter Section */
.filter-section {
  width: 100%;
  padding: 20px;
  background: var(--med-grey);
  border: 1px solid var(--electric-blue);
  border-radius: 8px;
  margin-bottom: 20px;
}

.filter-label {
  color: var(--electric-blue);
  font-family: var(--font-mono);
  font-weight: bold;
  margin-bottom: 15px;
  text-align: center;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.filter-btn {
  background: var(--dark-grey);
  color: var(--electric-blue);
  border: 1px solid var(--electric-blue);
  padding: 8px 15px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
}

.filter-btn:hover {
  background: var(--electric-blue);
  color: var(--dark-grey);
  transform: translateY(-2px);
}

.filter-btn.active {
  background: var(--hot-magenta);
  color: var(--white);
  border-color: var(--hot-magenta);
  box-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 10, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(5px);
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 3px solid var(--light-grey);
  border-top: 3px solid var(--electric-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  color: var(--electric-blue);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
  0%, 33% { content: 'ACCESSING MAINFRAME...'; }
  34%, 66% { content: 'ACCESSING MAINFRAME....'; }
  67%, 100% { content: 'ACCESSING MAINFRAME.....'; }
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .title {
    font-size: 2rem;
  }
  
  .terminal-window {
    margin: 10px;
  }
  
  .library-header {
    flex-direction: column;
    gap: 20px;
  }
  
  .library-title {
    font-size: 2rem;
  }
  
  .book-grid {
    grid-template-columns: 1fr;
    padding: 10px;
  }
  
  .book-card {
    flex-direction: column;
    min-height: auto;
  }
  
  .book-cover-section {
    width: 100%;
    height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--electric-blue);
  }
  
  .book-cover {
    max-width: 150px;
    max-height: 180px;
  }
  
  .challenge-input-section {
    flex-direction: column;
  }
  
  .challenge-input-section .cyber-button {
    width: 100%;
  }
  
  .status-bar {
    flex-wrap: wrap;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .title {
    font-size: 1.5rem;
  }
  
  .terminal-body {
    padding: 15px;
  }
  
  .cyber-button {
    padding: 12px 20px;
  }
}