/* client/css/styles.css */

/* --------------------------------------------------
   1. General Styles
-------------------------------------------------- */

/* Reset and Box-Sizing */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box; /* Ensure all elements use border-box */
}

/* Theme Variables */
:root {
  /* Professional Blue Theme Colors */
  --primary-color: #004080; /* Deep Professional Blue */
  --secondary-color: #66B2FF; /* Light Sky Blue */
  --background-gradient: linear-gradient(135deg, #c4e2ff 0%, #004080 100%); /* Light Sky Blue to Deep Blue */
  --text-color: #000000; /*  Deep Professional Blue */
  --header-background: #FFFFFF; /* White */
  --header-text-color: #004080; /* Deep Professional Blue */
  
  /* Button Styles */
  --button-background: #004080; /* Deep Professional Blue */
  --button-text-color: #FFFFFF; /* White */
  --button-hover-background: #00264D; /* Darker Blue */
  --button-hover-text-color: #FFFFFF; /* White */
  
  /* Card Styles */
  --card-background: #004080; /* White */
  --card-text-color: #ffffff; /* Dark Gray */
  --card-selected-background: #1f7bde; /* Light Blue for Selected State */
  
  /* Chat Panel Styles */
  --chat-panel-background: #F2F2F2; /* Light Gray */
  --chat-text-color: #333333; /* Dark Gray */
  
  /* Content Background */
  --content-background: linear-gradient(135deg, #66B2FF 0%, #004080 100%);
  
  /* Modal Styles */
  --modal-overlay: rgba(0, 0, 0, 0.5); /* Semi-transparent Black */
  
  /* Miscellaneous Styles */
  --shadow: rgba(0, 0, 0, 0.15); /* Slightly Darker Shadow for Depth */
  --border-radius: 8px; /* Slightly Rounded Corners */
  --transition-speed: 0.3s; /* Smooth Transitions */
  --font-family-primary: 'Roboto', sans-serif;
  --font-family-secondary: 'Pacifico', cursive;
  
  /* Variables for User Card and User Name Synchronization */
  --user-name-background: #FFFFFF; /* White */
  --user-name-border-width: 0.2em; /* Border Width for Voted State */
  
  /* Event Log Color */
  --event-log-color: #888888; /* Medium Gray for Event Messages */
  
  /* Help Title Color */
  --help-title-color: #004080; /* Deep Professional Blue */
  
  /* Chat Bubble Styles */
  --chat-bubble-background: rgba(255, 255, 255, 0.95); /* Nearly Opaque White */
  --chat-bubble-border: 1px solid #CCCCCC; /* Light Gray Border */
}

/* Body Styles */
body {
  font-family: var(--font-family-primary);
  background: var(--background-gradient);
  color: var(--text-color);
  overflow-x: hidden; /* Prevent horizontal scroll on mobile */
  transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
}

/* Headings */
h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  line-height: 1.2;
}

/* Links */
a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-speed) ease;
}

a:hover {
  color: var(--primary-color);
}

/* Hidden Class */
.hidden {
  display: none !important;
}

/* Disabled Button Styles */
button.disabled {
  pointer-events: none;
  opacity: 0.6;
  cursor: not-allowed;
}

button.disabled i,
.pointer-icon.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(100%);
  transition: opacity var(--transition-speed), filter var(--transition-speed);
}

/* --------------------------------------------------
   2. Landing Page Styles
-------------------------------------------------- */

#landing-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background-gradient);
  z-index: 1000;
  padding: 2%;
  animation: fadeInBackground 1s ease forwards;
}

/* --------------------------------------------------
   Advertisement User Card
-------------------------------------------------- */

/* Advertisement User Card */
.user-card.ad-card {
  width: 120px; /* Slightly wider than regular user-card (100px) */
  height: 190px; /* Total height: regular user card (150px) + name section (40px) */
  background-color: #ffffff;
  border: 1px #000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* Align content to the top */
  padding: 10px;
  margin: 5px;
  box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.1);
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease, border var(--transition-speed) ease;
}

/* Hover Effect Matching Regular User Cards */
.user-card.ad-card:hover {
  transform: scale(1.05);
  box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.15); /* Match regular user-card hover box-shadow */
}

/* Advertisement Content */
.user-card.ad-card .ad-content {
  width: 100%;
  display: flex;
  align-items: flex-start; /* Align ad content to the top */
  justify-content: center;
  flex-grow: 1; /* Allow ad content to take available vertical space */
}

.user-card.ad-card .ad-content img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 5px; /* Slightly rounded corners for the ad image */
}

/* Advertisement Label (Using .user-name) */
.user-card.ad-card .user-name {
  width: 100%;
  text-align: center;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 2px 0;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  font-size: 10px;
  font-weight: bold;
  color: #333;
  margin-top: auto; /* Pushes the label to the bottom */
}

/* --------------------------------------------------
   Responsive Adjustments for Advertisement User Card
-------------------------------------------------- */

/* Larger Screens (Desktops) */
@media (min-width: 1025px) {
  .user-card.ad-card {
    width: 140px; /* Increase width on larger screens */
    height: 192px; /* Adjust height accordingly */
  }

  .user-card.ad-card .user-name {
    font-size: 12px;
  }
}

/* Medium Screens (Tablets) */
@media (min-width: 769px) and (max-width: 1024px) {
  .user-card.ad-card {
    width: 130px;
    height: 180px;
  }

  .user-card.ad-card .user-name {
    font-size: 12px;
  }
}

/* Small Screens (Large Mobile Devices) */
@media (min-width: 481px) and (max-width: 768px) {
  .user-card.ad-card {
    width: 100px;
    height: 160px;
  }

  .user-card.ad-card .user-name {
    font-size: 11px;
  }
}

/* Very Small Screens (Small Mobile Devices) */
@media (max-width: 480px) {
  .user-card.ad-card {
    width: 80px;
    height: 140px;
    margin: 3px; /* Reduce margin for smaller screens */
  }

  .user-card.ad-card .user-name {
    font-size: 10px;
    padding: 1px 0;
  }
}


