/* Core Platform Styles */
.glass-panel {
  background: rgba(76, 29, 149, 0.2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px dashed rgba(147, 51, 234, 0.4);
  transition: all 0.3s ease;
}

.glass-panel:hover {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.6);
  transform: scale(1.03);
}

/* Game Hub Glass Cards */
.game-card {
  position: relative;
  background: linear-gradient(135deg, rgba(15, 20, 25, 0.9), rgba(26, 32, 44, 0.9));
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
  z-index: 1;
}

.game-card:hover::before {
  left: 100%;
}

.game-card:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 20px 40px rgba(0, 245, 255, 0.3), 0 0 30px rgba(255, 0, 255, 0.2);
  border-image: linear-gradient(45deg, #00f5ff, #ff00ff) 1;
}

.game-icon {
  transition: all 0.3s ease;
  filter: drop-shadow(0 0 10px currentColor);
}

.game-card:hover .game-icon {
  transform: scale(1.2) rotate(10deg);
  filter: drop-shadow(0 0 20px currentColor);
}

/* Stats Bar */
.stats-bar {
  background: linear-gradient(90deg, #0f1419, #1a202c);
  border: 2px solid rgba(0, 245, 255, 0.3);
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Enhanced Progress Bar */
.progress-bar {
  position: relative;
  height: 12px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00f5ff, #ff00ff);
  border-radius: 6px;
  position: relative;
  animation: pulse-glow 2s ease-in-out infinite alternate;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
  0% { left: -100%; }
  100% { left: 100%; }
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 5px rgba(0, 245, 255, 0.5); }
  100% { box-shadow: 0 0 20px rgba(0, 245, 255, 0.8), 0 0 30px rgba(255, 0, 255, 0.6); }
}

/* Score Display */
.score-display {
  font-family: 'Courier New', monospace;
  color: #ffd700;
  font-weight: bold;
}

.hover-scale {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-scale:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.nav-item {
  position: relative;
  transition: all 0.3s ease;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.5), rgba(139, 92, 246, 0.5));
  border-color: rgba(59, 130, 246, 0.8);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.nav-item:hover:not(.active) {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

/* Loading States */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Gradient Text */
.gradient-text {
  color: #3b82f6;
  font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-item span {
    display: none;
  }
  
  .glass-panel {
    margin: 0 1rem;
  }
}

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

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
}

/* Section Transitions */
.section-enter {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.section-enter-active {
  opacity: 1;
  transform: translateY(0);
}

.section-exit {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.section-exit-active {
  opacity: 0;
  transform: translateY(-20px);
}

/* Surveillance Legislative Tracking Styles */
.surveillance-legislative-integration {
  background: linear-gradient(135deg, rgba(15, 20, 25, 0.95), rgba(26, 32, 44, 0.95));
  border: 2px dashed rgba(239, 68, 68, 0.4);
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem 0;
  backdrop-filter: blur(10px);
}

/* Legislation Router Styles */
.legislation-router {
  margin: 1.5rem 0;
}

.router-message {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.1));
  border: 2px dashed rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: all 0.3s ease;
}

.router-message:hover {
  border-color: rgba(59, 130, 246, 0.5);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(99, 102, 241, 0.15));
}

.router-icon {
  font-size: 3rem;
  opacity: 0.8;
}

.router-content h4 {
  color: #3b82f6;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.router-content p {
  color: #94a3b8;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.btn-goto-admin {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border: none;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.btn-goto-admin:hover {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Module Badge Styles */
.module-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
}

