/* ============================================
   Game Changers HAND Trap - Styles
   ============================================ */

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f8f6ef;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header */
header {
  background: #be5511;
  border-top: 8px solid #cde0ce;
  color: #ffffff;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand h1 {
  margin: 0;
  font-size: clamp(16px, 4vw, 20px);
  font-weight: 650;
  line-height: 1.3;
}

.logos {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.logo-placeholder {
  height: 44px;
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  color: rgba(255,255,255,0.9);
  font-size: 12px;
  font-weight: 500;
  border: 1px dashed rgba(255,255,255,0.3);
}

/* Main Content */
main {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 20px 24px 40px;
  background: #f2ebdc;
  border-left: 1px solid #c9bfa0;
  border-right: 1px solid #c9bfa0;
}

/* Forms */
fieldset {
  margin-bottom: 20px;
  padding: 16px 18px 20px;
  border: 1px solid #d0c4a0;
  background: #f2ead5;
  border-radius: 6px;
}

legend {
  font-weight: 600;
  font-size: 16px;
  padding: 4px 12px;
  margin-left: -12px;
  background: #2f6f74;
  color: #ffffff;
  border-radius: 4px;
}

label {
  display: block;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #2f3e2c;
}

.inline-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.inline {
  min-width: 220px;
  flex: 1 1 220px;
}

/* Form Elements */
input[type="text"],
input[type="date"],
input[type="number"],
input[type="time"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  margin-top: 4px;
  border: 1px solid #b7ad8e;
  background: #ffffff;
  font-size: 15px;
  border-radius: 6px;
  transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
input[type="time"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #be5511;
  box-shadow: 0 0 0 2px rgba(190,85,17,0.1);
}

textarea {
  resize: vertical;
  min-height: 70px;
}

.readonly {
  background: #f8f4e8;
  cursor: default;
}

.readonly:focus {
  border-color: #b7ad8e;
  box-shadow: none;
}

/* Utility Classes */
.muted {
  color: #6a6a6a;
  font-size: 12px;
  margin-top: 4px;
}

.hidden {
  display: none !important;
}

/* Cards */
.subcard {
  background: #f8f4e8;
  border: 1px solid #d2c6a3;
  padding: 18px;
  margin-top: 15px;
  border-radius: 6px;
}

.subcard-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 12px;
  color: #2f6f74;
  border-bottom: 1px solid #d2c6a3;
  padding-bottom: 6px;
}

.divider {
  height: 1px;
  background: #d0c4a0;
  margin: 20px 0;
}

/* Buttons */
.action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 25px;
}

.btn {
  background: #be5511;
  color: #ffffff;
  border: none;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  min-width: 120px;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn.secondary {
  background: #4b6f5a;
}

.btn.ghost {
  background: #2f6f74;
}

/* Photo Preview */
.photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  padding: 15px;
  background: #fff;
  border-radius: 6px;
  min-height: 100px;
  border: 2px dashed #ccc;
}

.photo-preview-item {
  position: relative;
  width: 90px;
  height: 90px;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.photo-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-photo {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(190,85,17,0.9);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.remove-photo:hover {
  background: #be5511;
}

.photo-count,
.photo-limit-indicator {
  font-size: 13px;
  color: #666;
  margin-top: 8px;
  font-weight: 500;
}

.photo-limit-indicator {
  color: #2f6f74;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 10000;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-content {
  background: #fff;
  margin: 20px auto;
  padding: 20px;
  max-width: 700px;
  width: calc(100% - 40px);
  border-radius: 12px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
  color: #2f3e2c;
}

.modal-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* Records List */
.records-list {
  max-height: 50vh;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 6px;
}

.record-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid #eee;
  transition: background 0.2s;
}

.record-item:hover {
  background: #f8f4e8;
}

.record-item button {
  flex: 1;
  text-align: left;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #0b5bd3;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.record-item button:hover {
  text-decoration: underline;
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
  margin-left: 8px;
}

.status-badge.exported {
  background: rgba(75,111,90,0.1);
  border-color: #4b6f5a;
  color: #2f3e2c;
}

.status-badge.not-exported {
  background: rgba(190,85,17,0.1);
  border-color: #be5511;
  color: #8a3d0a;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #2f6f74;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 10001;
  font-weight: 500;
  animation: slideUp 0.3s ease;
  max-width: 90%;
  text-align: center;
}

.toast.error {
  background: #be5511;
}

.toast.success {
  background: #4b6f5a;
}

@keyframes slideUp {
  from {
    transform: translate(-50%, 100%);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

/* Status Message */
.status-message {
  margin-top: 15px;
  padding: 10px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
}

.status-message.error {
  background: #ffe6e6;
  color: #be5511;
  border: 1px solid #ffcdcd;
}

.status-message.success {
  background: #e6f3e6;
  color: #4b6f5a;
  border: 1px solid #c6e0c6;
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
  main {
    padding: 15px;
  }
  
  .inline-row {
    gap: 12px;
  }
  
  .inline {
    min-width: 100%;
  }
  
  .btn {
    width: 100%;
  }
  
  .modal-content {
    margin: 10px;
    width: calc(100% - 20px);
  }
  
  .record-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .status-badge {
    margin-left: 0;
    align-self: flex-start;
  }
}

/* Print Styles */
@media print {
  .btn, .modal, .toast, .action-buttons {
    display: none !important;
  }
}