/* Moonscan-inspired Design System */
:root {
  /* Primary Colors */
  --primary-blue: #2563eb;
  --primary-blue-light: #60a5fa;
  --primary-blue-dark: #1d4ed8;
  --primary-purple: #8B5CF6;
  
  /* Background Colors */
  --bg-main: #F8FAFC;
  --bg-secondary: #F8FAFC;
  --bg-tertiary: #F1F5F9;
  --bg-card: #FFFFFF;
  --bg-header: #FFFFFF;
  --bg-sidebar: #F8FAFC;
  
  /* Text Colors */
  --text-main: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --text-accent: #3B82F6;
  
  /* Accent Colors */
  --accent-green: #10B981;
  --accent-red: #EF4444;
  --accent-yellow: #F59E0B;
  --accent-purple: #8B5CF6;
  
  /* Border Colors */
  --border-primary: #E2E8F0;
  --border-secondary: #CBD5E1;
  --border-accent: #3B82F6;
  
  /* Shadow Colors */
  --shadow-light: rgba(0, 0, 0, 0.05);
  --shadow-medium: rgba(0, 0, 0, 0.1);
  --shadow-heavy: rgba(0, 0, 0, 0.15);
  --shadow-card: 0 2px 8px rgba(16, 30, 54, 0.06);
  
  /* Gradient Colors */
  --gradient-primary: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%);
  --gradient-secondary: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
  --gradient-accent: linear-gradient(135deg, #10B981 0%, #34D399 100%);
  --gradient-purple: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%);
  
  /* Border Radius */
  --border-radius: 12px;
}

/* Global Styles */
* {
  box-sizing: border-box;
}

body {
  background: linear-gradient(135deg, #f8fafc 0%, #e3ecf7 100%) !important;
  color: var(--text-main) !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Override Semantic UI default colors */
.ui {
  color: var(--text-main) !important;
}

.ui * {
  color: inherit;
}

/* Layout Structure */
.app-container {
  min-height: 100vh;
  background: var(--bg-main);
}

/* Header Styling */
.app-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-primary);
  box-shadow: 0 1px 3px var(--shadow-light);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-main);
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-img {
  height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
  margin-right: 12px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  font-size: 0.9rem;
}

.header-nav a:hover {
  color: var(--text-main);
}

.header-nav a.active {
  color: var(--primary-blue-light);
}

/* Search Bar */
.search-container {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  padding: 1.5rem 0;
}

.search-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  color: var(--text-main);
}

.search-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.search-input {
  position: relative;
  max-width: 600px;
}

.search-input input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 2px solid var(--border-primary);
  border-radius: 12px;
  font-size: 1rem;
  background: var(--bg-main);
  color: var(--text-main);
  transition: all 0.3s ease;
}

.search-input input:focus {
  outline: none;
  border-color: var(--primary-blue-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.2rem;
}

/* Main Content */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  color: var(--text-main);
}

.content-header {
  margin-bottom: 2rem;
}

.content-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.content-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Card Styling */
.ui.card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
  color: var(--text-main) !important;
  overflow: hidden;
}

.ui.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-medium);
  border-color: var(--border-secondary) !important;
}

.ui.card .content {
  background: transparent !important;
  color: var(--text-main) !important;
  padding: 1.5rem;
}

.ui.card .header {
  color: var(--text-main) !important;
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.ui.card .meta {
  color: var(--text-secondary) !important;
  font-size: 0.9rem;
}

.ui.card .description {
  color: var(--text-secondary) !important;
  margin-top: 1rem;
}

/* Button Styling */
.ui.button {
  background: var(--gradient-primary) !important;
  color: var(--bg-main) !important;
  border: none !important;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px var(--shadow-light);
  font-size: 0.9rem;
}

.ui.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--shadow-medium);
  background: var(--primary-blue-dark) !important;
  color: var(--bg-main) !important;
}

.ui.button:disabled {
  background: var(--bg-tertiary) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed !important;
  opacity: 0.6 !important;
  transform: none !important;
  box-shadow: none !important;
}

.ui.button:disabled:hover {
  transform: none !important;
  box-shadow: none !important;
  background: var(--bg-tertiary) !important;
  color: var(--text-muted) !important;
}

.ui.button.primary {
  background: var(--primary-blue) !important;
  color: #fff !important;
  border-radius: var(--border-radius);
}

.ui.button.primary:hover {
  background: var(--primary-blue-dark) !important;
}

.ui.button.primary:disabled {
  background: var(--bg-tertiary) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed !important;
  opacity: 0.6 !important;
}

.ui.button.primary:disabled:hover {
  background: var(--bg-tertiary) !important;
  color: var(--text-muted) !important;
}

.ui.button.secondary {
  background: var(--bg-tertiary) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-primary) !important;
}

.ui.button.secondary:disabled {
  background: var(--bg-tertiary) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed !important;
  opacity: 0.6 !important;
}

.ui.button.success {
  background: var(--gradient-accent) !important;
  color: var(--bg-main) !important;
}

.ui.button.success:disabled {
  background: var(--bg-tertiary) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed !important;
  opacity: 0.6 !important;
}

.ui.button.danger {
  background: var(--accent-red) !important;
  color: var(--bg-main) !important;
}

