/* history.css - チェック履歴画面専用スタイル */


/* Auth Required */
.auth-required {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.auth-message {
  text-align: center;
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.auth-message i {
  font-size: 48px;
  color: #6c757d;
  margin-bottom: 16px;
}

.auth-message h2 {
  margin: 0 0 12px 0;
  color: #212529;
}

.auth-message p {
  color: #6c757d;
  margin: 0 0 24px 0;
}

.login-redirect-btn {
  background: #007bff;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s ease;
}

.login-redirect-btn:hover {
  background: #0056b3;
}

/* Loading */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.loading-spinner {
  text-align: center;
}

.loading-spinner i {
  font-size: 32px;
  color: #007bff;
  margin-bottom: 16px;
}

.loading-spinner p {
  color: #6c757d;
  margin: 0;
}

/* Stats */
.history-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stat-item {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  flex: 1;
  min-width: 150px;
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 14px;
  color: #6c757d;
  margin-bottom: 8px;
}

.stat-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #007bff;
}

/* Filters */
.filter-options {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: white;
  color: #495057;
  cursor: pointer;
  font-size: 14px;
}

.filter-select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

/* History List */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Date Section */
.date-section {
  margin-bottom: 20px;
}

.date-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 2px solid #e9ecef;
  margin-bottom: 16px;
}

.date-header h3 {
  margin: 0;
  font-size: 18px;
  color: #495057;
  font-weight: 600;
}

.date-count {
  background: #e9ecef;
  color: #495057;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

/* History Item */
.history-item {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
  border-left: 4px solid transparent;
}

.history-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 16px;
}

.item-time {
  font-size: 14px;
  color: #6c757d;
  flex-shrink: 0;
}

.item-risk {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.risk-flames {
  font-size: 16px;
}

.risk-level {
  font-size: 12px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  color: white;
}

.risk-level.low {
  background: #28a745;
}

.risk-level.medium {
  background: #ffc107;
  color: #212529;
}

.risk-level.high {
  background: #dc3545;
}

.item-text {
  font-size: 16px;
  line-height: 1.5;
  color: #212529;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 6px 12px;
  border: 1px solid #dee2e6;
  background: #f8f9fa;
  color: #495057;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.action-btn:hover {
  background: #e9ecef;
  color: #212529;
}

.action-btn.primary {
  background: #007bff;
  border-color: #007bff;
  color: white;
}

.action-btn.primary:hover {
  background: #0056b3;
  border-color: #0056b3;
}

/* Load More */
.load-more-container {
  text-align: center;
  margin: 40px 0;
}

.load-more-btn {
  display: block;
  margin: 0 auto;
  padding: 12px 32px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s ease;
}

.load-more-btn:hover {
  background: #0056b3;
}

.load-more-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.empty-state i {
  font-size: 64px;
  color: #dee2e6;
  margin-bottom: 20px;
}

.empty-state h3 {
  margin: 0 0 12px 0;
  color: #495057;
}

.empty-state p {
  color: #6c757d;
  margin: 0 0 24px 0;
}

.start-check-btn {
  background: #28a745;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s ease;
}

.start-check-btn:hover {
  background: #1e7e34;
}

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

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 8px;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
  margin: 0;
  color: #212529;
}

.close-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: #6c757d;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: #f8f9fa;
  color: #212529;
}

.modal-body {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .history-main {
    padding: 16px;
  }
  
  .header-content {
    padding: 12px 16px;
  }
  
  .back-button span,
  .refresh-button span {
    display: none;
  }
  
  .history-stats {
    gap: 12px;
  }
  
  .filter-options {
    gap: 8px;
  }
  
  .item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .modal-content {
    max-width: 95vw;
    margin: 20px;
  }
}

@media (max-width: 480px) {
  .stat-item {
    min-width: 120px;
  }
  
  .history-item {
    padding: 16px;
  }
  
  .item-actions {
    justify-content: center;
  }
}