.module-badge.democracy-health {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.module-badge.surveillance-tracker {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.surveillance-legislative-integration h3 {
  color: #ef4444;
  text-align: center;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.surveillance-quick-add {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.surveillance-form-group {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: end;
}

.surveillance-form-group label {
  color: #f59e0b;
  font-weight: bold;
  margin-bottom: 0.5rem;
  display: block;
}

.surveillance-form-group input,
.surveillance-form-group select,
.surveillance-form-group textarea {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: white;
  padding: 0.75rem;
  border-radius: 6px;
  font-family: inherit;
  transition: all 0.3s ease;
}

.surveillance-form-group input:focus,
.surveillance-form-group select:focus,
.surveillance-form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.surveillance-form-group textarea {
  grid-column: 1 / -1;
  min-height: 100px;
  resize: vertical;
}

.surveillance-analysis-section {
  display: none;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1rem 0;
}

.surveillance-analysis-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.threat-level {
  padding: 0.75rem;
  border-radius: 6px;
  text-align: center;
  font-weight: bold;
}

.threat-level.low { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.threat-level.medium { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.threat-level.high { background: rgba(249, 115, 22, 0.2); color: #f97316; }
.threat-level.critical { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.spider-impact {
  padding: 0.75rem;
  background: rgba(239, 68, 68, 0.2);
  border-radius: 6px;
  text-align: center;
  color: #ef4444;
  font-weight: bold;
}

.surveillance-category {
  padding: 0.75rem;
  background: rgba(59, 130, 246, 0.2);
  border-radius: 6px;
  text-align: center;
  color: #3b82f6;
  font-weight: bold;
}

.matched-keywords {
  margin: 1rem 0;
}

.keywords-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.keyword-tag {
  background: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.9rem;
  border: 1px solid rgba(59, 130, 246, 0.5);
}

.keyword-tag.concerning {
  background: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.5);
}

.china-comparison {
  background: rgba(220, 38, 127, 0.1);
  border: 1px solid rgba(220, 38, 127, 0.3);
  padding: 1rem;
  border-radius: 6px;
  margin-top: 1rem;
}

.china-comparison h5 {
  color: #ec4899;
  margin-bottom: 0.5rem;
}

.tracked-bills-container {
  background: rgba(30, 41, 59, 0.5);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1rem 0;
}

.tracked-bills-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tracked-bill-item {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(75, 85, 99, 0.3);
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.3s ease;
}

.tracked-bill-item:hover {
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
}

.bill-header {
  display: flex;
  justify-content: between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.bill-title {
  font-weight: bold;
  color: #f1f5f9;
  flex-grow: 1;
}

.bill-status {
  background: rgba(59, 130, 246, 0.3);
  color: #3b82f6;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
}

.bill-impact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.impact-type {
  color: #94a3b8;
  font-size: 0.9rem;
}

.impact-score {
  font-weight: bold;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.impact-score.negative {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.impact-score.positive {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.bill-actions {
  display: flex;
  gap: 0.5rem;
}

.bill-actions button {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #3b82f6;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.bill-actions button:hover {
  background: rgba(59, 130, 246, 0.3);
  border-color: rgba(59, 130, 246, 0.5);
}

.surveillance-matrix {
  margin: 2rem 0;
}

.matrix-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.matrix-item {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(75, 85, 99, 0.3);
  border-radius: 8px;
  padding: 1rem;
}

.category-name {
  font-weight: bold;
  color: #f1f5f9;
  margin-bottom: 0.75rem;
}

.progress-comparison {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.progress-bar {
  flex-grow: 1;
  height: 24px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.china-bar {
  height: 100%;
  background: linear-gradient(90deg, #dc2626, #ef4444);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
  position: absolute;
  top: 0;
  left: 0;
}

.current-bar {
  height: 100%;
  background: linear-gradient(90deg, #059669, #10b981);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0.8;
}

.gap-indicator {
  min-width: 80px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: bold;
}

.gap-indicator.behind {
  color: #ef4444;
}

.gap-indicator.ahead {
  color: #22c55e;
}

.no-bills-tracked {
  text-align: center;
  padding: 3rem 2rem;
  color: #94a3b8;
  font-style: italic;
}

.surveillance-bill-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.surveillance-bill-modal .modal-content {
  background: linear-gradient(135deg, rgba(15, 20, 25, 0.95), rgba(26, 32, 44, 0.95));
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  backdrop-filter: blur(10px);
}

.surveillance-bill-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(75, 85, 99, 0.3);
}

.surveillance-bill-modal .close-modal {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

.surveillance-bill-modal .modal-body {
  padding: 1.5rem;
}

.bill-surveillance-info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.keywords-details {
  margin: 1.5rem 0;
}

.keywords-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.keyword-chip {
  background: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  border: 1px solid rgba(59, 130, 246, 0.5);
}

.bill-text-details {
  margin-top: 1.5rem;
}

.bill-text-content {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(75, 85, 99, 0.3);
  border-radius: 8px;
  padding: 1rem;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: 'Courier New', monospace;
  line-height: 1.5;
  color: #e2e8f0;
}

.surveillance-alert {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  color: white;
  font-weight: bold;
  z-index: 10001;
  animation: slideInRight 0.3s ease;
}

.surveillance-alert.success {
  background: linear-gradient(135deg, #059669, #10b981);
  border: 1px solid rgba(16, 185, 129, 0.5);
}

.surveillance-alert.error {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.surveillance-alert.info {
  background: linear-gradient(135deg, #0369a1, #0284c7);
  border: 1px solid rgba(2, 132, 199, 0.5);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive Design for Surveillance Tracking */
@media (max-width: 768px) {
  .surveillance-form-group {
    grid-template-columns: 1fr;
  }
  
  .surveillance-analysis-summary {
    grid-template-columns: 1fr;
  }
  
  .bill-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .bill-impact {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .progress-comparison {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .surveillance-bill-modal .modal-content {
    margin: 1rem;
    max-width: calc(100% - 2rem);
  }
}