/* CopyrightChains Explorer - Theme Styles */
/* Using theme: #0674bb with grey shades - Same as Portal/Dashboard */

:root {
  /* Primary Colors - Same as Portal/Dashboard */
  --nim-primary: #0674bb;
  --nim-primary-dark: #054d8a;
  --nim-primary-light: #3a92d0;
  
  /* Grey Shades - Same as Portal/Dashboard */
  --grey-900: #1a1a1a;
  --grey-800: #2d2d2d;
  --grey-700: #404040;
  --grey-600: #595959;
  --grey-500: #737373;
  --grey-400: #999999;
  --grey-300: #b3b3b3;
  --grey-200: #d9d9d9;
  --grey-100: #f0f0f0;
  
  /* Functional Colors */
  --white: #ffffff;
  --success: #28a745;
  --warning: #ffc107;
  --error: #dc3545;
  
  /* Typography */
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Courier New', Courier, monospace;
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-xxl: 3rem;
  
  /* Borders */
  --border-radius: 4px;
  --border-radius-lg: 8px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

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

html {
  height: 100%;
}

body {
  min-height: 100vh;
  font-family: var(--font-primary);
  background: linear-gradient(135deg, var(--grey-100) 0%, var(--white) 100%);
  color: var(--grey-800);
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* Fixed Header - Same as Portal/Dashboard */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-bottom: 2px solid var(--nim-primary);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  height: 70px;
}

header .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

header h1 {
  font-size: 1.5rem;
  color: var(--nim-primary);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

header .logo {
  height: 40px;
  width: auto;
}

/* Navigation */
nav {
  display: flex;
  gap: var(--spacing-lg);
}

nav a {
  color: var(--grey-700);
  text-decoration: none;
  font-weight: 500;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius);
  transition: all 150ms ease;
}

nav a:hover {
  color: var(--nim-primary);
  background: var(--grey-100);
}

nav a.active {
  color: var(--nim-primary);
  background: var(--grey-100);
}

/* Main Content Area */
main {
  flex: 1;
  margin-top: 70px;
  margin-bottom: 60px;
  padding: var(--spacing-xxl) var(--spacing-lg);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Search Section */
.search-section {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-lg);
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.search-section h2 {
  color: var(--nim-primary);
  margin-bottom: var(--spacing-sm);
  font-size: 2rem;
}

.search-box {
  display: flex;
  gap: var(--spacing-md);
  max-width: 600px;
  margin: 0 auto;
}

.search-box input {
  flex: 1;
  padding: var(--spacing-md);
  border: 2px solid var(--grey-200);
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: border-color 150ms ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--nim-primary);
}

.search-box button {
  background: var(--nim-primary);
  color: var(--white);
  border: none;
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
}

.search-box button:hover {
  background: var(--nim-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.stat-card {
  background: var(--white);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--nim-primary);
}

.stat-label {
  color: var(--grey-600);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--spacing-xs);
}

.stat-value {
  color: var(--grey-900);
  font-size: 1.5rem;
  font-weight: 700;
}

/* Explorer Grid */
.explorer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

.explorer-card {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-md);
}

.explorer-card h3 {
  color: var(--nim-primary);
  margin-bottom: var(--spacing-md);
  font-size: 1.2rem;
}

/* Data Tables */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: var(--spacing-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: var(--grey-100);
  border-bottom: 2px solid var(--grey-200);
}

.data-table th {
  padding: var(--spacing-sm) var(--spacing-md);
  text-align: left;
  color: var(--grey-700);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 1px solid var(--grey-100);
  color: var(--grey-700);
  font-size: 0.9rem;
}

.data-table tbody tr:hover {
  background: var(--grey-50);
}

.data-table .loading {
  text-align: center;
  color: var(--grey-500);
  padding: var(--spacing-lg);
}

.view-all {
  color: var(--nim-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
}

.view-all:hover {
  text-decoration: underline;
}

/* Copyright Features */
.copyright-features {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--spacing-xl);
}

.copyright-features h3 {
  color: var(--grey-900);
  margin-bottom: var(--spacing-lg);
  font-size: 1.3rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
}

