/* Root colors for dark Steam-like UI */
:root {
  --bg: #1b1e24;
  --bg-dark: #111317;
  --accent: #1793d1;
  --accent-light: #22b8ff;
  --text: #e6e6e6;
  --text-muted: #a0a0a0;
  --input-bg: #2a2e38;
  --border: #3a3f4b;
  --error: #ff4c4c;
}

/* Reset and global styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Prevent unwanted scrollbars on play/game pages */
html, body.play-page, body.game-page {
  height: 100%;
  overflow: hidden;
}

/* Form wrapper to center content */
form {
  background-color: var(--bg-dark);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  width: 100%;
  max-width: 400px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
}

/* Adjust .play-main/.game-main to not add extra space */
.play-main, .game-main {
  height: 100%;
  min-height: 0;
  padding: 0; /* Remove vertical padding to avoid overflow */
}

/* Label/input block styling */
label {
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
}

input[type="text"],
input[type="password"],
input[type="email"] {
  width: 100%;
  padding: 0.6rem;
  margin-top: 0.3rem;
  background-color: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 1rem;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  background-color: #303542;
}

/* --- Dropdown (select) styling --- */
select {
  background-color: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.6rem 2.2rem 0.6rem 0.8rem;
  font-size: 1rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  transition: border 0.2s, box-shadow 0.2s;
  outline: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  min-width: 180px;
}

select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px #1793d133;
}

option {
  background: var(--bg-dark);
  color: var(--text);
}

/* Optional: add a dropdown arrow using a background SVG */
select {
  background-image:
    linear-gradient(45deg, transparent 49%, #22b8ff 51%),
    linear-gradient(135deg, #22b8ff 51%, transparent 49%);
  background-position:
    calc(100% - 18px) calc(1em + 2px),
    calc(100% - 13px) calc(1em + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
}

/* Submit button */
button {
  background-color: var(--accent);
  color: #fff;
  border: none;
  padding: 0.7rem;
  font-size: 1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease;
  margin-top: 1.2rem;
}

button:hover {
  background-color: var(--accent-light);
}

/* Error message style */
#error-message {
  margin-top: 1rem;
  color: var(--error);
  text-align: center;
  font-size: 0.95rem;
}

/* Status Page Styles */
h1 {
  color: var(--accent);
  margin-bottom: 0.5rem;
  text-align: center;
}

p {
  margin: 0.5rem 0;
  color: var(--text-muted);
  text-align: center;
}

button.dashboard-btn,
button.logout-btn {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.6rem 1rem;
  background-color: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  transition: background 0.3s ease;
  text-align: center;
}

button.dashboard-btn:hover,
button.logout-btn:hover {
  background-color: var(--accent-light);
}

a {
    color: var(--accent);
}

/* Dashboard Page Styles */
/* === DASHBOARD PAGE LAYOUT === */
body.dashboard-page {
  background: linear-gradient(120deg, #10111a 0%, #1a237e 40%, #232336 100%);
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #e6e6e6;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Header section */
.dashboard-page header {
  width: 100%;
  padding: 1rem 2rem;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 1.2rem;
  border-bottom: 1px solid #333;
  box-sizing: border-box;
}


/* Logout Button */
.dashboard-page .logout-btn {
  background-color: #c62828;
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.3s ease;
}

.dashboard-page .logout-btn:hover {
  background-color: #e53935;
}

/* Tabs container */
.dashboard-page .tabs {
  display: flex;
  width: 100%;
  background-color: rgba(20, 20, 30, 0.95);
  border-bottom: 2px solid #333;
}

/* Each tab takes 1/3 of the row */
.dashboard-page .tab {
  flex: 1;
  text-align: center;
  padding: 1rem 0;
  font-size: 1rem;
  color: #ccc;
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease;
  border-bottom: 3px solid transparent;
}

.dashboard-page .tab:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.dashboard-page .tab.active {
  color: white;
  font-weight: bold;
  border-bottom: 3px solid #1793d1;
}

/* Main content area fills rest of screen */
.dashboard-page .content {
  flex: 1;
  width: 100%;
  padding: 2rem;
  overflow-y: auto;
  box-sizing: border-box;
  background-color: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
}

/* === Game Cards Grid === */
.downloads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
  justify-items: center; /* center cards */
  transition: gap 0.3s;
}

/* === Individual Game Card === */
.game-item {
  background-color: rgba(0, 0, 0, 0.5);
  border: 1px solid #2c2f36;
  border-radius: 10px;
  padding: 1rem;
  width: 100%;
  max-width: 300px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: cardPopIn 0.5s cubic-bezier(0.4,0,0.2,1);
}

.game-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 20px rgba(23, 147, 209, 0.4);
  background: rgba(80, 80, 90, 0.18); /* more neutral, less blue */
}

/* === Game Thumbnail === */
.game-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 0.8rem;
  background-color: #111;
}

/* === Game Info === */
.game-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.3rem;
}

