/* Base styles and CSS variables */
:root {
  --primary-color: #0078d4;
  --background-color: #f3f2f1;
  --text-color: #323130;
  --border-color: #ddd;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --spacing-unit: 1rem;
  --container-padding: 1.25rem;
  --border-radius: 8px;
}

/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.loading-spinner {
  display: none;
  width: 40px;
  height: 40px;
  margin: var(--spacing-unit) auto;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.admin-loading-spinner {
  display: none;
  margin: 20px auto;
  border: 16px solid #f3f3f3;
  border-radius: 50%;
  border-top: 16px solid #000;
  width: 120px;
  height: 120px;
  background: url('/static/images/wu-tang-clan-logo.png') no-repeat center center;
  background-size: 50%;
  animation: spin 2s linear infinite;
}

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

/* Mobile-first container styles */
.container, 
.splash-container {
  width: 100%;
  padding: var(--container-padding);
  margin: 0 auto;
  background-color: #ffffff;
  box-shadow: var(--shadow);
  border-radius: var(--border-radius);
}

/* Typography */
h1 {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: var(--spacing-unit);
}

h2 {
  color: var(--primary-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--spacing-unit);
  font-size: 0.875rem;
}

table, th, td {
  border: 1px solid var(--border-color);
}

th, td {
  padding: 0.5rem;
  text-align: left;
}

th {
  background-color: #f2f2f2;
}

button {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

button:hover {
  background-color: #005a9e;
}

.unclaimed-box {
  width: expand;
  background-color: darkgrey;
  color: lightgrey;
  padding: 5px;
  border-radius: 3px;
  text-align: center;
  cursor: not-allowed;
}

.reclaim-button {
  align-self: center;
  width: expand;
  background-color: darkred;
  color: white;
  padding: 5px;
  border-radius: 3px;
  cursor: pointer;
}

.reclaim-button:hover {
  background-color: red;
}

.actions {
  margin-top: 10px;
}

.action-icon {
  background: var(--primary-color);
  cursor: pointer;
  margin: 1px 1px;
  padding: 2px;
  border: none;
  color: whitesmoke;
  transition: color 0.3s ease;
}

.action-icon:hover {
  color: #3498db;
}

.action-icon.delete:hover {
  color: #e74c3c;
}

input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
}

label {
  display: block;
  margin-top: 10px;
}

.recipient-row:hover {
  background-color: #f2f2f2;
  cursor: pointer;
}

.selected-row {
  background-color: #d9edf7;
}

.message-viewer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  padding: var(--container-padding);
  overflow-y: auto;
  z-index: 1000;
}

/* Mobile styles (default) */
.message-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#message-table {
  min-width: 100%;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Tablet and up (768px+) */
@media screen and (min-width: 768px) {
  .container,
  .splash-container {
    max-width: 90%;
    margin: var(--spacing-unit) auto;
  }

  h1 {
    font-size: 2rem;
  }

  .action-buttons {
    flex-direction: row;
  }

  button {
    width: auto;
    min-width: 120px;
  }

  .message-viewer {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    height: auto;
    max-height: 90vh;
    border-radius: var(--border-radius);
  }
}

/* Desktop (1024px+) */
@media screen and (min-width: 1024px) {
  .container,
  .splash-container {
    max-width: 1200px;
  }

  table {
    font-size: 1rem;
  }

  .message-viewer {
    max-width: 1000px;
  }
}

/* Utility classes */
.hidden-mobile {
  display: none;
}

@media screen and (min-width: 768px) {
  .hidden-mobile {
    display: initial;
  }
  
  .hidden-desktop {
    display: none;
  }
}
