/* Landing Page Specific Styles */

/* Landing Page Styles */
.landing-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: block;
  z-index: 100;
  opacity: 1;
  transition: opacity 0.5s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Make container scrollable and start from top */
.landing-page .container {
  min-height: 100vh;
  padding: 60px 20px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

body.game-mode .landing-page {
  opacity: 0;
  pointer-events: none;
}

/* Idle Clippy - Lives in corner of normal homepage */
.idle-clippy {
  position: fixed;
  bottom: 50px;
  right: 80px;
  cursor: pointer;
  transition: transform 0.3s ease;
  z-index: 200;
}

.idle-clippy:hover {
  transform: scale(1.1);
}

.clippy-character {
  position: relative;
  width: 120px;
  height: 120px;
}

.clippy-body {
  font-size: 100px;
  animation: clippy-idle 3s ease-in-out infinite;
  filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
}

/* Clippy Speech Bubble */
.clippy-bubble {
  position: absolute;
  bottom: 130px;
  right: -20px;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  max-width: 250px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  z-index: 1000;
  transition: all 0.3s ease;
}

.clippy-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 40px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid rgba(255, 255, 255, 0.95);
  transition: border-top-color 0.3s ease;
}

.clippy-bubble.show {
  animation: tooltip-pulse 0.3s ease forwards;
}

/* Desperate state - aggressive styling */
.clippy-bubble.desperate {
  background: linear-gradient(135deg, rgba(255, 80, 80, 0.95), rgba(255, 40, 40, 0.95));
  color: white;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow:
    0 6px 25px rgba(255, 40, 40, 0.6),
    0 0 30px rgba(255, 40, 40, 0.4);
  border-radius: 8px;
  font-size: 15px;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.clippy-bubble.desperate.show {
  animation:
    tooltip-pulse 0.3s ease forwards,
    desperate-shake 0.3s ease 0.3s forwards,
    desperate-pulse 1s ease-in-out 0.6s infinite;
}

.clippy-bubble.desperate::after {
  border-top-color: rgba(255, 40, 40, 0.95);
}

@keyframes desperate-shake {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-3px) rotate(-2deg);
  }
  75% {
    transform: translateY(-3px) rotate(2deg);
  }
}

@keyframes desperate-pulse {
  0%,
  100% {
    box-shadow:
      0 6px 25px rgba(255, 40, 40, 0.6),
      0 0 30px rgba(255, 40, 40, 0.4);
  }
  50% {
    box-shadow:
      0 8px 35px rgba(255, 40, 40, 0.8),
      0 0 50px rgba(255, 40, 40, 0.6);
  }
}

/* Clippy Play Button */
.clippy-play-button {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
  white-space: nowrap;
  z-index: 100;
}

.clippy-play-button:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.clippy-play-button:active {
  transform: translateX(-50%) scale(0.95);
}

/* Hide button when Clippy is chasing or moving slowly */
.idle-clippy.moving .clippy-play-button,
.idle-clippy.chasing .clippy-play-button,
.idle-clippy.caught .clippy-play-button {
  display: none;
}

/* Clippy Chasing State */
.idle-clippy.chasing {
  position: fixed;
  animation: none;
  z-index: 10000;
}

.idle-clippy.chasing .clippy-body {
  animation: clippy-chase 0.3s ease-in-out infinite;
}

.idle-clippy.caught {
  animation: clippy-caught 0.5s ease-out forwards;
}

/* Windows 98 Dialog */
.win98-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10001;
  animation: dialog-appear 0.3s ease;
}

.win98-dialog.show {
  display: flex;
}

.dialog-window {
  background: #c0c0c0;
  border: 2px solid #ffffff;
  box-shadow:
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 #808080,
    2px 2px 0 #000000;
  min-width: 400px;
  max-width: 90%;
  font-family: 'MS Sans Serif', Arial, sans-serif;
}