@keyframes fadeInBackground {
  from { opacity: 0; }
  to { opacity: 1; }
}

#landing-content {
  background: #ffffff;
  padding: 5%;
  border-radius: var(--border-radius);
  text-align: center;
  max-width: 40em;
  width: 100%;
  margin: 0 auto;
  box-shadow: 0 0.5em 1.5em var(--shadow);
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

#landing-page h1 {
  font-size: 2.5em;
  color: var(--primary-color);
  margin-bottom: 1.5em;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
  font-family: var(--font-family-secondary);
}

/* AdSense Container */
.adsense-container {
  margin: 2em 0;
  text-align: center;
  border: 2px solid rgba(130, 179, 206, 0.7);
  padding: 2em 0;
  border-radius: var(--border-radius);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0.25em 0.75em var(--shadow);
}

/* Form Groups */
.form-group {
  width: 100%;
  margin-bottom: 1em;
}

input[type="text"],
textarea {
  width: 100%;
  padding: 0.75em 1em;
  font-size: 1rem;
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  margin-bottom: 0.625em;
  background: #ffffff;
  color: #000000;
  transition: border var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

input[type="text"]:focus,
textarea:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 0.125em var(--secondary-color);
  outline: none;
}

input[type="text"]::placeholder,
textarea::placeholder {
  color: #aaaaaa;
}

#session-description-group {
  display: none;
}

/* Button Groups */
.button-group {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.9375em;
}

button {
  padding: 0.75em 1.25em;
  font-size: 1rem;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  background: var(--button-background);
  color: var(--button-text-color);
  transition: background var(--transition-speed) ease, transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.1);
}

button:hover {
  background: var(--button-hover-background);
  color: var(--button-hover-text-color);
  transform: translateY(-0.125em);
  box-shadow: 0 0.5em 1em rgba(0, 0, 0, 0.15);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.1);
}

button i {
  margin-right: 0.5em;
}

/* Footer Message */
#footer-message {
  text-align: center;
  margin-top: 1.25em;
  font-size: 0.75rem;
  color: var(--text-color);
  opacity: 0.7;
}

/* --------------------------------------------------
   3. Room Interface Styles
-------------------------------------------------- */

/* Room Interface Container */
#room-interface {
  margin-left: 0;
  overflow: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.container {
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.hidden {
  opacity: 0;
  visibility: hidden;
}

/* Header */
#main-header {
  padding: 0.625em 1.25em;
  width: calc(100% - 18.75em);
  margin-right: 18.75em;
  background: var(--header-background);
  color: var(--header-text-color);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  z-index: 1001;
  position: sticky;
  top: 0;
  box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
  transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
}

.header-left {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  flex: 1;
}

.header-left h1 {
  font-family: var(--font-family-secondary);
  font-size: 2em;
  display: flex;
  align-items: center;
  margin-right: 1.25em;
  color: var(--header-text-color);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.room-info {
  display: flex;
  flex-direction: row;
  gap: 1.25em;
  align-items: flex-start;
  flex: 1;
  flex-wrap: wrap;
}

.room-code-block,
.session-description-block {
  padding: 0.625em 0.9375em;
  border-radius: 8px;
  text-align: left;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(5px);
  transition: background var(--transition-speed) ease;
}

.room-code-block:hover,
.session-description-block:hover {
  background: rgba(255, 255, 255, 0.2);
}

.room-code-block {
  cursor: pointer;
  transition: background var(--transition-speed) ease;
}

.room-code-block:hover {
  background: rgba(0, 0, 0, 0.05);
}

.session-description-block {
  flex: 1;
  min-width: 9.375em;
}

.room-info h2 {
  font-size: 1em;
  margin-bottom: 0.3125em;
  display: flex;
  align-items: center;
  gap: 0.3125em;
  color: var(--header-text-color);
}

.room-info p {
  font-size: 0.9em;
  margin: 0;
  cursor: default;
  color: var(--text-color);
}

/* Update for room-code-display to indicate it's clickable */
#room-code-display {
  cursor: pointer;
  transition: color var(--transition-speed) ease;
}

#room-code-display:hover {
  color: var(--primary-color);
}

/* Session Description Editing Styles */
#session-description-display[contenteditable="true"] {
  font-family: var(--font-family-primary);
  font-size: 0.9em;
  border: 1px var(--primary-color);
  padding: 5px;
  background-color: #fff;
}

#session-description-display[contenteditable="true"]:focus {
  font-family: var(--font-family-primary);
  font-size: 0.9em;
  outline: none;
}

/* Header Right Buttons */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.625em;
  margin-left: auto;
  margin-top: 0.625em;
  flex-wrap: wrap;
}

.btn-small {
  padding: 0.3125em 0.625em;
  font-size: 0.75rem;
  border-radius: 20px;
  background: var(--button-background);
  color: var(--button-text-color);
  transition: background var(--transition-speed) ease, transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  box-shadow: 0 0.125em 0.25em rgba(0, 0, 0, 0.1);
}

.btn-small:hover {
  background: var(--button-hover-background);
  color: var(--button-hover-text-color);
  transform: scale(1.05);
  box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.15);
}

/* Session Clock Styles */
#session-clock {
  display: flex;
  align-items: center;
  gap: 0.3125em;
  font-size: 0.875rem;
  color: var(--text-color);
  margin-left: 1em;
}

#session-clock i {
  animation: tick 1s infinite;
}

@keyframes tick {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

/* --------------------------------------------------
   4. Main Content Styles
-------------------------------------------------- */

/* Main Content */
.main-content {
  display: flex;
  flex-direction: row;
  min-height: calc(100vh - 10em);
  overflow: hidden;
  background: var(--content-background);
  transition: background var(--transition-speed) ease;
}

/* User Cards Section */
#user-cards-section {
  display: flex;
  flex-wrap: wrap;
  padding: 1.25em;
  background: var(--content-background);
  flex: 1;
  overflow-y: auto;
  max-width: calc(100% - 18.75em);
  align-content: flex-start;
  justify-content: flex-start;
  gap: 0.625em;
  transition: background var(--transition-speed) ease;
}

