/*
Alex Luo, Evan Chan, Leon Huang, Stanley Hoo
KungFuPandaSquad
SoftDev
P02: Makers Makin' It, Act I
2025-1-9
Time spent: x
*/

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

.blackjack-body {
  background: url("/static/images/blackjack.jpg") no-repeat center center fixed;
  background-size: cover;
  overflow: hidden; 
  padding-top: 0;
}

/* Table background */
.table-background {
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column; /* dealer-area on top, player-area below */
  align-items: center;
  justify-content: space-around;
  height: 100vh;
  margin: 0 auto;
  padding: 1rem;
  box-sizing: border-box;
}

/* Dealer/Player areas */
#dealer-area,
#player-area {
  text-align: center;
  margin: 1rem 0;
}

/* Lays out cards next to neach other */
.dealer-cards,
.player-cards {
    display: flex;
    flex-direction: row;  
    justify-content: center;
    align-items: center; 
    flex-wrap: nowrap;        
    gap: 10px;          
    height: 100%; 
}

.dealer-cards img,
.player-cards img {
    width: 60px;     
    height: auto;
    transition: transform 0.8s ease-in-out;
}

.back {
  background: url("/static/images/cards/back.png") no-repeat center center;
  background-size: cover;
  width: 80px;
  height: 110px; 
}
 /* action buttons (hit, stand, double down, play again) */
.action-buttons {
    display: flex;
    flex-direction: column;  
    justify-content: center;
    align-items: center;
    gap: 10px;              
    position: absolute;
    right: 20px;           
    top: 50%;            
    transform: translateY(-50%);
}

.action-buttons button {
    padding: 10px 20px;
    font-size: 1.2rem;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #28a745;  
    color: white;
    font-weight: bold;
    transition: background-color 0.3s ease-in-out;
}

.action-buttons button:hover {
    background-color: #218838; 
}


/* End screen overlay */
#end-screen {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 2rem;
  text-align: center;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 2s ease-in-out;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
#end-screen button {
  margin-top: 20px;
  padding: 10px 20px;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Shuffle animation */
.shuffling {
  animation: shuffleAnim 1s infinite;
}
@keyframes shuffleAnim {
  0%   { transform: rotate(0deg); }
  25%  { transform: rotate(5deg); }
  50%  { transform: rotate(0deg); }
  75%  { transform: rotate(-5deg); }
  100% { transform: rotate(0deg); }
}

#dealer-area h2,
#player-area h2 {
  margin: 0; 
  padding: 5px;
  color: #FFFFFF;
}

/* Style flash messages */

.flash-messages {
  position: fixed;
  top: 30px; /* Distance from the top of the window */
  left: 50%;
  transform: translateX(-50%); /* Center the messages horizontally */
  z-index: 1000; /* Ensure the messages appear above other content */
  width: 90%; /* Adjust width as needed */
  max-width: 400px; /* Set a max-width for better presentation */
}

.flash-message {
  padding: 10px 20px;
  margin-bottom: 10px;
  border-radius: 5px;
  color: #721c24;
  opacity: 1; 
  transition: opacity 0.5s ease; 
  animation: fadeOut 2s forwards; 
}

.flash-message {
padding: 10px;
margin-bottom: 10px;
}

.flash-message.error {
background-color: #f8d7da;
color: #721c24;
}

.flash-message.success {
background-color: #d4edda;
color: #155724;
}

/* Keyframes for fade-out animation */
@keyframes fadeOut {
  0% {
      opacity: 1; /* Fully visible */
      margin-top: 0; /* Keep the message in place */
  }
  80% {
      opacity: 1; /* Remain visible until near the end */
      margin-top: 0; /* Keep the message in place */
  }
  100% {
      opacity: 0; /* Fully transparent */
      margin-top: -7%; /* Move the message up so it doesn't block UI*/
  }
}

.home-title,
.home-subtitle,
.home-paragraph,
.login-register-container{
  text-align:center;
  font-family: Arial, sans-serif;
}

.home-title{
  margin:20px 0 10px 0;
  font-size:2rem;
}

.home-subtitle{
  margin:10px 0;
  font-size: 1.5rem;
  text-align: center;
}

.home-paragraph{
  margin:10;
}