.game-system {
  font-size: 0.9rem;
  color: #aaa;
  margin-bottom: 1rem;
}

/* === Full-width Button === */
.game-item button {
  width: 100%;
  padding: 0.6rem;
  font-size: 1rem;
  background-color: #1793d1;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.game-item button:hover {
  background-color: #22b8ff;
}

.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* Loading spinner style */
.loading-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid #1793d1;
  border-top: 3px solid #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-left: 8px;
}

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

/* User Requests Table Styles */
.user-requests-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: rgba(0,0,0,0.4);
}
.user-requests-table th, .user-requests-table td {
  border: 1px solid #2c2f36;
  padding: 0.7rem 1rem;
  text-align: left;
}
.user-requests-table th {
  background: #232336;
  color: #22b8ff;
}
.user-requests-table tr:nth-child(even) {
  background: rgba(30, 40, 60, 0.3);
}
.user-requests-table button {
  padding: 0.4rem 1rem;
  font-size: 1rem;
  background: #1793d1;
  border-radius: 4px;
  border: none;
  color: #fff;
  cursor: pointer;
}
.user-requests-table button:hover {
  background: #22b8ff;
}

.game-downloads-line {
  font-size: 0.98em;
  color: #22b8ff;
  margin-bottom: 0.7em;
  margin-top: 0.2em;
  font-weight: 500;
}

/* === Animations and Transitions === */

/* Fade-in for main content */
.dashboard-page .content {
  animation: fadeIn 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
}

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

/* Tab underline slide animation */
.dashboard-page .tab {
  position: relative;
  overflow: hidden;
  transition: color 0.2s;
}
.dashboard-page .tab.active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #1793d1 0%, #22b8ff 100%);
  transition: width 0.4s cubic-bezier(0.4,0,0.2,1), left 0.4s cubic-bezier(0.4,0,0.2,1);
  width: 100%;
  left: 0;
}
.dashboard-page .tab:not(.active)::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #1793d1 0%, #22b8ff 100%);
  transition: width 0.4s cubic-bezier(0.4,0,0.2,1), left 0.4s cubic-bezier(0.4,0,0.2,1);
}

/* Game card pop-in animation */
.game-item {
  animation: cardPopIn 0.5s cubic-bezier(0.4,0,0.2,1);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

@keyframes cardPopIn {
  from { opacity: 0; transform: scale(0.95) translateY(30px);}
  to   { opacity: 1; transform: scale(1) translateY(0);}
}

/* Button press animation */
button, .game-item button, .user-requests-table button {
  transition: background 0.2s, transform 0.1s;
}
button:active, .game-item button:active, .user-requests-table button:active {
  transform: scale(0.96);
}

/* Input and select focus animation */
input:focus, select:focus {
  box-shadow: 0 0 0 2px #22b8ff55;
  transition: box-shadow 0.2s;
}

/* Dropdown open animation (for supported browsers) */
select {
  transition: box-shadow 0.2s, border 0.2s, background 0.2s;
}

/* Fade-in for error messages */
#error-message {
  animation: fadeIn 0.5s;
}

/* Smooth hover for cards */
.game-item:hover {
  background: rgba(80, 80, 90, 0.18); /* more neutral, less blue */
  box-shadow: 0 0 24px 0 #22263a66;
  transform: translateY(-7px) scale(1.025);
}

/* Smooth transition for downloads grid */
.downloads {
  transition: gap 0.3s;
}

/* === Admin Panel Animations === */

/* Fade-in for the admin panel container */
.user-requests {
  animation: fadeInAdmin 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
}