/* Chat Panel */
#chat-panel {
  background: var(--chat-panel-background);
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 18.75em;
  display: flex;
  flex-direction: column;
  z-index: 999;
  border-left: 0.0625em solid #dddddd;
  overflow: hidden;
  box-shadow: -0.25em 0 0.5em rgba(0, 0, 0, 0.1);
  transition: background var(--transition-speed) ease, border-left 0.3s ease;
}

body.professional-theme #chat-panel {
  border-left: 0.0625em solid #444444;
}

#chat-header {
  background: var(--header-background);
  color: var(--header-text-color);
  padding: 0.9375em;
  border-bottom: 0.0625em solid #dddddd;
  display: flex;
  flex-direction: column;
  transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
}

#chat-header h4 {
  margin-bottom: 0.625em;
  font-size: 1em; /* Reduced font size */
  text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

#users-list {
  list-style: none;
  padding: 0.5em; /* Added padding */
  margin: 0 0 0.9375em 0;
  overflow-y: auto;
  width: 100%; /* Updated to match chat header width */
  max-height: 9.375em;
}

/* Separator */
hr {
  border: 0;
  height: 0.0625em;
  width: 100%;
  background: #dddddd;
  margin: 0;
}

/* Chat Window */
#chat-window {
  flex: 1;
  padding: 0.9375em;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--chat-panel-background);
  transition: background var(--transition-speed) ease;
}

/* Chat Message Styles */
.chat-message {
  background-color: var(--chat-bubble-background); /* Updated for better visibility */
  border: var(--chat-bubble-border); /* Added border */
  border-radius: 15px;
  padding: 10px;
  margin-bottom: 10px;
  font-size: 0.9em; /* Reduced font size */
  position: relative;
  max-width: 100%;
  color: var(--chat-text-color);
}

.chat-message .message-header {
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 0.9em; /* Reduced font size */
}

.chat-message .message-sender {
  color: var(--primary-color);
}

.chat-message .message-timestamp {
  font-size: 0.75em; /* Reduced font size */
  color: #999;
  margin-left: 10px;
}

.chat-message .message-content {
  word-wrap: break-word;
  font-size: 1em; /* Reduced font size */
}

.chat-message:hover {
  background-color: rgba(255, 255, 255, 0.2); /* Increased contrast on hover */
}

/* Event Log Styles */
.event-log {
  font-size: 0.85em; /* Smaller font size */
  color: var(--event-log-color); /* Lighter color */
  margin-bottom: 5px; /* Reduced spacing between logs */
  text-align: center;
  font-style: italic;
}

/* Reaction Styles */

/* Ensure chat-message has relative positioning */
.chat-message {
  position: relative;
}

/* Hide the reaction menu by default */
.chat-message .reaction-menu {
  display: none;
}

/* Show the reaction menu when hovering over the chat message */
.chat-message:hover .reaction-menu {
  display: flex;
}

/* Reaction Menu positioned below the message */
.chat-message .reaction-menu {
  position: absolute;
  padding: 5px;
  background-color: rgba(255, 255, 255, 0.9); /* Slightly transparent background */
  border: 1px solid #dddddd;
  border-radius: 5px;
  z-index: 10;
  box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.1);
  flex-wrap: wrap;
}

/* Emoji Buttons */
.reaction-menu .emoji-button {
  border: none;
  cursor: pointer;
  margin: 5px;
  transition: transform 0.1s ease;
  padding: 0em 0em;
  font-size: 1rem;
  border-radius: 30px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.2); 
  color: var(--button-text-color);
  transition: background var(--transition-speed) ease, transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.1);
}


/* Hover Effect on Emojis */
.reaction-menu .emoji-button:hover {
  transform: scale(1.2);
}

/* Ensure the reaction menu does not overflow the chat window */
#chat-window {
  position: relative;
}

/* Replies Container */
.replies-container {
  margin-top: 10px;
  border-left: 2px solid #dddddd;
  padding-left: 10px;
}

.reply-message {
  background-color: #f9f9f9;
  border-radius: 10px;
  padding: 5px;
  margin-bottom: 5px;
  font-size: 0.8em; /* Reduced font size */
}

.reply-message .message-header {
  font-weight: bold;
  margin-bottom: 3px;
  font-size: 0.85em; /* Reduced font size */
}

.reply-message .message-sender {
  color: var(--secondary-color);
}

.reply-message .message-timestamp {
  font-size: 0.75em; /* Reduced font size */
  color: #999;
  margin-left: 5px;
}

.reply-message .message-content {
  word-wrap: break-word;
  font-size: 0.8em; /* Reduced font size */
}

/* Reply Input */
.reply-input {
  display: flex;
  margin-top: 5px;
}

.reply-input textarea {
  flex: 1;
  resize: vertical;
  min-height: 40px;
  max-height: 200px;
  border: 1px solid #cccccc;
  border-radius: 5px;
  padding: 5px;
  font-size: 0.85em; /* Reduced font size */
  overflow: hidden;
}

.reply-input button {
  margin-left: 5px;
  background: var(--button-background);
  color: var(--button-text-color);
  border: none;
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 0.85em; /* Reduced font size */
  cursor: pointer;
}

.reply-input button:hover {
  background: var(--button-hover-background);
}

/* Typing Indicator */
#typing-indicator {
  font-size: 0.75em;
  color: #666;
  padding: 5px 0.9375em; /* Match chat window padding */
  background-color: var(--chat-panel-background);
  font-style: italic;
  min-height: 20px; /* Ensure consistent height */
}

.hidden {
  display: none;
}

/* Chat Input Area */
#chat-input-area {
  display: flex;
  padding: 0.625em;
  border-top: 0.0625em solid #dddddd;
  margin-top: auto;
  background: rgba(255, 255, 255, 0.1);
  transition: background var(--transition-speed) ease;
}

#chat-input {
  flex: 1;
  padding: 0.625em;
  border: 0.125em solid var(--primary-color);
  border-radius: 20px;
  background: #ffffff;
  color: #000000;
  transition: border var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

#chat-input:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 0.125em var(--secondary-color);
  outline: none;
}

#chat-input::placeholder {
  color: #aaaaaa;
}

