/* style.css */
#W, #A, #S, #D {
    background-color: #66bb6a; /* green */
    width: 130px;
    height: 130px;
    font-size: 24px;
    border: none;
    border-radius: 14px; /* rounded corners */
    box-shadow: 0 6px 12px rgba(14,30,37,0.08);
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
}

/* W sits above the A/S/D row and is centered */
#W {
    display: block;
    margin: 18px auto 8px auto;
}

/* Small visual feedback when buttons are focused */
#W:focus, #A:focus, #S:focus, #D:focus {
    outline: 3px solid rgba(0,0,0,0.08);
}

/* Container to center the WASD controls */
.wasd-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 24px;
}

.wasd-row {
    display: flex;
    gap: 12px;
}
#Footer {
    font-size: 10px;
    text-align: right;
}

/* Button pressed state (visual feedback for keyboard/mouse) */
button.pressed,
button:active {
    transform: translateY(3px);
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.25);
    opacity: 0.95;
}

/* About page styles */
.about_main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.center-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    width: 100%;
    margin: auto;
}

.about_main h1 {
    font-size: 32px;
    margin-bottom: 40px;
    text-align: center;
}

#about-content {
    width: 100%;
    text-align: center;
    margin: 20px 0;
}

#about-content h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

#about-content p {
    line-height: 1.6;
    margin: 0 auto;
    max-width: 720px;
}

footer {
    background-color: rgb(0, 75, 152) !important;
    color: white !important;
    text-align: center !important;
    padding: 15px 0 !important;
    width: 100% !important;
    font-size: 14px !important;

    /* Force footer to stay fixed to the bottom of the viewport */
    position: fixed !important;
    left: 0 !important;
    bottom: 0 !important;
    z-index: 9999 !important;
}  

/* Navigation Bar styles */
body, ul {
    margin: 0;
    padding: 0;
}

.logo img {
    height: 50px;
    width: auto;
}

header {
    background-color: rgb(0, 75, 152);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-sizing: border-box;
}

body {
    padding-top: 70px;
}

/* Prevent fixed footer from overlapping page content by adding bottom padding
    equal or slightly larger than the footer height. Adjust if you change
    footer padding/font-size. */
/* Ensure page content doesn't get hidden behind the fixed footer.
   We use a CSS variable so the footer height can be adjusted in one place. */
:root {
    --footer-height: 70px;
}

body {
    padding-bottom: var(--footer-height);
}

/* Banner shown when user is logged in (placed above .page-wrap) */
.loggedin-banner {
    /* Ensure banner clears the fixed header. Use the page's top padding
       (70px) as a fallback but allow override via a CSS variable if needed. */
    margin-top: calc(var(--header-height, 70px) + 8px);
    margin-bottom: 10px; /* small gap to the login box */
    text-align: center;
    box-sizing: border-box;
    padding: 8px 12px;
}

/* Specific styling for the Controls page 'Coming Soon' banner */
#coming-soon-banner {
    background: #ffeb3b; /* bright yellow */
    color: #111;
    border-radius: 8px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    margin-top: calc(var(--header-height, 70px) + 12px); /* sit below fixed navbar */
    margin-bottom: 8px;
    padding: 10px 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    font-weight: 600;
    position: relative;
    z-index: 1001;
}

/* Logout button inside the logged-in banner */
.loggedin-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.loggedin-banner .logout-button {
    display: inline-block;
    background: #e74c3c;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    border: none;
}

.loggedin-banner .logout-button:hover {
    background: #c0392b;
}

/* When the banner is present immediately before the page wrap, pull the
   login container up to be closer to the banner while keeping a small top
   padding for breathing room. This only affects pages that include the banner. */
.loggedin-banner + .page-wrap {
    align-items: flex-start;
    padding-top: 12px;
}

/* If the footer height changes (due to responsive layout), this JS will update the variable.
   The script is small and safe; it runs only if JS is enabled. */
@media (min-width:0) {
    /* placeholder for browsers; actual update is done by the small script below */
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

nav a {
    color: rgb(255, 255, 255);
    text-decoration: none;
    font-weight: 500;
    font-size: 20px;
    transition: color 0.3s;
}

nav a:hover {
    color:rgb(0, 75, 152);
    background-color: rgb(255, 255, 255);
}

/* Special Controls page styles */
.speccontrols-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columns per row */
    gap: 20px; 
    max-width: 1000px; 
    margin: 0 auto; 
    padding: 20px;
    justify-items: center;
    text-align: center;
}

.speccontrol-image {
    width: 100%;
    aspect-ratio: 1 / 1; 
    border-radius: 8px;
    border: 2px solid #2a2e31;
    cursor: pointer;
    transition: all 0.2s ease;
    object-fit: cover; 
}

.speccontrol-image:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    border-color: #2980b9;
}

.speccontrol-image:active {
    transform: scale(0.95);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2);
}

.speccontrol-label {
    margin-top: 8px;
    font-size: 14px;
    color: #090909;
    font-weight: 500;
    text-transform: capitalize;
}

/* Center the login box vertically and horizontally */
html, body {
    height: 100%;
    margin: 0;
    background: #f3f6fb;
    font-family: Arial, sans-serif;
}

.page-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-container {
    width: 360px;
    background: #fff;
    padding: 28px 24px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(30,40,60,0.12);
    box-sizing: border-box;
}
.login-container h2 {
    text-align: center;
    margin: 0 0 12px;
}
.login-container form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-container label {
    font-size: 14px;
}

.login-container input[type="text"],
.login-container input[type="password"] {
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #dfe7f2;
    border-radius: 6px;
}

.login-container button[type="submit"] {
    margin-top: 6px;
    padding: 10px 12px;
    border: none;
    background: #2673e6;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
}

.login-container .actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
}

.login-container .actions a button {
    padding: 8px 12px;
}

footer#Footer {
    text-align: center;
    margin-top: 18px;
    font-size: 12px;
    color: #666;
}

/* If the login/register container is placed directly under <body> (as in register.php),
   center it vertically and horizontally without changing pages that wrap it in .page-wrap */
body > .login-container {
    margin: auto;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
}