.feature-card {
  background: var(--grey-100);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius);
  border-left: 3px solid var(--nim-primary);
  cursor: pointer;
  transition: all 150ms ease;
  position: relative;
}

.feature-card:hover {
  background: var(--grey-200);
  transform: translateX(4px);
}

.feature-card h4 {
  color: var(--nim-primary);
  margin-bottom: var(--spacing-xs);
}

.feature-card p {
  color: var(--grey-600);
  font-size: 0.9rem;
}

.feature-count {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  background: var(--nim-primary);
  color: var(--white);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Network Info */
.network-info {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-md);
}

.network-info h3 {
  color: var(--grey-900);
  margin-bottom: var(--spacing-lg);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-md);
}

.info-item {
  padding: var(--spacing-md);
  background: var(--grey-100);
  border-radius: var(--border-radius);
}

.info-label {
  color: var(--grey-600);
  font-weight: 600;
  margin-right: var(--spacing-sm);
}

.info-value {
  color: var(--grey-800);
  font-family: var(--font-mono);
}

/* Fixed Footer - Same as Portal/Dashboard */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--grey-900);
  color: var(--white);
  padding: var(--spacing-md) 0;
  text-align: center;
  z-index: 100;
  height: 60px;
  display: flex;
  align-items: center;
}

footer .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

footer p {
  margin: 0;
  color: var(--grey-300);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  gap: var(--spacing-lg);
}

.footer-links a {
  color: var(--grey-300);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 150ms ease;
}

.footer-links a:hover {
  color: var(--white);
}

/* Hash/Address Display */
.hash {
  font-family: var(--font-mono);
  color: var(--nim-primary);
  text-decoration: none;
  font-size: 0.85rem;
}

.hash:hover {
  text-decoration: underline;
}

.address {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  header .container {
    flex-direction: column;
    height: auto;
    padding: var(--spacing-md);
  }
  
  header {
    height: auto;
  }
  
  nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  main {
    margin-top: 120px;
  }
  
  .explorer-grid {
    grid-template-columns: 1fr;
  }
  
  .search-box {
    flex-direction: column;
  }
  
  .search-box input,
  .search-box button {
    width: 100%;
  }
}

/* Loading Animation */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--grey-300);
  border-top-color: var(--nim-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
/* Tabbed Layout */
.tabs-container {
    margin: 20px 0;
}

.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #374151;
}

.tab-button {
    padding: 12px 24px;
    background: transparent;
    color: #9ca3af;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
}

.tab-button:hover {
    color: #0674bb;
}

.tab-button.active {
    color: #0674bb;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #0674bb;
}

.tab-content {
    animation: fadeIn 0.3s;
}

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

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 24, 39, 0.5);
    backdrop-filter: blur(8px);
}

.modal-content {
    background: #f9fafb;
    border: 2px solid #0674bb;
    border-radius: 12px;
    margin: 5% auto;
    padding: 30px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s;
    box-shadow: 0 20px 60px rgba(6, 116, 187, 0.3);
}

.modal-close {
    color: #6b7280;
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 20px;
}

.modal-close:hover {
    color: #0674bb;
}

#modalTitle {
    color: #0674bb;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
}

.modal-body {
    color: #374151;
}

.modal-body .detail-row {
    display: flex;
    padding: 14px 0;
    border-bottom: 1px solid #e5e7eb;
}

.modal-body .detail-row:last-child {
    border-bottom: none;
}

.modal-body .detail-label {
    flex: 0 0 150px;
    font-weight: 600;
    color: #6b7280;
    font-size: 14px;
}

.modal-body .detail-value {
    flex: 1;
    color: #111827;
    word-break: break-all;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.modal-body .detail-value.hash {
    color: #0674bb;
    font-weight: 500;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Make block and tx links clickable */
.data-table a {
    color: #0674bb;
    text-decoration: none;
    cursor: pointer;
}

.data-table a:hover {
    text-decoration: underline;
}

/* Fix table spacing */
.data-table {
    width: 100%;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
}
