* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
}

body {
  background-color: #111;
  color: #f0f0f0;
  padding: 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

header {
  text-align: center;
  margin-bottom: 1.5rem;
}

header h1 {
  font-size: 2.8rem;
  color: #40f940;
  font-weight: 700;
}

header p {
  font-size: 1.1rem;
  color: white;
  margin-top: 1.7rem;
}

#clock {
  font-size: 1rem;
  color: #aaa;
  margin-top: 0.5rem;
}

#session-info {
  font-size: 0.9rem;
  color: white;
  text-align: right;
  margin-bottom: 0.7rem;
}

#logout-btn {
  margin-left: 0.5rem;
  padding: 5px 10px;
  background-color: #ff4444;
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 0.8rem;
}

#logout-btn:hover {
  background-color: #e03636;
}

.auth-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1rem auto;
  max-width: 900px;
}

.auth-section {
  background-color: #1e1e1e;
  padding: 2rem;
  border-radius: 12px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  border: 1px solid #2a2a2a;
}

.auth-section h2 {
  text-align: center;
  margin-bottom: 0.5rem;
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 700;
}

#group-section h2 {
  margin-bottom: 0.5rem;
}

input,
select,
textarea,
button {
  font-family: inherit;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="date"],
textarea,
select {
  width: 100%;
  padding: 10px;
  margin-top: 0.3rem;
  margin-bottom: 1rem;
  border: 1px solid #333;
  border-radius: 6px;
  background-color: #222;
  color: #fff;
  font-size: 0.95rem;
}

input::placeholder,
textarea::placeholder {
  color: #888;
}

button {
  background-color: #28a745;
  color: #fff;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  padding: 10px;
  cursor: pointer;
  font-size: 1rem;
}

button:hover {
  background-color: #1e8e3e;
}

.filter-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.filter-btn {
  background-color: #333;
  color: #ccc;
  border: 1px solid #444;
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
}

.filter-btn:hover {
  margin-bottom: 1rem;
  background-color: #444;
}

#group-section,
#task-form,
#task-list,
#chat-container,
#member-list {
  background-color: #1a1a1a;
  padding: 1.5rem;
  border-radius: 10px;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
}

#chat-messages {
  max-height: 200px;
  overflow-y: auto;
  background-color: #111;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 5px;
  font-size: 0.95rem;
  border: 1px solid #333;
}

#chat-messages div {
  margin-bottom: 0.3rem;
}

textarea {
  resize: vertical;
}

.hidden {
  display: none;
}

.group-id-display {
  text-align: center;
  color: #66ff66;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

#task-list h3,
#chat-container h3,
#member-list h3 {
  margin-bottom: 0.5rem;
}

.leave-group-container {
  bottom: 4rem;
  text-align: right;
  display: none; 
  z-index: 100;
}

button {
  margin-top: 6px;
  margin-right: 9px;
  padding: 6px 10px;
  font-size: 14px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
}

#task-list li {
  margin-bottom: 1rem;
  padding: 10px;
  border-bottom: 1px solid #444;
  list-style: none;
}

#task-list li strong {
  font-size: 1rem;
}

#task-list li br {
  line-height: 1.2;
}

#task-list button {
  margin: 6px 6px 0 0;
  padding: 5px 10px;
  font-size: 13px;
}

@media (max-width: 500px) {
  #task-list li {
    padding: 8px;
    margin-bottom: 0.7rem;
    line-height: 1.3;
  }

  #task-list li strong {
    font-size: 0.95rem;
  }

  #task-list button {
    display: block;
    width: 100%;
    margin: 6px 0;
    text-align: center;
    padding: 5px 10px;
    font-size: 13px;
  }

  .filter-buttons button {
    padding: 4px 8px;
    font-size: 12px;
    margin: 4px 4px 0 0;
  }

  .leave-group-btn,
  .logout-btn {
    padding: 6px 12px;
    font-size: 13px;
    margin-top: 10px;
  }

  .auth-container {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .auth-section {
    padding: 1rem;
  }

  header h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    text-align: center;
  }
}

.task-list-container {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 10px;
  margin-top: 1rem;
  border: 1px solid #333;
  border-radius: 8px;
  background-color: #111;
}

#tasks li {
  margin-bottom: 1rem;
  padding: 10px;
  border-bottom: 1px solid #444;
  list-style: none;
}

@media (max-width: 500px) {
  .task-list-container {
    max-height: 220px;
  }
}

.forgot-password {
  margin-top: 0.8rem;
  font-size: 0.95rem;
  color: #eee;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.forgot-password button {
  background: none;
  border: none;
  color: #99f866;  
  cursor: pointer;
  font-weight: 500;
  padding: 0;
}

.forgot-password button:hover {
  text-decoration: none;
  color: #99f866;
}

main {
  max-width: 800px; 
  margin: 0 auto;
  padding: 1rem;
}

#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #111;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  font-size: 1.5rem;
}

body.loaded #loading-screen {
  display: none;
}

footer {
  text-align: center;
  margin-top: 3rem;
  font-size: 0.9rem;
  color: #aaa;
  white-space: normal;
  word-break: break-word;
}

@media (max-width: 480px) {
  footer {
    font-size: 0.8rem;
    padding: 0.5rem;
    max-width: 90%;
    margin: 0 auto;
    line-height: 1.4;
  }
}
