/* FamilyLine Web Cabinet - Minimal Styles */

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 20px;
  background: #f5f5f5;
  color: #333;
  line-height: 1.5;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  background: white;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

h1 {
  margin-top: 0;
  color: #1a1a1a;
  font-size: 1.75rem;
}

h2 {
  font-size: 1.25rem;
  margin-top: 24px;
  margin-bottom: 12px;
}

/* Forms */
label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  color: #555;
}

input, textarea, select {
  padding: 10px 12px;
  margin-bottom: 12px;
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

/* Settings Section */
.settings-section {
  background: #f8f9fa;
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  border: 1px solid #e9ecef;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.setting-row label {
  margin-bottom: 0;
  min-width: 120px;
}

.setting-row select {
  width: 200px;
  margin-bottom: 0;
}

.setting-row button {
  margin-bottom: 0;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

input[type="color"] {
  width: 60px;
  height: 36px;
  padding: 2px;
  cursor: pointer;
}

input[type="password"] {
  font-family: monospace;
}

/* Buttons */
button {
  padding: 10px 20px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

button:hover {
  background: #0056b3;
}

button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

button.secondary {
  background: #6c757d;
}

button.secondary:hover {
  background: #545b62;
}

button.danger {
  background: #dc3545;
}

button.danger:hover {
  background: #c82333;
}

button.small {
  padding: 6px 12px;
  font-size: 12px;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

th, td {
  padding: 12px;
  border: 1px solid #e0e0e0;
  text-align: left;
}

th {
  background: #f8f9fa;
  font-weight: 600;
  color: #555;
}

tr:hover {
  background: #f8f9fa;
}

/* Info blocks */
.info-block {
  background: #f8f9fa;
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.info-block p {
  margin: 4px 0;
}

.info-block strong {
  color: #333;
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.badge.claimed {
  background: #d4edda;
  color: #155724;
}

.badge.free {
  background: #fff3cd;
  color: #856404;
}

.badge.admin {
  background: #cce5ff;
  color: #004085;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 24px;
  border-radius: 8px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
  margin-top: 0;
}

.modal-content img {
  max-width: 200px;
  margin: 16px auto;
  display: block;
}

/* Family modal - scrollable and responsive */
.family-modal-content {
  background: white;
  padding: 24px;
  border-radius: 8px;
  max-width: 90vw;
  min-width: 600px;
  width: auto;
  max-height: 90vh;
  overflow-y: auto;
  text-align: left;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.family-modal-content h2 {
  margin-top: 0;
}

.hidden {
  display: none !important;
}

/* Messages */
.error {
  color: #dc3545;
  background: #f8d7da;
  padding: 10px 14px;
  border-radius: 4px;
  margin: 12px 0;
}

.success {
  color: #155724;
  background: #d4edda;
  padding: 10px 14px;
  border-radius: 4px;
  margin: 12px 0;
}

.warning {
  color: #856404;
  background: #fff3cd;
  padding: 10px 14px;
  border-radius: 4px;
  margin: 12px 0;
  font-weight: 500;
}

/* Header with logout */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e0e0e0;
}

.header h1 {
  margin: 0;
}

/* Action bar */
.action-bar {
  display: flex;
  gap: 12px;
  margin: 16px 0;
  flex-wrap: wrap;
}

/* Search */
.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.search-bar input {
  flex: 1;
  margin-bottom: 0;
}

.search-bar button {
  flex-shrink: 0;
}

/* Token display */
.token-display {
  font-family: monospace;
  background: #f8f9fa;
  padding: 12px;
  border-radius: 4px;
  word-break: break-all;
  font-size: 14px;
  margin: 12px 0;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.pagination button {
  padding: 6px 12px;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: #666;
}

/* Color swatch preview */
.color-preview {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  vertical-align: middle;
  border: 1px solid #ddd;
}

/* Responsive */
@media (max-width: 600px) {
  body {
    padding: 10px;
  }
  
  .container {
    padding: 16px;
  }
  
  table {
    font-size: 14px;
  }
  
  th, td {
    padding: 8px;
  }
  
  .header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
