/* manage/style.css - Styles for Analytics Page */

/* ===== 전역 설정 ===== */
:root {
  --primary-color: #667eea;
  --primary-hover: #5a67d8;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --gray-bg: #f7f7fa;
  --border-color: #e5e7eb;
  --text-primary: #2c3e50;
  --text-secondary: #6b7280;
}

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Pretendard', Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--gray-bg);
  color: var(--text-primary);
  line-height: 1.6;
}

/* ===== Analytics Specific Styles ===== */
.analytics-container {
  padding: 20px;
  max-width: 1600px;
  margin: 0 auto;
}

.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
}

.analytics-header h2 {
  margin: 0;
  color: #2c3e50;
  font-size: 28px;
}

/* Sub Tabs */
.analytics-subtabs {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e0e0e0;
}

.analytics-subtabs button {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #7f8c8d;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s;
}

.analytics-subtabs button:hover {
  color: #2c3e50;
  background: #f8f9fa;
}

.analytics-subtabs button.active {
  color: #667eea;
  border-bottom-color: #667eea;
  font-weight: 600;
}

/* Common Components */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.builder-section {
  background: white;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.builder-section h3 {
  margin: 0 0 20px 0;
  color: #2c3e50;
  font-size: 18px;
  font-weight: 600;
}

.upload-section {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.upload-section input[type="file"] {
  flex: 1;
  padding: 10px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

.column-selector {
  position: relative;
  display: inline-block;
  margin-bottom: 10px;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 110%;
  left: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  z-index: 100;
  min-width: 200px;
}

.dropdown-menu label {
  display: block;
  margin: 3px 0;
  font-size: 14px;
  color: #333;
  cursor: pointer;
    }

.dropdown-menu input[type="checkbox"] {
  margin-right: 8px;
}

/* Button Styles */
.btn {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}

.btn:hover {
  background: #f9fafb;
}

.btn:disabled {
  background-color: #f8f9fa;
  color: #ced4da;
  cursor: not-allowed;
  border-color: #e9ecef;
}

.btn.primary,
.btn-primary {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.btn.primary:hover,
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
  background: #6b7280;
  color: white;
  border-color: #6b7280;
}

.btn-secondary:hover {
  background: #4b5563;
}

.delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  transition: all 0.2s;
}

.delete-btn:hover {
  opacity: 0.7;
  transform: scale(1.1);
}

/* Table Styles */
.results-table, .data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.results-table thead, .data-table thead {
  background: #f8f9fa;
  border-bottom: 2px solid #e0e0e0;
}

.results-table th, .data-table th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: #2c3e50;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  position: relative;
  border-bottom: 2px solid var(--border-color);
}

.results-table th:hover {
  background: #e9ecef;
}

.results-table th[data-sort="asc"]::after {
  content: " ▲";
  font-size: 12px;
}

.results-table th[data-sort="desc"]::after {
  content: " ▼";
  font-size: 12px;
}

.results-table td, .data-table td {
  padding: 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  color: #333;
}

.results-table tbody tr:hover, .data-table tbody tr:hover {
  background: #f8f9fa;
}

/* Misc */
.loading {
  color: #999;
  text-align: center;
  padding: 20px;
}

.info-message {
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  color: #7f8c8d;
  text-align: center;
  line-height: 1.6;
}

.chart-wrapper {
  width: 100%;
  max-width: 800px;
  height: 300px;
  margin: 30px auto 0;
}

.strategy-section {
  margin-top: 30px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

.strategy-section textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.strategy-result {
  margin-top: 15px;
  padding: 15px;
  background: white;
  border-radius: 8px;
  border-left: 4px solid #667eea;
  white-space: pre-wrap;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .upload-section {
    flex-direction: column;
    align-items: stretch;
  }

  .results-table {
    font-size: 12px;
  }

  .results-table th,
  .results-table td {
    padding: 8px;
  }
}