.player-info {
    position: absolute;
    top: 60px;
    right: 20px;
    font-size: 1.2rem;
    text-align: right; 
    color: #FFFFFF;
}

.welcome-message {
    margin-bottom: 5px; 
}

.signout-btn {
  background-color: #dc3545; 
  color: white;
  padding: 5px 10px;
  text-decoration: none;
  margin-left: 10px;
  border-radius: 4px;
}

.signout-btn:hover {
  background-color: #bd2130;
}

.balance-info {
    display: flex;
    align-items: center;
    gap: 5px; 
}

.bet-info {
    display: flex;
    align-items: center;
    gap: 5px; 
}

.coin-icon {
    width: 24px; 
    height: 24px;
}

.blackjack-icon {
    width: 16px; 
    height: 16px;
}

/* Coin animation container */
#coin-animation-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1000;
}

.coin-animation {
    width: 50px;
    height: 50px;
    position: absolute;
    background: url('/static/images/coin.png') no-repeat center center;
    background-size: contain;
    opacity: 1;
    transition: transform 1.5s ease-in-out, opacity 1.5s ease-in-out;
}

.coin-disappear {
    opacity: 0;
}

#balance {
    font-size: 1.5rem;
    font-weight: bold;
}

#bet {
    font-size: 1.5rem;
    font-weight: bold;
}

.navbar {
  background-color: #333333;
  padding:10px;
}

/* Navbar container */
.navbar {
  position: fixed; 
  top: 0;
  width: 100%; 
  background-color: #333333; 
  z-index: 1000; 
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 0.5rem 2rem; 
  display: flex; 
  align-items: center;
  justify-content: space-between; 
}

/* Welcome container */
.welcome-container {
  position: absolute; 
  right: 80px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 10px; 
  color: #ffffff;
}

/* Welcome message text */
.welcome-message {
  font-size: 1rem;
  color: #ffffff;
}

/* Navbar */
.navbar ul {
  list-style: none; 
  display: flex; 
  gap: 1.5rem; 
  margin: 0; 
  padding: 0; 
}

.navbar li a {
  color: #ffffff; 
  font-weight: bold;
  text-decoration: none; 
  font-size: 1rem; 
  padding: 0.5rem 1rem; 
  transition: background-color 0.3s ease, color 0.3s ease; 
  border-radius: 5px; 
}

/* Hover effect */
.navbar li a:hover {
  background-color: #555555; 
  color: #ffcc00;
  text-decoration: none;
}

body {
  padding-top: 60px; 
}

.navbar li.logout-button{
  margin-left: auto;
}

.navbar li form button{
  background-color: #dc3545; 
  color: white;
  border: none;
  padding: 5px 15px;
  border-radius: 5px;
  cursor: pointer;
}

/* Dropdown container */
.navbar .dropdown {
  position: relative;
  display: inline-block;
}

/* Dropdown button */
.navbar .dropbtn {
  color: #ffffff;
  font-weight: bold;
  text-decoration: none;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  border-radius: 5px;
}

.navbar .dropbtn:hover {
  background-color: #555555;
  color: #ffcc00;
}

/* Dropdown content */
.navbar .dropdown-content {
  display: none; 
  position: absolute;
  top: calc(100%); 
  left: 0;
  background-color: #333333;
  min-width: 180px; 
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  border-radius: 5px;
  overflow: hidden;
  padding: 5px 0; 
}

.navbar .dropdown-content li {
  display: block;
  text-align: left;
  padding: 0; 
}

.navbar .dropdown-content li a {
  color: #ffffff;
  padding: 15px 20px; 
  text-decoration: none;
  display: block;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.navbar .dropdown-content li a:hover {
  background-color: #555555;
  color: #ffcc00;
}

.navbar .dropdown:hover .dropdown-content,
.navbar .dropdown-content:hover {
  display: block;
}

.navbar .spacer {
  flex-grow: 10; 
}


.game-buttons-container {
  display: flex;
  justify-content : center;
  gap: 30px;
  margin-top: 30px;
}

.game-link {
  color: #000000;
}

.game-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px solid #ddd;
  padding: 10px;
  border-radius: 8px;
  transition: transform 0.2s;
}