#send-message {
  margin-left: 0.625em;
  background: var(--button-background);
  color: var(--button-text-color);
  border: none;
  border-radius: 50%;
  width: 2.8125em;
  height: 2.8125em;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  box-shadow: 0 0.125em 0.25em rgba(0, 0, 0, 0.1);
}

#send-message:hover {
  transform: rotate(45deg);
  box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.15);
}

#send-message i {
  margin: 0;
  color: #ffffff; /* Ensure the paper-plane icon is always white */
}

/* --------------------------------------------------
   5. Voting Footer Styles
-------------------------------------------------- */

#voting-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: calc(100% - 18.75em);
  margin-right: 18.75em;
  background: var(--header-background);
  padding: 0.995em 0;
  border-top: 0.0625em solid #dddddd;
  z-index: 1200;
  box-shadow: 0 -0.25em 0.5em rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
  transition: background var(--transition-speed) ease, border-top 0.3s ease;
}


#facilitator-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.625em;
  gap: 0.625em;
}

#facilitator-controls .btn {
  margin: 0.3125em 0.625em;
  background: var(--button-background);
  color: var(--button-text-color);
  border-radius: 30px;
  transition: background var(--transition-speed) ease, transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  padding: 0.5em 1em;
  box-shadow: 0 0.125em 0.25em rgba(0, 0, 0, 0.1);
}

#facilitator-controls .btn:hover {
  background: var(--button-hover-background);
  color: var(--button-hover-text-color);
  transform: scale(1.05);
  box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.15);
}

#facilitator-controls .btn i {
  margin-right: 0.3125em;
}

/* Countdown Button Styles */
#start-pointing {
  background: #ff9800; /* Orange color to distinguish */
}

#start-pointing:hover {
  background: #e68900;
}

/* Session Clock Styles */
#session-clock {
  display: flex;
  align-items: center;
  gap: 0.3125em;
  font-size: 0.975rem;
  color: var(--text-color);
  margin-left: 1em;
}

#session-clock i {
  animation: tick 1s infinite;
}

@keyframes tick {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

/* --------------------------------------------------
   6. User Cards Styles
-------------------------------------------------- */

/* User Cards */
.user-card {
  flex: 0 0 auto;
  width: 100px;
  height: 150px;
  margin: 5px;
  position: relative;
  text-align: center;
  perspective: 1000px;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease, border var(--transition-speed) ease;
  border: 0.0625em solid transparent; /* Initial border to maintain sizing */
  border-radius: var(--border-radius);
}

.user-card:hover {
  transform: scale(1.05);
  box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.15);
}

@media (min-width: 769px) {
  /* Larger screens */
  .user-card {
    width: 120px;
    height: 180px;
  }
}

@media (max-width: 768px) {
  /* Medium to small screens */
  .user-card {
    width: 80px;
    height: 120px;
    margin: 5px;
  }
}

@media (max-width: 480px) {
  /* Very small screens */
  .user-card {
    width: 60px;
    height: 90px;
    margin: 3px;
  }
}

.user-card .card-cover {
  width: 100%;
  height: 100%;
  transition: transform 0.6s ease;
  transform-style: preserve-3d;
  position: relative;
}

.user-card .card-cover.revealed {
  transform: rotateY(180deg);
}

.user-card.standing-up .card-cover {
  opacity: 0.5;
  filter: grayscale(100%);
}

.user-card .card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
}

.user-card .card-front {
  background: var(--card-background);
  color: var(--card-text-color);
}

.user-card .card-back {
  background: #ffffff;
  color: var(--card-background);
  transform: rotateY(180deg);
}

/* Updated .user-name Styles */
.user-card .user-name {
  position: absolute;
  width: 100%;
  text-align: center;
  font-weight: bold;
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75em;
  padding: 0.5em 0;
  bottom: -1em;
  background: var(--user-name-background); /* Solid background */
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  box-shadow: 0 0.125em 0.25em rgba(0, 0, 0, 0.1);
  transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
  left: 0; /* Ensure the user-name spans the entire width */
  
  /* Add borders to top, left, and right to match user-card borders */
  border-top: var(--user-name-border-width) solid var(--user-name-background);
  border-left: var(--user-name-border-width) solid var(--user-name-background);
  border-right: var(--user-name-border-width) solid var(--user-name-background);
}

/* Voted State for User Cards */
.user-card.voted {
  color: #ffffff;
}

.user-card.voted::after {
  content: '\f058'; /* Font Awesome check-circle icon */
  font-family: 'Font Awesome 5 Free';
  font-weight: 1000;
  font-size: 2.2em;
  color: var(--button-text-color);
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: var(--primary-color);
  border-radius: 50%;
  padding: 2px;
}

.user-card.voted {
  position: relative;
}

.user-card.voted .user-name {
  border-left: var(--user-name-border-width) solid var(--user-name-background);
  border-right: var(--user-name-border-width) solid var(--user-name-background);
}

/* Flip Animation */
.flip-animation {
  animation: flip 0.6s forwards;
}

@keyframes flip {
  0% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(180deg);
  }
}