@keyframes fadeInAdmin {
  from { opacity: 0; transform: translateY(40px) scale(0.98);}
  to   { opacity: 1; transform: translateY(0) scale(1);}
}

/* Table row slide-in animation */
.user-requests-table tbody tr {
  animation: adminRowIn 0.5s cubic-bezier(0.4,0,0.2,1);
}

@keyframes adminRowIn {
  from { opacity: 0; transform: translateX(-40px);}
  to   { opacity: 1; transform: translateX(0);}
}

/* Approve/Decline button pulse on hover */
.user-requests-table button:hover {
  animation: adminBtnPulse 0.4s;
  background: #22b8ff;
}

@keyframes adminBtnPulse {
  0%   { box-shadow: 0 0 0 0 #22b8ff44; }
  70%  { box-shadow: 0 0 0 8px #22b8ff22; }
  100% { box-shadow: 0 0 0 0 #22b8ff00; }
}

/* Subtle highlight on row hover */
.user-requests-table tbody tr:hover {
  background: rgba(34, 184, 255, 0.08);
  transition: background 0.2s;
}

/* === Play/Game Page Styles === */
body.play-page, body.game-page {
  background: linear-gradient(120deg, #10111a 0%, #1a237e 40%, #232336 100%);
  color: #e6e6e6;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

/* --- Play/Game Controls Drop-down Banner (entire banner, not just buttons) --- */
.play-header, .game-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 20;
  background: rgba(0,0,0,0.65);
  padding: 1.2rem 2rem 1rem 2rem;
  border-bottom: 1px solid #22263a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.4,0,0.2,1), opacity 0.45s cubic-bezier(0.4,0,0.2,1);
}

/* Create a hover zone at the very top of the page, but only as wide as the banner */
.play-hover-zone, .game-hover-zone {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 48px;
  z-index: 30;
  pointer-events: auto;
  background: transparent;
}

/* Show the banner when hovering the hover zone or the banner itself */
.play-hover-zone:hover ~ .play-header,
.play-header:hover,
.game-hover-zone:hover ~ .game-header,
.game-header:hover {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Responsive: banner always visible on mobile */
@media (max-width: 700px) {
  .play-header, .game-header {
    position: static;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 1rem 1rem 0.7rem 1rem;
  }
  .play-hover-zone, .game-hover-zone {
    display: none;
  }
}

/* Play/Game main content area */
.play-main, .game-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.18);
  min-height: 0;
  min-width: 0;
  position: relative;
  padding: 2vw 0; /* Add vertical space for background */
  box-sizing: border-box;
}

/* Make iframe fill available space but leave a gap for the background */
.play-iframe, .game-iframe {
  width: 96vw;
  height: 94vh;
  max-width: 1600px;
  max-height: 94vh;
  min-width: 320px;
  min-height: 200px;
  border: 4px solid #22b8ff;
  border-radius: 18px;
  background: #111317;
  box-shadow: 0 0 32px 0 #22b8ff33, 0 0 0 1px #232336;
  transition: box-shadow 0.2s, border-color 0.2s;
  display: block;
  box-sizing: border-box;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .play-iframe, .game-iframe {
    width: 99vw;
    height: 80vh;
    min-width: 0;
    min-height: 0;
  }
  .play-main, .game-main {
    padding: 1vw 0;
  }
}

@media (max-width: 700px) {
  .play-header, .game-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 1rem 1rem 0.7rem 1rem;
  }
  .play-main, .game-main {
    padding: 0.5rem 0;
  }
  .play-iframe, .game-iframe {
    width: 98vw;
    height: 65vw;
    min-width: 0;
    min-height: 180px;
    border-radius: 10px;
    border-width: 2.5px;
  }
}

/* Add this at the end of your file or near other play-controls styles */

/* Dropdown for screen size in controls */
.play-controls .screen-size-dropdown {
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.4rem 1.8rem 0.4rem 0.8rem;
  font-size: 1rem;
  margin-left: 0.5rem;
  appearance: none;
  min-width: 120px;
  cursor: pointer;
  transition: border 0.2s, box-shadow 0.2s;
  outline: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.play-controls .screen-size-dropdown:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px #1793d133;
}

.play-controls .screen-size-dropdown option {
  background: var(--bg-dark);
  color: var(--text);
}