/* Modern Relic Stylesheet v6.0 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Modern Color Palette */
  --bg-color: #0a0e1a;
  --bg-secondary: #12171f;
  --nav-color: #1a1f2e;
  --accent-color: #6366f1;
  --accent-secondary: #8b5cf6;
  --text-color: #e2e8f0;
  --text-muted: #94a3b8;
  --border-color: #2d3548;
  --hover-bg: #252b3b;
  --btn-bg: #2d3548;
  --btn-hover-bg: #6366f1;
  
  /* Glassmorphism */
  --glass-bg: rgba(26, 31, 46, 0.7);
  --glass-border: rgba(99, 102, 241, 0.2);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
  
  /* Sidebar */
  --sidebar-top: #0d1018;
  --sidebar-mid: #0f1420;
  --sidebar-bottom: #091229;
  --sidebar-text: rgba(226, 232, 240, 0.8);
  --sidebar-text-hover: #ffffff;
  --sidebar-hover: rgba(99, 102, 241, 0.15);
  --sidebar-active-bg: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.25) 100%);
  --sidebar-accent-border: linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%);
}

/* Base Styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #0a0e1a 0%, #12171f 100%);
  background-attachment: fixed;
  color: var(--text-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Animated Background Pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 50% 20%, rgba(99, 102, 241, 0.03) 0%, transparent 50%);
  z-index: -1;
  animation: backgroundPulse 15s ease-in-out infinite;
}

@keyframes backgroundPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

/* Snow container */
#snow-container {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  overflow: hidden;
}

.snowflake {
  position: absolute;
  top: -10px;
  background: white;
  border-radius: 50%;
  opacity: 0.8;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.8));
  animation-name: fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes fall {
  to {
    transform: translateY(100vh) rotate(360deg);
  }
}

/* Modern Navbar (Hidden but styled) */
.navbar {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
  justify-content: center;
  gap: 48px;
}

.logo {
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  user-select: none;
  cursor: default;
  flex-shrink: 0;
  text-decoration: none;
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.3));
}

.navbar ul {
  list-style: none;
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 0;
  justify-content: center;
  flex-grow: 1;
  max-width: 700px;
}

.navbar li a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  position: relative;
  overflow: hidden;
}

.navbar li a::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 12px;
}

.navbar li a:hover,
.navbar li a.active {
  color: #fff;
  transform: translateY(-2px);
}

.navbar li a:hover::before,
.navbar li a.active::before {
  opacity: 1;
}

.navbar li a span {
  position: relative;
  z-index: 1;
}

/* Game Filters */
.game-filters {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 32px 0;
  flex-wrap: wrap;
  padding: 0 20px;
}

.filter-btn {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  color: var(--text-muted);
  border: 1.5px solid var(--border-color);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', sans-serif;
  position: relative;
  overflow: hidden;
}

.filter-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.filter-btn:hover {
  border-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  color: var(--text-color);
}

.filter-btn.active {
  border-color: transparent;
  color: white;
  box-shadow: var(--shadow-glow);
}

.filter-btn.active::before {
  opacity: 1;
}

.filter-btn span {
  position: relative;
  z-index: 1;
}

/* Favorite Button */
.favorite-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(10px);
  border: 1.5px solid var(--border-color);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
}

.favorite-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent-color);
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.favorite-btn svg {
  color: #ffd700;
  width: 22px;
  height: 22px;
  transition: all 0.3s ease;
}

.favorite-btn.favorited {
  background: rgba(255, 215, 0, 0.15);
  border-color: #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.favorite-btn.favorited svg {
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

@keyframes favoritePopup {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.favorite-btn.favorited {
  animation: favoritePopup 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Settings Page */
.settings-page-container {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
}

.settings-page-container .settings-section {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  padding: 32px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  margin-bottom: 32px;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
}

.settings-page-container .settings-section:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.settings-page-container .settings-section h3 {
  background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 24px;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
}

.setting-item {
  margin-bottom: 20px;
}

.setting-item label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-color);
  font-size: 14px;
}

.setting-item input[type="text"],
.setting-item input[type="password"],
.setting-item select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-color);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
}

.setting-item input[type="text"]:focus,
.setting-item input[type="password"]:focus,
.setting-item select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
  background: rgba(0, 0, 0, 0.4);
}

.setting-item input[type="checkbox"] {
  margin-right: 10px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--accent-color);
}