.game-button:hover {
  transform: scale(1.05);
}

.game-icon {
  width: 80px;
  height: 80px;
  object-fit: cover;
  margin-bottom: 10px;
}

.teamflag {
  max-width: 100%; 
  height: auto;    
  width: 300px;    
  border: 2px solid #ccc; 
  border-radius: 8px;
  display: block;
  margin: 20px auto; 
}

.transaction-table-container {
  text-align: center;
  margin-top: 30px;
  font-family: 'Poppins', sans-serif;
}

.transactions-label {
  margin-top: 20px;
  font-size: 1.4rem;
  color: #6c757d;
  font-weight: 600;
}

.transactions-label a {
  text-decoration: none;
  color: #4a47a3;
  font-weight: bold;
  transition: color 0.3s;
}

.transactions-label a:hover {
  color: #6c63ff;
}

.transaction-table {
  width: 80%;
  margin: 30px auto;
  border-collapse: collapse;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  background: linear-gradient(to bottom, #ffffff, #f9f9f9);
}

.transaction-table th,
.transaction-table td {
  padding: 15px;
  text-align: center;
  font-size: 16px;
}

.transaction-table th {
  background: linear-gradient(to right, #007bff, #6c63ff);
  color: white;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.transaction-table tbody tr {
  transition: background-color 0.3s, transform 0.2s;
}

.transaction-table tbody tr:nth-child(even) {
  background-color: #f2f2f2;
}

.transaction-table tbody tr:nth-child(odd) {
  background-color: #ffffff;
}

.transaction-table tbody tr:hover {
  background-color: #eaf2ff;
  transform: scale(1.02);
}

.transaction-table td {
  border-bottom: 1px solid #ddd;
}

.transaction-table td:last-child {
  font-weight: 600;
  color: #4a47a3;
}

.transaction-table tfoot {
  background: linear-gradient(to right, #6c63ff, #007bff);
  color: white;
  text-align: center;
  font-weight: bold;
}

.leaderboard-table {
  width: 80%;
  margin: 30px auto;
  border-collapse: collapse;
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(to bottom, #ffffff, #f8f9fa);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 15px;
  text-align: center;
  font-size: 16px;
}

.leaderboard-table th {
  background: linear-gradient(to right, #6c63ff, #4a47a3);
  color: white;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.leaderboard-table tbody tr {
  transition: background-color 0.3s, transform 0.2s;
}

.leaderboard-table tbody tr:nth-child(even) {
  background-color: #f2f2f2;
}

.leaderboard-table tbody tr:nth-child(odd) {
  background-color: #ffffff;
}

.leaderboard-table tbody tr:hover {
  background-color: #e9ecef;
  transform: scale(1.02);
}

.leaderboard-table tbody tr.highlighted td {
  background-color: #ffe066;
  font-weight: bold;
  transition: background-color 0.3s, color 0.3s;
}

.leaderboard-table td {
  border-bottom: 1px solid #ddd;
}

.leaderboard-table td:last-child {
  font-weight: 600;
  color: #4a47a3;
}

.leaderboard-table tfoot {
  background: linear-gradient(to right, #4a47a3, #6c63ff);
  color: white;
  text-align: center;
  font-weight: bold;
}

.change-positive {
    color: green;
    font-weight: bold;
}

.change-negative {
    color: red;
    font-weight: bold;
}

.change-neutral {
    color: gray;
    font-weight: bold;
}

/* Modal Styling */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 2000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    background: white;
    border: 1px solid #888;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    text-align: center;
}

.modal-content h2 {
    margin-bottom: 20px;
}

.modal-content input {
    width: 80%;
    padding: 10px;
    margin-bottom: 15px;
}

.modal-content button {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.modal-content button:hover {
    background: #218838;
}

.form-container {
  max-width: 400px;
  margin: 80px auto; 
  padding: 20px 30px;
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.form-container h1,
.form-container h2 {
    color: #333333;
    margin-bottom: 20px;
}

.form-container label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #555555;
}

.form-container input[type="text"],
.form-container input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-container button {
  width: 100%;
  padding: 10px 0;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
}

.form-container hr {
  border: 0;
  height: 1px;
  background: #ddd;
  margin: 30px 0;
}