/* Voted Class for User Cards */
.user-card.voted {
  transition: border var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

/* Voting Cards */
.cards {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.3125em;
  align-items: flex-start; /* Prevent vertical alignment shifts */
  height: 6em; /* Adjust based on card height and transformation */
}


/* Parent card styles */
.card {
  width: 2.8125em;
  height: 4.21875em;
  margin: 0.3125em;
  background: var(--card-background);
  color: var(--card-text-color);
  border-radius: var(--border-radius);
  font-size: 1.125rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  position: relative; /* Ensures the overlay is positioned relative to the card */
  transition: transform 0.3s ease, background var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  transform-origin: center center;
  box-shadow: 0 0.125em 0.25em rgba(0, 0, 0, 0.1);
}

/* Trophy animation */
.crown-icon {
  font-size: 3em; /* Adjust size as needed */
  color: rgb(255, 215, 0); /* Gold color for the crown */
  position: absolute; /* Make it overlay the card */
  top: calc(5% - 5%); /* Adjust positioning above the text */
  right: calc(5% - 27%); /* Fine-tune the horizontal position */
  transform: translateX(50%); /* Offset to ensure it appears centered */
  z-index: 10; /* Ensure it overlays other content */
  animation: crownBounce 5s ease-in-out, sparkle 5s infinite ease-in-out; /* Bounce and sparkle effects */
  opacity: 1; /* Ensure full visibility */
}

.crown-icon::after {
  content: "🏅"; /* Trophy icon */
  display: inline-block; /* Ensure it behaves like a block element */
  animation: sparkle 5s infinite ease-in-out; /* Sparkle effect */
  opacity: 1; /* Ensure full visibility */
}

/* Star overlay (hidden initially, pops into existence) */
.card.winner::after {
  content: '⭐'; /* Star icon */
  position: absolute;
  top: 0.2em; /* Adjust to move closer to the top */
  right: 0.1em; /* Adjust to move closer to the right */
  font-size: 0.9em; /* Size of the star */
  z-index: 3; /* Ensures it's above the card content */
  opacity: 0; /* Hidden by default */
  animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards; /* Pop-in animation */
  animation-delay: 5s; /* Delay until trophy animation is complete */
}

/* Sparkle animation */
@keyframes sparkle {
  0%, 100% { 
    opacity: 1; /* Fully visible */
    transform: scale(1); /* Normal size */
  }
  50% { 
    opacity: 0.8; /* Slight dimming for effect */
    transform: scale(1.5); /* Slightly larger scale */
  }
}

/* Bounce animation */
@keyframes crownBounce {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-30px) rotate(0deg);
  }
}

/* Pop-in animation for the star */
@keyframes popIn {
  0% {
    opacity: 0; /* Start invisible */
    transform: scale(0); /* Start at 0 size */
  }
  80% {
    opacity: 1; /* Fully visible */
    transform: scale(1.2); /* Slightly overshoot size */
  }
  100% {
    opacity: 1; /* Fully visible */
    transform: scale(1); /* Settle at normal size */
  }
}



.card i {
  font-size: 1.125rem;
}

.card:hover {
  transform: scale(1.1);
  background: var(--card-selected-background);
  box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.15);
}

.card.selected {
  background: var(--card-selected-background);
  transform: translateY(-0.625em);
}

.card.voted {
  position: relative;
}

/* Disable Voting Cards */
.card.disabled {
  opacity: 5;
  cursor: not-allowed;
}

.card.disabled:hover {
  transform: none;
}

/* Style for the Disabled Overlay on Cards */
.disabled-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(127, 139, 174, 0.7);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.disabled-overlay i {
  font-size: 1.5em;
  color: #b91515;
}

.card.animate-up {
  animation: moveUp 0.3s forwards;
}

.card.animate-down {
  animation: moveDown 0.3s forwards;
}

@keyframes moveUp {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-0.625em); /* Moves the element up */
  }
}

@keyframes moveDown {
  from {
    transform: translateY(-0.625em); /* Starts from the 'up' position */
  }
  to {
    transform: translateY(0); /* Moves the element back to its original position */
  }
}


.vote-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  color: green;
  font-size: 1.2em;
  display: none; /* Hidden by default */
}

.user-card.voted .vote-indicator {
  display: block; /* Show when 'voted' class is present */
}

.user-card .vote-indicator i {
  pointer-events: none; /* Ensure the icon doesn't interfere with clicks */
}

/* --------------------------------------------------
   7. Pointing Messages Styles
-------------------------------------------------- */

#pointing-messages-container {
  margin-top: 0.625em;
  width: 100%;
}

.pointing-message {
  position: relative;
  margin-top: 0.625em;
  padding: 0.625em 2.5em 0.625em 0.9375em;
  background: #e8f5e9;
  border-left: 0.3125em solid #566257;
  border-radius: 8px;
  font-style: italic;
  color: #163a17;
  animation: fadeIn 0.5s ease-in-out;
  width: 100%;
  box-sizing: border-box;
  font-size: 0.9em;
  box-shadow: 0 0.125em 0.25em rgba(0, 0, 0, 0.05);
  transition: background var(--transition-speed) ease, border-left var(--transition-speed) ease, color var(--transition-speed) ease;
}

.pointing-message .close-btn {
  padding: 0em 0em;
  position: absolute;
  top: 50%;
  right: 0.625em;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 1em;
  cursor: pointer;
  color: inherit;
  transition: color var(--transition-speed) ease;
}

.pointing-message .close-btn:hover {
  color: var(--primary-color);
}

body.professional-theme .pointing-message {
  background: #455a64;
  border-left: 0.3125em solid #90a4ae;
  color: #ffffff;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-0.625em);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------
   8. Notification Styles
-------------------------------------------------- */

#notification {
  position: fixed;
  top: 50%; /* Center vertically */
  left: 47%; /* Center horizontally */
  transform: translate(-50%, -50%); /* Adjust position to exact center */
  background: var(--primary-color);
  color: #ffffff;
  padding: 0.3125em 0.625em;
  border-radius: 15px;
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.3s ease;
  z-index: 1002;
  box-shadow: 0 0.125em 0.25em rgba(0, 0, 0, 0.1);
}

#notification.show {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(-0.3125em);
}

/* --------------------------------------------------
   9. Help Modal Styles
-------------------------------------------------- */

.modal {
  position: fixed;
  top: 50%; /* Center vertically */
  left: 50%; /* Center horizontally */
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 800px;
  background: var(--header-background);
  border: 0.0625em solid var(--primary-color);
  border-radius: 12px;
  box-shadow: 0 0.25em 1em rgba(0, 0, 0, 0.2);
  z-index: 1003;
  display: none;
  animation: slideIn 0.3s forwards;
}

body.midnight-black-theme .modal,
body.minimalist-gray-theme .modal,
body.professional-theme .modal {
  background: var(--header-background);
  color: var(--header-text-color);
  border: 0.0625em solid var(--primary-color);
}

.modal-content {
  padding: 1.25em;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 0.625em;
  right: 0.9375em;
  font-size: 1.25em;
  cursor: pointer;
  transition: color var(--transition-speed) ease;
}

