
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f4f5f7;
  font-family: Arial, Helvetica, sans-serif;
  color: #202124;
}

.hidden {
  display: none !important;
}


/* LOGIN */

.admin-box {
  width: calc(100% - 30px);
  max-width: 420px;
  margin: 70px auto;
  background: #ffffff;
  border-radius: 18px;
  padding: 30px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.brand-mark {
  width: 58px;
  height: 58px;
  margin: 0 auto 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  color: #fff;
  font-weight: bold;
  letter-spacing: 1px;
}

.admin-box h1 {
  margin: 0;
  font-size: 26px;
}

.admin-subtitle {
  color: #777;
  margin-bottom: 25px;
}

.admin-box input,
.admin-card input {
  width: 100%;
  padding: 13px;
  margin: 7px 0;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 15px;
  outline: none;
}

.admin-box input:focus,
.admin-card input:focus {
  border-color: #777;
}


/* BUTTONS */

button {
  border: 0;
  cursor: pointer;
  font-weight: bold;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.primary-button {
  width: 100%;
  padding: 13px;
  margin-top: 10px;
  border-radius: 10px;
  background: #111;
  color: #fff;
  font-size: 15px;
}

.secondary-button {
  padding: 10px 13px;
  border-radius: 9px;
  background: #ececec;
  color: #222;
}

.delete-selected-button {
  padding: 10px 13px;
  border-radius: 9px;
  background: #c62828;
  color: white;
}


/* DASHBOARD */

.admin-dashboard {
  width: calc(100% - 24px);
  max-width: 1100px;
  margin: 20px auto 50px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
}

.dashboard-header h1 {
  margin: 0;
  font-size: 26px;
}

.dashboard-header p {
  margin: 5px 0 0;
  color: #777;
}

.logout-button {
  padding: 10px 16px;
  border-radius: 9px;
  background: #222;
  color: white;
}


/* CARDS */

.admin-card {
  position: relative;
  overflow: hidden;
  background: white;
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 7px 25px rgba(0, 0, 0, 0.06);
}

.admin-card h2 {
  margin: 0 0 5px;
}

.admin-card p {
  color: #777;
}


/* CODE */

.generated-code {
  margin-top: 15px;
  padding: 20px;
  border-radius: 12px;
  background: #f1f1f1;
  text-align: center;
  font-size: 30px;
  font-weight: bold;
  letter-spacing: 8px;
}

#codeStatus,
#loginStatus {
  min-height: 20px;
}


/* MESSAGE HEADER */

.messages-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.message-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.live-status {
  padding: 7px 10px;
  border-radius: 20px;
  background: #eee;
  color: #777;
  font-size: 12px;
  font-weight: bold;
}

.live-status.connected {
  color: #087f23;
  background: #e8f5e9;
}


/* MESSAGES */

.messages-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}


/* DARK + PINK MESSAGE BOX */

.message-card {
  position: relative;
  overflow: hidden;
  background: #171717;
  border: 1px solid #ff69b4;
  border-radius: 15px;
  padding: 16px;
  isolation: isolate;
}


/*
  Slight Laikipia Unisilent background.
  It stays behind the actual message.
*/

.message-watermark {
  position: absolute;
  right: -20px;
  bottom: 25px;
  font-size: 30px;
  font-weight: bold;
  letter-spacing: 2px;
  color: rgba(255, 105, 180, 0.08);
  transform: rotate(-20deg);
  pointer-events: none;
  white-space: nowrap;
  z-index: -1;
}


/* MESSAGE TOP */

.message-top {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 2;
}

.message-checkbox {
  display: flex;
  align-items: center;
}

.message-checkbox input {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: #ff69b4;
}

.message-title {
  flex: 1;
  font-weight: bold;
  color: #ff69b4;
}


/* DELETE */

.delete-message-button {
  padding: 7px 11px;
  border-radius: 8px;
  background: #c62828;
  color: white;
  font-size: 12px;
}


/*
  Caption/message remains visible on
  both desktop and phone, including
  when media is attached.
*/

.message-caption {
  position: relative;
  z-index: 2;
  margin-top: 13px;
  padding: 12px;
  background: #0d0d0d;
  border: 1px solid rgba(255, 105, 180, 0.25);
  color: #ffffff;
  border-radius: 10px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}


/* MEDIA */

.message-media {
  position: relative;
  z-index: 2;
  margin-top: 12px;
  width: 100%;
}

.message-image {
  display: block;
  width: 100%;
  max-width: 700px;
  max-height: 600px;
  object-fit: contain;
  border-radius: 11px;
  background: #050505;
  border: 1px solid rgba(255, 105, 180, 0.25);
}



/* DATE */

.message-date {
  position: relative;
  z-index: 2;
  margin-top: 10px;
  font-size: 12px;
  color: #aaa;
}


/* EMPTY */

.empty-messages {
  padding: 40px 20px;
  text-align: center;
  color: #888;
  background: #fafafa;
  border-radius: 12px;
}

.error-box {
  color: #b71c1c;
  background: #ffebee;
}


/* PHONE */

@media (max-width: 600px) {

  .admin-box {
    margin: 30px auto;
    padding: 22px;
  }

  .admin-dashboard {
    width: calc(100% - 16px);
    margin-top: 10px;
  }

  .dashboard-header {
    align-items: flex-start;
  }

  .dashboard-header h1 {
    font-size: 21px;
  }

  .logout-button {
    padding: 8px 11px;
  }

  .admin-card {
    padding: 14px;
    border-radius: 13px;
  }

  .messages-header {
    flex-direction: column;
    align-items: stretch;
  }

  .message-actions {
    width: 100%;
  }

  .message-actions button {
    flex: 1;
  }

  .live-status {
    text-align: center;
  }

  .message-card {
    padding: 12px;
    border-radius: 12px;
  }

  .message-top {
    align-items: center;
  }

  .message-title {
    font-size: 14px;
  }

  .delete-message-button {
    padding: 6px 8px;
  }

  /*
    Caption stays visible on mobile
    even when image is attached.
  */

  .message-caption {
    display: block;
    width: 100%;
    font-size: 15px;
    margin-top: 11px;
    padding: 11px;
  }

  .message-image {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
  }

  .message-watermark {
    font-size: 20px;
  }

  .generated-code {
    font-size: 25px;
  }
}
```
