/**
 * JORO DARK THEME - Coalition Style
 * Shared CSS for consistent dark theme across all pages
 */

/* CSS Variables */
:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  --bg-hover: rgba(255, 255, 255, 0.05);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.05);
  
  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-green: #22c55e;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
}

h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }

p {
  color: var(--text-secondary);
}

/* Links */
a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-blue-hover);
}

/* Page Layout */
.joro-page {
  min-height: 100vh;
  padding-top: 70px; /* Space for nav */
}

.joro-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Page Header */
.joro-page-header {
  background: var(--bg-card);
  padding: 32px 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 32px;
}

.joro-page-header-content {
  max-width: 1400px;
  margin: 0 auto;
}

.joro-page-title {
  font-size: 28px;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
}

.joro-page-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Cards */
.joro-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 24px;
  transition: all 0.2s;
}

.joro-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-md);
}

.joro-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.joro-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Buttons */
.joro-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}

.joro-btn svg {
  width: 18px;
  height: 18px;
}

.joro-btn-primary {
  background: linear-gradient(135deg, var(--accent-blue) 0%, #1d4ed8 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.joro-btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
  color: white;
}

.joro-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.joro-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.joro-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
}

.joro-btn-ghost:hover {
  background: var(--bg-hover);
  color: white;
}

.joro-btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.joro-btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

/* Form Elements */
.joro-form-group {
  margin-bottom: 20px;
}

.joro-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.joro-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.2s;
}

.joro-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.joro-input::placeholder {
  color: var(--text-muted);
}

.joro-select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 40px;
}

.joro-select:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.joro-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Tables */
.joro-table {
  width: 100%;
  border-collapse: collapse;
}

.joro-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.joro-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  color: var(--text-secondary);
}

.joro-table tr:hover td {
  background: var(--bg-hover);
}

.joro-table tr:last-child td {
  border-bottom: none;
}

/* Search Box */
.joro-search-box {
  position: relative;
  max-width: 400px;
}

.joro-search-input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 14px;
}

.joro-search-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: rgba(255, 255, 255, 0.08);
}

.joro-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

/* Badges */
.joro-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.joro-badge-green {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.joro-badge-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.joro-badge-red {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.joro-badge-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.joro-badge-purple {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Risk Score Circle */
.joro-risk-circle {
  width: 160px;
  height: 160px;
  position: relative;
}

.joro-risk-circle svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.joro-risk-circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 12;
}

.joro-risk-circle-progress {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease;
}

.joro-risk-circle-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.joro-risk-circle-number {
  font-size: 42px;
  font-weight: 700;
  color: white;
}

.joro-risk-circle-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Stat Cards */
.joro-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.joro-stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.joro-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.joro-stat-value {
  font-size: 32px;
  font-weight: 700;
  color: white;
}

.joro-stat-change {
  font-size: 12px;
  color: var(--accent-green);
  margin-top: 4px;
}

.joro-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.joro-stat-icon svg {
  width: 24px;
  height: 24px;
}

.joro-stat-icon.blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.joro-stat-icon.amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.joro-stat-icon.green {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.joro-stat-icon.purple {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

/* Empty State */
.joro-empty-state {
  text-align: center;
  padding: 60px 24px;
}

.joro-empty-icon {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: var(--text-muted);
}

.joro-empty-icon svg {
  width: 40px;
  height: 40px;
}

.joro-empty-title {
  font-size: 18px;
  font-weight: 600;
  color: white;
  margin-bottom: 8px;
}

.joro-empty-text {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto;
}

/* Loading Spinner */
.joro-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: joro-spin 0.8s linear infinite;
}

@keyframes joro-spin {
  to { transform: rotate(360deg); }
}

/* Tabs */
.joro-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.joro-tab {
  padding: 10px 20px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.joro-tab:hover {
  background: var(--bg-hover);
  color: white;
}

.joro-tab.active {
  background: var(--accent-blue);
  color: white;
}

/* Progress Bar */
.joro-progress {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.joro-progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.joro-progress-bar.green { background: linear-gradient(90deg, #22c55e, #4ade80); }
.joro-progress-bar.amber { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.joro-progress-bar.red { background: linear-gradient(90deg, #ef4444, #f87171); }
.joro-progress-bar.blue { background: linear-gradient(90deg, #3b82f6, #60a5fa); }

/* Modal */
.joro-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.joro-modal {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.joro-modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.joro-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: white;
}

.joro-modal-close {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.joro-modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.joro-modal-body {
  padding: 24px;
}

.joro-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Grid Layouts */
.joro-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.joro-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.joro-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

@media (max-width: 1024px) {
  .joro-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .joro-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .joro-grid-4 { grid-template-columns: 1fr; }
  .joro-grid-3 { grid-template-columns: 1fr; }
  .joro-grid-2 { grid-template-columns: 1fr; }
}

/* Utility Classes */
.joro-text-center { text-align: center; }
.joro-text-right { text-align: right; }
.joro-flex { display: flex; }
.joro-flex-center { display: flex; align-items: center; justify-content: center; }
.joro-flex-between { display: flex; align-items: center; justify-content: space-between; }
.joro-gap-sm { gap: 8px; }
.joro-gap-md { gap: 16px; }
.joro-gap-lg { gap: 24px; }
.joro-mb-sm { margin-bottom: 8px; }
.joro-mb-md { margin-bottom: 16px; }
.joro-mb-lg { margin-bottom: 24px; }
.joro-mt-sm { margin-top: 8px; }
.joro-mt-md { margin-top: 16px; }
.joro-mt-lg { margin-top: 24px; }

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