.close-btn:hover {
  color: var(--primary-color);
}

.modal-content h2 {
  margin-bottom: 0.9375em;
  text-align: center;
  color: var(--help-title-color); /* Use a specific color for the help title */
  text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.modal-content ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
}

.modal-content ul li {
  flex: 1 1 calc(33% - 2em); /* Three columns */
  box-sizing: border-box;
  margin-bottom: 0.625em;
  line-height: 1.5;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* Responsive Adjustments for Modal */
@media (max-width: 768px) {
  .modal {
    width: 90%;
    right: 5%;
  }
  .modal-content ul li {
    flex: 1 1 calc(50% - 2em); /* Two columns on smaller screens */
  }
}

@media (max-width: 480px) {
  .modal-content ul li {
    flex: 1 1 100%; /* One column on very small screens */
  }
}

/* --------------------------------------------------
   10. Responsive Design Adjustments
-------------------------------------------------- */

/* General Responsive Styles */
@media (min-width: 47.8125em) { /* 769px */
  /* Adjust header and footer to account for chat panel */
  #main-header,
  #voting-footer {
    width: calc(100% - 18.75em);
    margin-right: 18.75em;
  }

  /* Ensure user-cards-section max-width adjusts properly */
  #user-cards-section {
    max-width: calc(100% - 18.75em);
  }
}

@media (max-width: 64em) { /* 1024px */
  #main-header {
    padding-right: 1.25em;
  }

  .header-left,
  .header-right {
    width: 100%;
    justify-content: center;
  }

  .header-right {
    margin-top: 0.625em;
  }

  .room-info {
    flex-direction: column;
    gap: 0.625em;
  }

  #user-cards-section {
    padding: 0.625em;
    max-width: calc(100% - 18.75em);
  }

  .user-card {
    width: 100px;
    height: 150px;
    margin: 0.5em;
  }

  .user-card .user-name {
    bottom: -1.5625em;
    font-size: 0.85em;
  }

  #voting-footer {
    padding: 0.625em 0.3125em;
  }

  .cards .card {
    width: 2.34375em;
    height: 3.984375em;
    font-size: 0.84375rem;
  }

  #facilitator-controls .btn {
    margin: 0.3125em;
  }
}

@media (max-width: 48em) { /* 768px */
  #main-header,
  #voting-footer {
    width: 100%;
    margin-right: 0;
  }

  #main-header {
    flex-direction: column;
    align-items: center;
  }

  .header-left h1 {
    margin-bottom: 0.625em;
  }

  .header-left,
  .header-right {
    justify-content: center;
    width: 100%;
  }

  .room-code-block {
    display: none;
  }

  #chat-panel {
    display: none;
  }

  #voting-footer {
    padding: 0.625em 0.3125em;
  }

  .cards .card {
    width: 2.34375em;
    height: 3.984375em;
    font-size: 0.84375rem;
  }

  #facilitator-controls .btn {
    margin: 0.3125em;
  }

  /* Adjust #user-cards-section max-width to 100% since chat panel is hidden */
  #user-cards-section {
    max-width: 100%;
    width: 100%;
  }

  /* Adjust user-card flex properties for better wrapping */
  .user-card {
    flex: 0 0 auto;
    width: 80px;
    height: 120px;
  }
}

/* Medium Screens (Tablet) */
@media (max-width: 768px) {
  .button-group {
    gap: 0.5em;
  }
  
  button {
    padding: 0.5em 1em;
    font-size: 0.875rem;
  }
  
  button i {
    margin-right: 0em;
  }

  /* Session Clock Adjustments */
  #session-clock {
    font-size: 0.75rem;
  }
}

/* Small Screens (Mobile) */
@media (max-width: 480px) {
  .button-group {
    gap: 0.25em;
  }
  
  button {
    padding: 0.375em 0.75em;
    font-size: 0.75rem;
  }
  
  button i {
    margin-right: 0.125em;
  }

  /* Session Clock Adjustments */
  #session-clock {
    font-size: 0.7rem;
  }
}

/* Adjustments for very small screens */
@media (max-width: 30em) { /* 480px */
  #landing-content {
    padding: 0.9375em;
  }

  #landing-page h1 {
    font-size: 2em;
  }

  button {
    padding: 0.625em 0.9375em;
    font-size: 0.875rem;
  }

  .btn-small {
    padding: 0.3125em 0.5em;
    font-size: 0.625rem;
  }

  .user-card {
    flex: 0 0 auto;
    width: 60px;
    height: 90px;
    margin: 3px;
  }

  .user-card .card-face {
    font-size: 1.5rem;
  }

  .user-card .user-name {
    bottom: -1.25em;
    font-size: 0.75em;
  }

  #voting-footer {
    padding: 0.3125em 0;
  }

  .cards .card {
    width: 1.875em;
    height: 2.8125em;
    font-size: 0.75rem;
  }
}

/* --------------------------------------------------
   11. Optional Enhancements for Better UX
-------------------------------------------------- */

/* Vote Summary Section */
#vote-summary {
  margin-top: 1.25em;
  padding: 0.9375em;
  border: 0.125em solid var(--primary-color);
  border-radius: 8px;
  background-color: var(--content-background);
  color: var(--text-color);
  display: none;
  font-size: 0.875rem;
  box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.05);
  transition: border var(--transition-speed) ease, background-color var(--transition-speed) ease, opacity var(--transition-speed) ease;
}

#vote-summary.show {
  display: block;
  animation: fadeIn 0.3s ease forwards;
}

#vote-summary h3 {
  margin-top: 0;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 0.625em;
}

#vote-summary table {
  width: 100%;
  border-collapse: collapse;
}

#vote-summary th, #vote-summary td {
  border: 0.0625em solid var(--primary-color);
  padding: 0.5em;
  text-align: center;
  transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

#vote-summary tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.1);
}

#vote-summary tr:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

#vote-summary th {
  padding-top: 0.75em;
  padding-bottom: 0.75em;
  background-color: var(--primary-color);
  color: var(--button-text-color);
}