.setting-buttons {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.btn-primary,
.btn-secondary,
.btn-small {
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-primary::before,
.btn-secondary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
  color: #fff;
  flex: 1;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-secondary {
  background: var(--btn-bg);
  color: var(--text-color);
  flex: 1;
  border: 1.5px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--accent-color);
  transform: translateY(-2px);
}

.btn-secondary:hover::before {
  opacity: 0.1;
}

.btn-small {
  background: var(--btn-bg);
  color: var(--text-color);
  padding: 10px 20px;
  margin-left: 12px;
  border: 1.5px solid var(--border-color);
}

.btn-small:hover {
  background: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
  transform: translateY(-2px);
}

.btn-primary span,
.btn-secondary span {
  position: relative;
  z-index: 1;
}

/* Info Modals */
.info-modal {
  display: none;
  position: fixed;
  z-index: 10001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
}

.info-modal-content {
  background: var(--glass-bg);
  backdrop-filter: blur(30px);
  margin: 5% auto;
  padding: 0;
  border: 2px solid var(--glass-border);
  border-radius: 24px;
  width: 90%;
  max-width: 750px;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(99, 102, 241, 0.2);
  animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.info-modal-content h2 {
  margin: 0;
  padding: 32px 40px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.1));
  font-size: 36px;
  font-weight: 800;
  text-align: center;
  border-bottom: 2px solid var(--glass-border);
  background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.info-modal-content h3 {
  color: var(--accent-color);
  font-size: 22px;
  font-weight: 700;
  margin-top: 28px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.info-modal-content h4 {
  color: var(--text-color);
  font-size: 18px;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 12px;
}

.info-modal-body {
  padding: 32px 40px;
  overflow-y: auto;
  max-height: calc(85vh - 120px);
}

.info-modal-body::-webkit-scrollbar {
  width: 10px;
}

.info-modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.info-modal-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent-color), var(--accent-secondary));
  border-radius: 10px;
}

.info-modal-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent-secondary), var(--accent-color));
}

.info-modal-body p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 16px;
}

.info-modal-body ul {
  list-style: none;
  padding-left: 0;
  margin: 16px 0;
}

.info-modal-body ul li {
  color: var(--text-color);
  padding: 14px 18px;
  margin-bottom: 10px;
  background: rgba(99, 102, 241, 0.05);
  border-left: 3px solid var(--accent-color);
  border-radius: 10px;
  line-height: 1.6;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-modal-body ul li:hover {
  background: rgba(99, 102, 241, 0.1);
  transform: translateX(6px);
  border-left-width: 4px;
}

.info-modal-body a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.info-modal-body a:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

.info-close {
  color: var(--text-muted);
  position: absolute;
  top: 24px;
  right: 32px;
  font-size: 36px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.info-close:hover {
  color: var(--accent-color);
  transform: rotate(90deg);
  background: rgba(99, 102, 241, 0.1);
}

/* Homepage Info Buttons */
.homepage-info-buttons {
  position: fixed;
  bottom: 40px;
  left: 100px;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 40px;
  pointer-events: none;
  z-index: 100;
}

.info-btn {
  pointer-events: all;
  padding: 16px 32px;
  border: 2px solid var(--glass-border);
  border-radius: 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.info-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.info-btn:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: var(--accent-color);
}

.info-btn:hover::before {
  opacity: 1;
}

.info-btn span {
  position: relative;
  z-index: 1;
}

.info-btn:active {
  transform: translateY(-2px);
}

/* Container and Content */
.container {
  max-width: 1400px;
  margin: 24px auto;
  padding: 24px;
  text-align: center;
}

.content {
  animation: fadeIn 0.4s ease;
}

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

/* Game and App Grids */
.game-grid, .app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
  justify-items: center;
  padding: 0 20px;
}

.game-card, .app-card {
  position: relative;
  width: 280px;
  height: 280px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  background: linear-gradient(135deg, #1a1f2e, #12171f);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1.5px solid var(--border-color);
}

.game-card::before, .app-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.1));
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
}

.game-card:hover, .app-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: var(--shadow-lg), 0 16px 48px rgba(99, 102, 241, 0.3);
  border-color: var(--accent-color);
}

.game-card:hover::before, .app-card:hover::before {
  opacity: 1;
}

.game-card img, .app-card img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-card:hover img, .app-card:hover img {
  transform: scale(1.05);
}

.game-card h3, .app-card h3 {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0;
  padding: 20px;
  background: linear-gradient(to top, 
    rgba(10, 14, 26, 0.98), 
    rgba(10, 14, 26, 0.9), 
    transparent);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  z-index: 2;
  backdrop-filter: blur(10px);
  user-select: none;
  letter-spacing: 0.3px;
}

/* Search Container */
.search-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 32px auto;
  gap: 12px;
  max-width: 600px;
  padding: 0 20px;
}

.search-container input[type="text"] {
  flex: 1;
  padding: 14px 20px;
  border-radius: 16px;
  border: 1.5px solid var(--border-color);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  color: var(--text-color);
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
}

.search-container input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.search-container button {
  padding: 14px 28px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-md);
}

.search-container button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* Back Buttons */
#backToHomeApps,
#backToHomeGame,
#backToHomeWebsites {
  padding: 14px 32px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 32px;
  box-shadow: var(--shadow-md);
}

#backToHomeApps:hover,
#backToHomeGame:hover,
#backToHomeWebsites:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* Game Play Area */
.game-play-area {
  background: #000;
  border: 2px solid var(--accent-color);
  border-radius: 20px;
  padding: 12px;
  position: relative;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.game-iframe {
  width: 100%;
  height: 600px;
  border: none;
  border-radius: 12px;
}

.fullscreen-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px 20px;
  cursor: pointer;
  z-index: 10000;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-md);
}

.fullscreen-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Admin Panel Styles */
.admin-subsection {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.admin-subsection h4 {
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 20px;
  font-weight: 700;
}
