/* 
 * Admin Dashboard Stylesheet for POLL System
 */
:root {
  --bg-admin: #0b0f19;
  --panel-bg: rgba(22, 30, 49, 0.75);
  --panel-border: rgba(255, 255, 255, 0.08);
  --primary: #6366f1;
  --primary-light: #818cf8;
  --accent: #ec4899;
  --cyan: #06b6d4;
  --emerald: #10b981;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --text-title: #f8fafc;
  --text-body: #94a3b8;
  --text-dim: #64748b;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition: all 0.25s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background-color: var(--bg-admin);
  color: var(--text-title);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(at 10% 10%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 90% 90%, rgba(236, 72, 153, 0.1) 0px, transparent 50%);
  background-attachment: fixed;
}

/* Nav Header */
.admin-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--panel-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-badge {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
}

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

.btn-primary:hover {
  background: #4f46e5;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-body);
  border-color: var(--panel-border);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.btn-success {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
  background: #10b981;
  color: white;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: #ef4444;
  color: white;
}

/* Layout */
.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 24px;
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.kpi-card {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.4);
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,0.15);
}

.kpi-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.kpi-sub {
  font-size: 0.85rem;
  color: var(--emerald);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 2rem;
  opacity: 0.25;
}

/* Chart Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 35px;
}

@media (max-width: 992px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.4);
}

.chart-card.full-width {
  grid-column: 1 / -1;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.chart-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f1f5f9;
}

.chart-wrapper {
  position: relative;
  height: 280px;
  width: 100%;
}

/* Table Area */
.table-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.4);
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.search-box {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  gap: 10px;
  min-width: 280px;
}

.search-box input {
  background: transparent;
  border: none;
  color: white;
  outline: none;
  font-size: 0.9rem;
  width: 100%;
}

.search-box input::placeholder {
  color: var(--text-dim);
}

/* Table Styles */
.responsive-table-container {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.admin-table th {
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-body);
  font-weight: 600;
  padding: 14px 16px;
  border-bottom: 1px solid var(--panel-border);
  white-space: nowrap;
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.badge-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  margin: 2px;
}

.badge-score {
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
}

.badge-score.high {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.badge-score.mid {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.badge-score.low {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* Pagination */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--panel-border);
  color: var(--text-body);
  font-size: 0.88rem;
}

.page-buttons {
  display: flex;
  gap: 6px;
}

/* Detail Modal */
.admin-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 20px;
}

.admin-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.admin-modal-content {
  background: #131b2e;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 30px;
  max-width: 650px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

.modal-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 12px;
}

.detail-row {
  margin-bottom: 16px;
}

.detail-label {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 4px;
}

.detail-value {
  font-size: 0.95rem;
  color: #fff;
  background: rgba(15, 23, 42, 0.6);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--panel-border);
  white-space: pre-wrap;
  word-break: break-all;
}

/* Login Page specific */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 40px 35px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.login-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 20px;
}

.form-group {
  text-align: left;
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-body);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: white;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

.error-alert {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 20px;
  text-align: left;
}