/* Highlight Winner Row */
.winner {
  background-color: var(--primary-color);
  color: var(--button-text-color);
}

/* Styles for the "Stand Up" (active) state */
#stand-up.active {
  border: 0.25em solid var(--primary-color);
  box-shadow: 0 0.3125em 0.9375em rgba(255, 111, 97, 0.5);
  background: var(--button-hover-background);
  color: var(--button-hover-text-color);
  transform: scale(1.05);
}

#stand-up {
  transition: border var(--transition-speed) ease, box-shadow var(--transition-speed) ease, background var(--transition-speed) ease, color var(--transition-speed) ease, transform var(--transition-speed) ease;
}

/* --------------------------------------------------
   12. Additional Themes - Refined and Sophisticated
-------------------------------------------------- */

/* Midnight Black Theme */
body.midnight-black-theme {
  --primary-color: #00bcd4; /* Bright Cyan for vibrancy */
  --secondary-color: #0097a7; /* Deep Cyan for depth */
  --background-gradient: linear-gradient(135deg, #0d1b2a 0%, #1b263b 100%); /* Darker gradient for sophistication */
  --text-color: #e0e0e0; /* Light gray for better contrast */
  --header-background: #1b263b; /* Deep navy for header */
  --header-text-color: #e0e0e0; /* Consistent text color */
  --button-background: #00bcd4; /* Bright Cyan */
  --button-text-color: #ffffff; /* White text */
  --button-hover-background: #008ba3; /* Darker Cyan on hover */
  --button-hover-text-color: #ffffff; /* White text */
  --card-background: #00bcd4; /* Bright Cyan for cards */
  --card-text-color: #ffffff; /* White text on cards */
  --card-selected-background: #008ba3; /* Darker Cyan for selected state */
  --chat-panel-background: #1b263b; /* Deep navy for chat panel */
  --chat-text-color: #e0e0e0; /* Light gray text */
  --content-background: linear-gradient(135deg, #0d1b2a 0%, #1b263b 100%); /* Consistent content background */
  --chat-bubble-background: #0d131e; /* Slightly opaque white */
  --chat-bubble-border: 1px solid #ccc; /* Light border for better visibility */
  

  /* Define User Name Background for Midnight Black Theme */
  --user-name-background: #1b263b; /* Matches header background */

  /* Help Title Color */
  --help-title-color: #ffffff;

  /* Event Log Color */
  --event-log-color: #aaaaaa;
}

/* Minimalist Gray Theme */
body.minimalist-gray-theme {
  --primary-color: #607d8b; /* Slate Gray */
  --secondary-color: #455a64; /* Darker Slate */
  --background-gradient: linear-gradient(135deg, #f5f5f5 0%, #cfd8dc 100%); /* Soft gray gradient */
  --text-color: #212121; /* Dark Gray for readability */
  --header-background: #ffffff; /* White header */
  --header-text-color: #212121; /* Dark Gray text */
  --button-background: #90a4ae; /* Light Slate */
  --button-text-color: #ffffff; /* White text */
  --button-hover-background: #78909c; /* Medium Slate on hover */
  --button-hover-text-color: #ffffff; /* White text */
  --card-background: #cfd8dc; /* Light Gray for cards */
  --card-text-color: #212121; /* Dark Gray text */
  --card-selected-background: #b0bec5; /* Medium Gray for selected state */
  --chat-panel-background: #eceff1; /* Very Light Gray for chat panel */
  --chat-text-color: #212121; /* Dark Gray text */
  --content-background: linear-gradient(135deg, #f5f5f5 0%, #cfd8dc 100%); /* Consistent content background */

  /* Define User Name Background for Minimalist Gray Theme */
  --user-name-background: #ffffff; /* Matches header background */

  /* Help Title Color */
  --help-title-color: #212121;

  /* Event Log Color */
  --event-log-color: #555555;
}

/* Professional Theme. */
body.professional-theme {
  --primary-color: #34495e; /* Dark Blue-Grey */
  --secondary-color: #2c3e50; /* Darker Blue-Grey */
  --background-gradient: linear-gradient(135deg, #1c2833 0%, #2c3e50 100%); /* Elegant dark gradient */
  --text-color: #ecf0f1; /* Light Gray for contrast */
  --header-background: #2c3e50; /* Dark Blue-Grey for header */
  --header-text-color: #ecf0f1; /* Light Gray text */
  --button-background: #34495e; /* Dark Blue-Grey */
  --button-text-color: #ecf0f1; /* Light Gray text */
  --button-hover-background: #1f2d3a; /* Even Darker on hover */
  --button-hover-text-color: #ecf0f1; /* Light Gray text */
  --card-background: #3b4a57; /* Medium Dark Blue-Grey for cards */
  --card-text-color: #ecf0f1; /* Light Gray text */
  --card-selected-background: #162533; /* Very Dark Blue-Grey for selected state */
  --chat-panel-background: #2c3e50; /* Dark Blue-Grey for chat panel */
  --chat-text-color: #ecf0f1; /* Light Gray text */
  --content-background: #071c31; /* Solid Dark Blue */
  --chat-bubble-background: rgba(36, 36, 36, 0.9); /* Slightly opaque white */
--chat-bubble-border: 1px solid #ccc; /* Light border for better visibility */


  /* Define User Name Background for Professional Theme */
  --user-name-background: #2c3e50; /* Matches header background */

  /* Help Title Color */
  --help-title-color: #ecf0f1;

  /* Event Log Color */
  --event-log-color: #bdc3c7;
}

/* --------------------------------------------------
   13. Accessibility Enhancements
-------------------------------------------------- */
button:focus,
input[type="text"]:focus,
textarea:focus {
  outline: 2px solid var(--secondary-color);
  outline-offset: 2px;
}

button:focus {
  outline: 3px double var(--secondary-color);
}


/* High Contrast Mode */
@media (prefers-contrast: high) {
  body {
    background: #ffffff;
    color: #000000;
  }

  .user-card .user-name {
    background: #ffffff;
    color: #000000;
  }

  .user-card.voted {
    border-color: #000000;
  }

  /* Additional high contrast adjustments can be added here */
}

/* --------------------------------------------------
   Optional: Smooth Scroll for Better UX
-------------------------------------------------- */
html {
  scroll-behavior: smooth;
}

/* --------------------------------------------------
   14. Additional Enhancements (if any)
-------------------------------------------------- */

/* --------------------------------------------------
    1. User Options Dropdown Menu
-------------------------------------------------- */

.user-card {
  position: relative; /* Ensure the dropdown is positioned relative to the user card */
}

.user-options {
  position: absolute;
  border-radius: var(--border-radius);
  top: 0.5em;
  background: var(--header-background); /* Use header background for consistency */
  border: 0.0625em solid var(--primary-color); /* Use primary color for borders */
  color: var(--chat-text-color); /* Use chat text color for text */
  display: flex;
  flex-direction: column;
  gap: 0.3125em;
  padding: 0.3125em;
  z-index: 100; /* Ensure the dropdown appears above other elements */
}

.user-options.hidden {
  display: none;
}

.user-options .option-btn {
  background: var(--button-background);
  color: var(--button-text-color);
  border: none;
  padding: 0.3125em 0.625em;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.3125em;
  transition: background var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.user-options .option-btn:hover {
  background: var(--button-hover-background);
  color: var(--button-hover-text-color);
  transform: scale(1.05);
}

.user-options .option-btn i {
  margin-right: 0.25em;
}

/* Ensure the dropdown appears above other elements */
.user-options {
  z-index: 100;
}

/* Responsive Adjustments for User Options */
@media (max-width: 768px) {
  .user-options {
    top: 0.25em;
    right: 0.25em;
  }
  
  .user-options .option-btn {
    font-size: 0.75rem;
    padding: 0.25em 0.5em;
  }
}

@media (max-width: 480px) {
  .user-options {
    top: 0.15em;
    right: 0.15em;
  }
  
  .user-options .option-btn {
    font-size: 0.7rem;
    padding: 0.2em 0.4em;
  }
}

/* --------------------------------------------------
    2. User Card Hover State Enhancements
-------------------------------------------------- */

.user-card:hover .user-options {
  display: flex;
}

.user-card:hover {
  /* Optional: Change cursor to pointer when hovering over user cards */
  cursor: pointer;
}

/* --------------------------------------------------
    3. Additional Styles for Co-Host and Removed Users
-------------------------------------------------- */

/* Highlight Co-Host Users */
.user-card.co-host .user-name::after {
  font-size: 0.75em;
  color: var(--secondary-color);
  margin-left: 0.3125em;
}

/* Styles for Removed Users (Optional: If you want to visually indicate removed users) */
.user-card.removed {
  opacity: 0.5;
  filter: grayscale(100%);
  cursor: not-allowed;
}

.user-card.removed .user-options {
  display: none;
}

/* --------------------------------------------------
    4. Other Existing Styles
-------------------------------------------------- */

/* Countdown Overlay */
#countdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

#countdown-text {
  color: var(--chat-text-color); /* Ensure countdown text uses theme text color */
  font-size: 5em;
  font-family: var(--font-family-secondary);
}

/* --------------------------------------------------
   15. Ensure Chat Text Visibility
-------------------------------------------------- */

/* Specifically target chat panel text elements to use --chat-text-color */
#chat-header,
#users-list,
#chat-window,
#typing-indicator,
#chat-input-area,
#send-message,
.chat-message,
.event-log,
.replies-container,
.reply-message,
.reply-input {
  color: var(--chat-text-color);
}

#chat-panel {
  background: var(--chat-panel-background);
}

.chat-message {
  background-color: var(--chat-bubble-background); /* Updated for better visibility */
  border: var(--chat-bubble-border); /* Added border */
}

body.midnight-black-theme #chat-window {
  background: #1b263b; /* Match chat panel background */
}

body.minimalist-gray-theme #chat-window {
  background: #eceff1;
}

body.professional-theme #chat-window {
  background: #2c3e50;
}

/* Ensure placeholders also have adequate contrast */
#chat-input::placeholder {
  color: #aaaaaa; /* Consider adjusting based on theme if necessary */
}

