/* General styles */
html{
  width:400px;  /* or 450px if you want extra room */
  min-height:300px;
  margin:0;
  padding-top: -10px;
  background:#222; /* just for consistency */
  color:#fff;
}
body {
  margin: 0;
  padding: 10px;
  background: #222; /* dark background */
  color: #fff;
  font-family: "Lato", sans-serif;
}

header {
  text-align: center;
  margin-bottom: 20px;
}

h1 {
  padding-top: -15px;
  font-family: "Boogaloo", cursive;
  font-size: 6rem;
  margin-bottom: 10px;
}

button.btn {
  background: #444;
  color: #fff;
  font-family: "Boogaloo", cursive;
  font-size: 1.2rem;
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

button.btn:hover {
  background: #666;
  transform: scale(1.3);
  transition: ease-in-out 0.2s;
}

/* Friend Card */
.friend-card {
  background: #333;
  border-radius: 15px;
  padding: 15px;
  margin: 15px auto;
  max-width: 400px;
  box-shadow: 0px 4px 8px rgba(0,0,0,0.3);
}

.friend-card h3 {
  font-family: "Boogaloo", cursive;
  font-size: 2rem;
  font-weight: lighter;
  margin: 0 0 8px 0;
}

.friend-card p {
  font-size: 0.9rem;
  color: #bbb;
  margin: 0 5px 8px 0;
  display: inline-block;
}

.friend-card ul {
  list-style: none;
  padding: 0;
  margin: 10px 0;
  font-family: monospace;
  font-size: 0.9rem;

  /* collapse/expand */
  max-height: 0;           /* hide by default */
  opacity: 0;              /* invisible by default */
  overflow: hidden;        /* hide overflow */
  transition: max-height 0.3s ease, opacity 0.3s ease; /* smooth transition */
}

/* ONLINE friends will have fully visible ul by default */
.friend-card.online ul {
  max-height: 1000px;      /* large enough to show all items */
  opacity: 1;
}

/* Hover-expand for OFFLINE / RECENTLY ONLINE */
.friend-card:hover ul {
  max-height: 500px;       /* enough for up to 6 items */
  opacity: 1;
}

.friend-card li {
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
}


.friend-card.offline ul{
  max-height: 0;           /* hide by default */
  opacity: 10%;              
}

/* Verdict styling */
.friend-card [data-verdict] {
  font-weight: bold;
  white-space: nowrap; /* keep on one line */
  display: inline-block;
}

.friend-card [data-verdict="OK"] {
  color: #00ff66; /* green */
}

.friend-card [data-verdict="TIME_LIMIT_EXCEEDED"] {
  color: #ffcc00; /* yellow */
}

.friend-card [data-verdict="WRONG_ANSWER"] {
  color: #ff3333; /* red */
}

.friend-card hr {
  border: none;
  border-top: 1px solid #555;
  margin: 10px 0;
}


/* Status + Remove Row */
.friend-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Status Badge (from earlier) */
.status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 20px;
  padding: 3px 10px;
}

.status-badge.online::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00ff66;
  display: inline-block;
  margin-right: 6px;
}

.status-badge.offline::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3333;
  display: inline-block;
  margin-right: 6px;
}

.status-badge.recently-online::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffcc00;
  display: inline-block;
  margin-right: 6px;
}

/* Remove Button */
.remove-btn {
  background: none;
  border: none;
  color: #bbb;
  font-size: 0.8rem;
  font-weight: bold;
  cursor: pointer;
}

.remove-btn:hover {
  color: white;
  background-color: red;
  border-radius: 8px;
  transform: scale(1.2);
  transition: ease-in-out 0.2s;
}

/* Edit Button */
.edit-btn {
  position: relative;
  left: 70px;
  background: none;
  border: none;
  color: #bbb;
  font-size: 0.8rem;
  font-weight: bold;
  cursor: pointer;
}

.edit-btn:hover {
  position: relative;
  left: 70px;
  color: white;
  background-color: rgb(91, 91, 91);
  border-radius: 8px;
  transform: scale(1.2);
  transition: ease-in-out 0.2s;
}

/* Add Friend Modal */
#addFriendModal {
  display: none; /* hidden by default */
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #333;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  z-index: 9999;
  max-width: 400px;
  width: 90%;
}

/* Backdrop */
#modalBackdrop {
  display: none; /* hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  z-index: 9998;
}


/* for news banner */
 #newsBanner {
      background-color:#2e2e2e;
      border-bottom:1px solid #575757;
      padding:6px 10px;
      text-align:center;
      font-family:Lato, sans-serif;
      font-size:13px;
      font-weight:700;
      animation:slideDown 0.6s ease-out, pulseOnce 1.2s ease-out 0.6s;
      opacity:0;
      animation-fill-mode:forwards;
    }

    @keyframes slideDown {
      0% { transform:translateY(-20px); opacity:0; }
      100% { transform:translateY(0); opacity:1; }
    }

    @keyframes pulseOnce {
      0% { transform:scale(1); }
      35% { transform:scale(1.05); }
      100% { transform:scale(1); }
    }


.heatmap-container{
  width:100%;
  overflow:hidden; /* ensures no scroll */
  padding:0;
  margin-top:10px;
}

.app-wrapper{
  width:400px;
  margin:0 auto;
}
