/* ===========================
   Global Reset & Base Styles
=========================== */
:root {
    --primary-color: #2196F3;
    --primary-hover: #1976D2;
    --success-color: #28a745;
    --success-hover: #218838;
    --text-color: #333;
    --background-color: #f2f2f2;
}

body {
    font-family: Arial, sans-serif;
    background: var(--background-color);
    margin: 0;
    padding: 0;
    text-align: center;
}

h1 {
    margin-top: 20px;
    color: var(--text-color);
}

/* ===========================
   Navbar
=========================== */
.navbar {
    background: var(--primary-color);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
}

.nav-logo {
    font-weight: bold;
    font-size: 24px;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    margin-left: 20px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #bbdefb;
}

/* ===========================
   Category Bar
=========================== */
.category-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    background: #fff;
    padding: 12px 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.category-btn {
    text-decoration: none;
    color: var(--text-color);
    background: #e0e0e0;
    padding: 8px 16px;
    margin: 6px;
    border-radius: 20px;
    font-size: 14px;
    transition: background 0.3s ease, color 0.3s ease;
}

.category-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

/* ===========================
   Search Bar
=========================== */
.search-bar {
    margin: 15px 0;
}

.search-bar form {
    display: inline-flex;
    gap: 10px;
}

.search-bar input[type="text"] {
    padding: 8px 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    width: 300px;
    transition: border-color 0.3s ease;
}

.search-bar input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-bar button {
    padding: 9px 18px;
    font-size: 16px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-bar button:hover {
    background: var(--primary-hover);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
}

.pagination-bg {
    padding: 15px 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    display: flex;
    gap: 12px;
}

.page-btn {
    padding: 8px 16px;
    font-size: 14px;
    color: #fff;
    border: none;
    border-radius: 5px;
    background-color: blue;
    cursor: pointer;
    transition: all 0.25s ease;
}

.page-btn:hover {
    background-color: black;
}

.page-btn.active {
    background-color: black;
    pointer-events: none;
}

.page-btn.prev,
.page-btn.next {
    background-color: #1976d2;
    font-weight: bold;
}

.page-btn.prev:hover,
.page-btn.next:hover {
    background-color: #0d47a1;
}

.page-btn.disabled {
    background-color: #ccc;
    color: #666;
    cursor: not-allowed;
}

.game-list {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin: 30px 10px 50px;
}

.game-item {
    background: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 10px;
    width: 170px;
     text-overflow: ellipsis;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
   
}

.game-item img {
    width: 100%;
    border-radius: 8px;
}

.game-item h3 {
    font-size: 16px;
    margin: 10px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    width: 100%;
}


.game-item p {
    font-size: 5px;
    color: #555;
}

.game-item a {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
    margin-top: 10px;
}

.game-item a:hover {
    background: var(--primary-hover);
}

/* ===========================
   Add Game Button
=========================== */
.btn-add-game {
    display: inline-block;
    margin: 15px 20px 30px;
    padding: 12px 20px;
    background-color: var(--success-color);
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 16px;
    transition: background-color 0.3s ease;
    float: right;
}

.btn-add-game:hover {
    background-color: var(--success-hover);
}

/* Ensure placeholder text wraps inside inputs & textareas */
table input::placeholder,
table textarea::placeholder {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Limit placeholder font size in table inputs */
table input[type="text"]::placeholder,
table textarea::placeholder {
    font-size: 13px;
    color: #999;
}
/* ===========================
   Add New Game Form
=========================== */
form.add-game-form {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    margin: 30px auto;
    max-width: 600px;
    text-align: left;
}

form.add-game-form label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
    color: #333;
}

form.add-game-form input[type="text"],
form.add-game-form input[type="number"],
form.add-game-form select,
form.add-game-form textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-bottom: 20px;
    transition: border-color 0.3s ease;
}

form.add-game-form input[type="text"]:focus,
form.add-game-form input[type="number"]:focus,
form.add-game-form select:focus,
form.add-game-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

form.add-game-form textarea {
    min-height: 100px;
    resize: vertical;
}

#imagePreview {
    width: 150px;
    height: 150px;
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #aaa;
    font-size: 48px;
    margin-bottom: 10px;
    object-fit: contain;
    background-color: #f9f9f9;
    border-radius: 8px;
}

#imagePreview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

input[type="file"] {
    display: none;
}

form.add-game-form button[type="submit"] {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    background-color: var(--success-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 10px;
    float: right;
}

form.add-game-form button[type="submit"]:hover {
    background-color: var(--success-hover);
}

/* Message / alert style */
.message {
    max-width: 600px;
    margin: 20px auto;
    padding: 12px 20px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    border-radius: 6px;
}
/* ===========================
   Categories Page
=========================== */
.categories-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin: 30px 20px 50px;
}

.category-card {
    background: #fff;
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 10px;
    width: 120px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.12);
}

.category-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text-color);
}

.category-card p {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.category-card a {
    display: inline-block;
    padding: 10px 18px;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: background 0.3s ease;
}

.category-card a:hover {
    background: var(--primary-hover);
}

/* ===========================
   Games in Category Page Grid
=========================== */

.category-games-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    margin: 30px 20px 50px;
}

.category-game-card {
    background: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 10px;
    width: 220px;
    /* align-items: center; */
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
     
}

.category-game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.12);
}

.category-game-card img {
    width: 100%;
    height: 140px;
    object-fit: contain;
    border-radius: 8px;
    background: #f9f9f9;
    margin-bottom: 12px;
    /* justify-content: center; */
 
}
.category-game-card-img1 {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

.category-game-card h3 {
    font-size: 16px;
    color: var(--text-color);
    margin: 10px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-game-card a.play-btn {
    display: inline-block;
    padding: 8px 16px;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    margin-top: 10px;
    transition: background 0.3s ease;
}

.category-game-card a.play-btn:hover {
    background: var(--primary-hover);
}

/* Modal Background */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
}

/* Modal Content Box */
.modal-content {
  background: #fff;
  padding: 30px 20px;
  border-radius: 10px;
  width: 320px;
  max-width: 90%;
  text-align: center;
  position: relative;
}

/* Close button */
.close-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 20px;
  cursor: pointer;
}

/* Form Inputs */
#authForm input {
  width: 90%;
  padding: 10px 8px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
}

/* Form Button */
#authForm button {
  padding: 10px 20px;
  background: #0d6efd;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 10px;
}

#authForm button:hover {
  background: #084298;
}