/* Ensure links in chat are visible */
#chat-window a {
  color: var(--primary-color);
}

#chat-window a:hover {
  color: var(--button-hover-background);
}

/* Hide Events Toggle Button Styles */
#toggle-events-container {
  text-align: center;
  margin: 10px 0;
}

#toggle-events {
  color: #fff;
  border: none;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s;
  padding: 0.3125em 0.625em;
  font-size: 0.75rem;
  border-radius: 20px;
  background: var(--button-background);
  color: var(--button-text-color);
  transition: background var(--transition-speed) ease, transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  box-shadow: 0 0.125em 0.25em rgba(0, 0, 0, 0.1);
}

/* #toggle-events:hover {
  background-color: #0056b3;
} */

/* Hidden Events Styles */
.hidden-events .event-log {
  display: none;
}

/* Estimation Tips Container */
#estimation-tips {
  width: 100%;
  padding: 10px;
  background-color: rgba(255, 255, 255, 0.1); /* Semi-transparent background */
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  font-style: italic;
  font-size: 0.9em;
  color: var(--text-color);
  position: relative;
  height: 50px; /* Fixed height to prevent layout shifts */
  overflow: hidden;
  transition: opacity 1s ease-in-out, visibility 1s ease-in-out;
}

/* Hidden Class to Hide Elements */
.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Current Tip Styling */
#current-tip {
  margin: 0;
  opacity: 1;
  transition: opacity 1s ease-in-out;
  position: absolute;
  width: 100%;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Fade-out and Fade-in Classes */
.fade-out {
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.fade-in {
  opacity: 1;
  transition: opacity 1s ease-in-out;
}

/* Responsive Adjustments for Estimation Tips */
@media (max-width: 768px) {
  #estimation-tips {
    font-size: 0.8em;
    height: 60px;
  }
  
  #current-tip {
    font-size: 0.8em;
  }
}

@media (max-width: 480px) {
  #estimation-tips {
    font-size: 0.7em;
    height: 70px;
  }
  
  #current-tip {
    font-size: 0.7em;
  }
}
