/* Typography */
h1, h2, h3 {
  font-family: var(--font-title);
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

body {
  background: linear-gradient(180deg, #0a0000 0%, #1a0505 100%);
  min-height: 100vh;
}

/* Warning Screen */
.warning-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a0000 0%, #2d0a0a 100%);
  z-index: 9998;
}

.warning-content {
  text-align: center;
  max-width: 600px;
  padding: 3rem;
  background: rgba(0,0,0,0.8);
  border: 3px solid var(--color-primary);
  border-radius: 16px;
  box-shadow: 0 0 50px rgba(255,69,0,0.5);
}

.warning-content h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--color-primary);
  animation: pulse 2s infinite;
}

.warning-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: var(--color-text-dim);
}

.online-count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 0;
  font-size: 1.5rem;
  color: var(--color-accent);
}

.btn-primary, .btn-secondary, .btn-success {
  padding: 1rem 2rem;
  font-family: var(--font-title);
  font-size: 1.2rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  box-shadow: 0 4px 15px rgba(255,69,0,0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255,69,0,0.6);
}

.btn-secondary {
  background: rgba(139,0,0,0.5);
  color: #fff;
  border: 2px solid var(--color-secondary);
}

.btn-secondary:hover {
  background: rgba(139,0,0,0.7);
}

.btn-success {
  background: #228b22;
  color: #fff;
}

.btn-success:hover {
  background: #1a6b1a;
}

/* Top Bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(0,0,0,0.9);
  border-bottom: 2px solid var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 10px var(--color-primary));
  animation: float-logo 3s ease-in-out infinite;
}

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

.logo h1 {
  font-size: 1.5rem;
  color: var(--color-primary);
}

.user-progress {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Progress Bar */
.xp-bar {
  width: 300px;
  height: 24px;
  background: rgba(0,0,0,0.5);
  border: 2px solid var(--color-accent);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-secondary), var(--color-primary));
  transition: width 0.5s ease;
  box-shadow: 0 0 20px var(--color-primary);
}

#xpText {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  font-weight: bold;
  text-shadow: 1px 1px 2px #000;
}

.level-badge {
  background: rgba(255,69,0,0.2);
  border: 2px solid var(--color-primary);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  text-align: center;
}

.level-badge span {
  font-weight: bold;
  color: var(--color-primary);
  display: block;
}

.level-badge p {
  font-size: 0.75rem;
  color: var(--color-text-dim);
  margin-top: 0.25rem;
}

/* Controls */
.controls {
  display: flex;
  gap: 0.5rem;
}

.icon-btn {
  background: rgba(255,69,0,0.2);
  border: 2px solid var(--color-primary);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.icon-btn:hover {
  background: rgba(255,69,0,0.4);
  transform: scale(1.1);
}

/* Chat Sidebar */
.chat-sidebar {
  position: fixed;
  right: 0;
  top: 60px;
  width: 350px;
  height: calc(100vh - 60px);
  background: rgba(10,0,0,0.95);
  border-left: 2px solid var(--color-primary);
  display: flex;
  flex-direction: column;
  z-index: 900;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(0,0,0,0.8);
  border-bottom: 2px solid var(--color-primary);
}

.bot-avatar {
  font-size: 2rem;
  animation: float-avatar 2s ease-in-out infinite;
}

@keyframes float-avatar {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(5deg); }
}

.bot-info {
  flex: 1;
}

.bot-info strong {
  display: block;
  color: var(--color-primary);
}

.bot-info .status {
  font-size: 0.75rem;
  color: var(--color-text-dim);
}

.close-btn {
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-btn:hover {
  color: var(--color-primary);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.chat-message {
  margin-bottom: 1rem;
  display: flex;
}

.chat-message.bot {
  justify-content: flex-start;
}

.chat-message.user {
  justify-content: flex-end;
}

.message-bubble {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(255,69,0,0.2);
  border: 1px solid var(--color-primary);
}

.chat-message.user .message-bubble {
  background: rgba(139,0,0,0.5);
}

@keyframes typeIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.chat-input {
  display: flex;
  padding: 1rem;
  background: rgba(0,0,0,0.8);
  border-top: 2px solid var(--color-primary);
}

.chat-input input {
  flex: 1;
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--color-primary);
  border-radius: 8px;
  padding: 0.5rem;
  color: var(--color-text);
  font-family: var(--font-main);
}

.chat-input button {
  background: var(--color-primary);
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  margin-left: 0.5rem;
  color: #fff;
  cursor: pointer;
  transition: background 0.3s ease;
}

.chat-input button:hover {
  background: var(--color-accent);
}

/* Main Content */
.main-content {
  margin-right: 350px;
  padding: 2rem;
}

/* Daily Challenge */
.daily-challenge {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255,69,0,0.1);
  border: 2px solid var(--color-primary);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.challenge-icon {
  font-size: 3rem;
}

.challenge-info {
  flex: 1;
}

.challenge-info h3 {
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.challenge-progress {
  margin-top: 0.5rem;
  height: 8px;
  background: rgba(0,0,0,0.5);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-secondary), var(--color-primary));
  transition: width 0.5s ease;
}

.challenge-timer {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--color-accent);
}

/* Controls Bar */
.controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(255,69,0,0.2);
  border: 2px solid var(--color-primary);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  color: var(--color-text);
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--color-primary);
  color: #000;
  font-weight: bold;
}