.title-bar {
  background: linear-gradient(to right, #000080, #1084d0);
  color: white;
  padding: 3px 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: bold;
}

.title-bar-text {
  display: flex;
  align-items: center;
}

.title-bar-text::before {
  content: '📎';
  margin-right: 5px;
}

.title-bar-controls {
  display: flex;
  gap: 2px;
}

.title-bar-close {
  background: #c0c0c0;
  border: 1px solid #ffffff;
  box-shadow:
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 #808080;
  width: 16px;
  height: 14px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.title-bar-close:active {
  box-shadow:
    inset -1px -1px 0 #ffffff,
    inset 1px 1px 0 #808080;
}

.dialog-body {
  padding: 20px;
  display: flex;
  gap: 15px;
  align-items: flex-start;
  color: #000;
}

.dialog-icon {
  font-size: 48px;
  flex-shrink: 0;
}

.dialog-text p {
  margin-bottom: 10px;
  font-size: 14px;
}

.dialog-buttons {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.win98-btn {
  background: #c0c0c0;
  border: 2px solid #ffffff;
  box-shadow:
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 #808080,
    1px 1px 0 #000000;
  padding: 8px 12px;
  font-size: 13px;
  color: #000;
  cursor: pointer;
  font-family: 'MS Sans Serif', Arial, sans-serif;
  text-align: left;
  position: relative;
}

.win98-btn:hover {
  background: #d4d4d4;
}

.win98-btn:active {
  box-shadow:
    inset -1px -1px 0 #ffffff,
    inset 1px 1px 0 #808080;
}

.win98-btn:disabled {
  color: #808080;
  cursor: not-allowed;
}

.coming-soon-tag {
  font-size: 11px;
  color: #666;
  font-style: italic;
}

.win98-btn u {
  text-decoration: underline;
}

/* Animations */
@keyframes clippy-idle {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(5deg);
  }
}

@keyframes clippy-chase {
  0%,
  100% {
    transform: rotate(-10deg) scale(1);
  }
  50% {
    transform: rotate(10deg) scale(1.1);
  }
}

@keyframes clippy-caught {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(3) rotate(360deg);
  }
  100% {
    transform: scale(3) rotate(360deg);
    opacity: 0.5;
  }
}

@keyframes tooltip-pulse {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dialog-appear {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Confetti Particle */
.confetti-particle {
  position: fixed;
  width: 10px;
  height: 10px;
  pointer-events: none;
  z-index: 10002;
  animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Highscores Section */
.highscores-section {
  margin-top: 3rem;
  animation: slideUp 1s ease-out 0.7s both;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.highscores-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 2rem;
  color: #ffd700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
}

.highscores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  padding: 0 1rem;
}

.highscore-board {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 215, 0, 0.3);
  border-radius: 15px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.highscore-board h4 {
  font-size: 1.3rem;
  color: #ffd700;
  margin-bottom: 1rem;
  text-align: center;
  border-bottom: 2px solid rgba(255, 215, 0, 0.3);
  padding-bottom: 0.5rem;
}

.highscore-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.highscore-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.highscore-entry:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(5px);
}

.highscore-entry.rank-1 {
  background: rgba(255, 215, 0, 0.2);
  border: 1px solid rgba(255, 215, 0, 0.5);
}

.highscore-entry.rank-2 {
  background: rgba(192, 192, 192, 0.2);
  border: 1px solid rgba(192, 192, 192, 0.5);
}

.highscore-entry.rank-3 {
  background: rgba(205, 127, 50, 0.2);
  border: 1px solid rgba(205, 127, 50, 0.5);
}

.highscore-rank {
  font-weight: bold;
  font-size: 1.1rem;
  min-width: 30px;
  color: #ffd700;
}

.highscore-name {
  flex: 1;
  font-weight: 600;
  color: #fff;
  margin: 0 1rem;
}

.highscore-score {
  font-weight: bold;
  color: #4caf50;
  font-family: 'Courier New', monospace;
}

.highscore-list .loading {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  padding: 2rem;
}

.highscore-list .error {
  text-align: center;
  color: #ff4444;
  padding: 1rem;
}

/* Projects Section */
.projects-section {
  margin-top: 4rem;
  animation: slideUp 1s ease-out 0.9s both;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.projects-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 2rem;
  color: #ffd700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

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

/* Coming Soon section */
.coming-soon {
  margin-top: 2rem;
  padding: 1.5rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  font-size: 0.95rem;
}

.coming-soon p {
  margin: 0;
}

.project-tile {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 2rem;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  z-index: 10;
  pointer-events: auto;
}

/* Tile overlay for background images */
.tile-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.3));
  z-index: 1;
  pointer-events: none;
}

/* Tile content wrapper */
.tile-content {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.project-tile::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: rotate(45deg);
  transition: all 0.5s ease;
}

.project-tile:hover::before {
  left: 100%;
}

.project-tile:hover {
  transform: translateY(-10px);
  border-color: #ffd700;
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

.project-tile-empty {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.project-tile-clickable {
  cursor: pointer;
  pointer-events: auto;
  z-index: 20;
}

.project-tile-clickable:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-10px) scale(1.02);
  border-color: #00d4ff;
  box-shadow: 0 15px 40px rgba(0, 212, 255, 0.4);
}

.project-tile-clickable:active {
  transform: translateY(-5px) scale(0.98);
}

.tile-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
  pointer-events: none;
}

.project-tile h4 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: #ffffff;
  pointer-events: none;
}

.project-tile p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  pointer-events: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .landing-page .container {
    min-height: 100vh;
    padding: 60px 15px 150px 15px;
  }

  .content {
    width: 100%;
    margin-top: 0;
  }

  .idle-clippy {
    bottom: 30px;
    right: 30px;
  }

  .clippy-character {
    width: 80px;
    height: 80px;
  }

  .clippy-body {
    font-size: 70px;
  }

  .clippy-bubble {
    max-width: 200px;
    font-size: 12px;
    bottom: 90px;
  }

  .clippy-play-button {
    font-size: 12px;
    padding: 8px 16px;
    bottom: -45px;
  }

  .dialog-window {
    min-width: 300px;
  }

  .dialog-body {
    flex-direction: column;
    text-align: center;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .highscores-section {
    margin-top: 2rem;
  }

  .highscores-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .highscore-board {
    padding: 1.5rem;
  }

  .projects-section {
    margin-top: 2rem;
  }

  .logo {
    font-size: clamp(2.5rem, 10vw, 4rem);
  }

  .coming-soon {
    margin-top: 2rem;
  }

  .glitch {
    font-size: clamp(1.2rem, 6vw, 2rem);
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .landing-page .container {
    padding: 40px 10px 120px 10px;
  }

  .highscore-entry {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
  }

  .project-tile {
    padding: 1.5rem;
  }

  .tile-icon {
    font-size: 2.5rem;
  }
}