.ui.button.danger:disabled {
  background: var(--bg-tertiary) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed !important;
  opacity: 0.6 !important;
}

.ui.button.small {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

/* Input Styling */
.ui.input input {
  background: var(--bg-main) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 8px;
  color: var(--text-main) !important;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.ui.input input:focus {
  border-color: var(--primary-blue-light) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
  color: var(--text-main) !important;
}

.ui.input input::placeholder {
  color: var(--text-muted) !important;
}

/* Dropdown Styling */
.ui.dropdown {
  background: var(--bg-main) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 8px;
  color: var(--text-main) !important;
}

.ui.dropdown .menu {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow-medium);
}

.ui.dropdown .menu .item {
  color: var(--text-main) !important;
  transition: background 0.2s ease;
  padding: 0.75rem 1rem;
}

.ui.dropdown .menu .item:hover {
  background: var(--bg-tertiary) !important;
  color: var(--text-main) !important;
}

.ui.dropdown .text {
  color: var(--text-main) !important;
}

/* Table Styling */
.ui.table {
  background: var(--bg-card) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 12px;
  overflow: hidden;
  margin: 0;
}

.ui.table th {
  background: var(--bg-tertiary) !important;
  color: var(--text-main) !important;
  border-bottom: 1px solid var(--border-primary) !important;
  font-weight: 600;
  padding: 1rem;
  font-size: 0.9rem;
}

.ui.table td {
  border-bottom: 1px solid var(--border-primary) !important;
  color: var(--text-main) !important;
  padding: 1rem;
  font-size: 0.9rem;
}

.ui.table tr:hover {
  background: var(--bg-tertiary) !important;
}

/* Statistics Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px var(--shadow-light);
}

.stat-card:hover {
  border-color: var(--border-secondary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-medium);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-blue) !important;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-secondary) !important;
  font-size: 0.95rem;
  font-weight: 500;
}

.stat-change {
  display: flex;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.stat-change.positive {
  color: var(--accent-green);
}

.stat-change.negative {
  color: var(--accent-red);
}

/* Message Styling */
.ui.message {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 12px;
  color: var(--text-main) !important;
  padding: 1rem 1.5rem;
}

.ui.message .header {
  color: var(--text-main) !important;
  font-weight: 600;
}

.ui.message .content {
  color: var(--text-main) !important;
}

.ui.message.negative {
  background: rgba(239, 68, 68, 0.05) !important;
  border-color: var(--accent-red) !important;
  color: var(--accent-red) !important;
}

.ui.message.positive {
  background: rgba(16, 185, 129, 0.05) !important;
  border-color: var(--accent-green) !important;
  color: var(--accent-green) !important;
}

.ui.message.warning {
  background: rgba(245, 158, 11, 0.05) !important;
  border-color: var(--accent-yellow) !important;
  color: var(--accent-yellow) !important;
}

/* Form Styling */
.ui.form .field > label {
  color: var(--text-main) !important;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.ui.form .field .ui.input input {
  background: var(--bg-main) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-primary) !important;
}

.ui.form .field .ui.input input:focus {
  border-color: var(--primary-blue-light) !important;
  color: var(--text-main) !important;
}

/* Segment Styling */
.ui.segment {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-primary) !important;
  color: var(--text-main) !important;
  border-radius: 12px;
  padding: 1.5rem;
}

.ui.segment .header {
  color: var(--text-main) !important;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Label Styling */
.ui.label {
  background: var(--bg-tertiary) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 6px;
  font-weight: 500;
}

/* List Styling */
.ui.list .item {
  color: var(--text-main) !important;
  padding: 0.5rem 0;
}

.ui.list .item .header {
  color: var(--text-main) !important;
  font-weight: 600;
}

.ui.list .item .description {
  color: var(--text-secondary) !important;
  font-size: 0.9rem;
}

/* Loader Styling */
.ui.dimmer {
  background: rgba(255, 255, 255, 0.9) !important;
}

.ui.loader {
  color: var(--primary-blue-light) !important;
}

/* Statistics */
.ui.statistic .value {
  color: var(--text-main) !important;
  font-weight: 700;
}

.ui.statistic .label {
  color: var(--text-secondary) !important;
}

/* Account Selector Styling */
.account-selector {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px var(--shadow-light);
}

.account-selector .header {
  color: var(--text-main);
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.account-selector .ui.dropdown {
  width: 100%;
  margin-bottom: 1rem;
}

.account-selector .ui.button {
  width: 100%;
  margin-top: 0.5rem;
}

/* Specific Component Overrides */
.github-fork-ribbon.right-bottom:before {
  background-color: var(--primary-blue) !important;
}

.ui.statistic.block_number > .value {
  font-size: 2.4rem !important;
  line-height: 4rem !important;
  color: var(--primary-blue-light) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    padding: 1rem;
  }
  
  .header-nav {
    display: none;
  }
  
  .search-content {
    padding: 0 1rem;
  }
  
  .main-content {
    padding: 1rem;
  }
  
  .content-title {
    font-size: 1.5rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .ui.button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: var(--border-primary);
}

/* Focus States */
*:focus {
  outline: 2px solid var(--primary-blue-light);
  outline-offset: 2px;
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-up {
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