.sort-select {
  background: rgba(255,69,0,0.2);
  border: 2px solid var(--color-primary);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  color: var(--color-text);
  font-family: var(--font-main);
  cursor: pointer;
}

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

.video-card {
  background: rgba(20,0,0,0.8);
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: cardFadeIn 0.5s ease backwards;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
}

.video-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 10px 30px rgba(255,69,0,0.4);
}

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

.video-card.watched {
  border-color: #228b22;
}

.video-thumbnail {
  position: relative;
  padding-top: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
  background: #000;
}

.video-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.lazy-img {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lazy-img.loaded {
  opacity: 1;
}

.video-card:hover .video-thumbnail img {
  transform: scale(1.1);
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  font-size: 3rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-card:hover .play-overlay {
  opacity: 1;
}

.lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.8);
  font-size: 2rem;
}

.lock-overlay p {
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Badges */
.new-badge, .hot-badge, .watched-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  z-index: 10;
}

.new-badge {
  background: #00ff00;
  color: #000;
}

.hot-badge {
  background: var(--color-primary);
  animation: pulse 2s infinite;
}

.watched-badge {
  background: rgba(0,0,0,0.8);
  color: #0f0;
  top: auto;
  bottom: 10px;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.video-info {
  padding: 1rem;
}

.video-title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.video-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--color-text-dim);
}

.category {
  background: rgba(255,69,0,0.3);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal:not(.hidden) {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--color-bg);
  border: 3px solid var(--color-primary);
  border-radius: 16px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  position: relative;
  padding: 2rem;
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--color-primary);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.close-modal:hover {
  background: var(--color-accent);
  transform: rotate(90deg);
}

.video-info h2 {
  margin: 1rem 0;
  color: var(--color-primary);
}

.video-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.related-videos {
  margin-top: 2rem;
}

.related-videos h3 {
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

/* Window Projection Section */
.window-projection-section {
  margin: 3rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(139,0,0,0.3), rgba(255,69,0,0.1));
  border: 2px solid var(--color-accent);
  border-radius: 12px;
}

.window-projection-section h2 {
  text-align: center;
  color: var(--color-primary);
  margin-bottom: 1.5rem;
  font-size: 2rem;
}

.projection-info > p {
  text-align: center;
  font-size: 1.2rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.projection-benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.benefit-item {
  text-align: center;
  padding: 1.5rem;
  background: rgba(0,0,0,0.5);
  border: 2px solid var(--color-primary);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.benefit-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(255,69,0,0.4);
}

.benefit-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

.benefit-item h3 {
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.benefit-item p {
  color: var(--color-text-dim);
  font-size: 0.9rem;
}

.projection-steps {
  margin: 2rem 0;
  padding: 1.5rem;
  background: rgba(0,0,0,0.5);
  border-left: 4px solid var(--color-primary);
  border-radius: 8px;
}

.projection-steps h3 {
  color: var(--color-accent);
  margin-bottom: 1rem;
}

.projection-steps ol {
  padding-left: 1.5rem;
}

.projection-steps li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
  color: var(--color-text);
}

.projection-steps strong {
  color: var(--color-primary);
}

.projection-tips {
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(255,69,0,0.1);
  border: 2px dashed var(--color-accent);
  border-radius: 8px;
}

.projection-tips h4 {
  color: var(--color-accent);
  margin-bottom: 1rem;
}

.projection-tips ul {
  padding-left: 1.5rem;
}

.projection-tips li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
  color: var(--color-text-dim);
}

/* Mini Games Section */
.minigames-section {
  margin-top: 3rem;
  padding: 2rem;
  background: rgba(0,0,0,0.5);
  border: 2px solid var(--color-primary);
  border-radius: 12px;
}

.minigames-section h2 {
  text-align: center;
  color: var(--color-primary);
  margin-bottom: 2rem;
}

.minigame-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.minigame-card {
  background: rgba(20,0,0,0.8);
  border: 2px solid var(--color-secondary);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.minigame-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(255,69,0,0.4);
}

.game-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.minigame-card h3 {
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.play-btn {
  margin-top: 1rem;
  padding: 0.5rem 1.5rem;
  background: var(--color-primary);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-title);
  cursor: pointer;
  transition: all 0.3s ease;
}

.play-btn:hover {
  background: var(--color-accent);
  transform: scale(1.05);
}

/* Floating Elements */
.floating-elements {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.bat, .ghost {
  position: fixed;
  font-size: 2rem;
  animation: float 20s infinite;
  animation-delay: var(--delay);
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(100vw, 20vh) rotate(180deg);
  }
  50% {
    transform: translate(80vw, 80vh) rotate(360deg);
  }
  75% {
    transform: translate(20vw, 60vh) rotate(180deg);
  }
}

/* Notifications */
.notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(0,0,0,0.9);
  border: 2px solid var(--color-primary);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  max-width: 400px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 3000;
}

.notification.show {
  transform: translateY(0);
  opacity: 1;
}

.notification-content strong {
  display: block;
  color: var(--color-primary);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .main-content {
    margin-right: 0;
  }

  .chat-sidebar {
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .chat-sidebar.active {
    transform: translateX(0);
  }

  .video-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }

  .top-bar {
    flex-direction: column;
    gap: 1rem;
  }

  .xp-bar {
    width: 200px;
  }

  .controls-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filters {
    justify-content: center;
  }
}
