/* OpenDLT Component System */

/* Tab System */
.tab-nav {
  display: flex;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 20px;
  border: 1px solid rgba(14, 165, 233, 0.2);
}

.tab-btn {
  flex: 1;
  padding: 12px 20px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  position: relative;
}

.tab-btn:hover {
  background: rgba(14, 165, 233, 0.1);
  color: var(--primary-color);
}

.tab-btn.active {
  background: var(--primary-color);
  color: var(--background-color);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.tab-content {
  display: none;
  animation: fadeInUp 0.5s ease-out;
}

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

/* Code Block Component */
.code-block {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  position: relative;
  overflow-x: auto;
}

.code-block::before {
  content: attr(data-language);
  position: absolute;
  top: 8px;
  right: 12px;
  background: var(--primary-color);
  color: var(--background-color);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.code-block pre {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
}

.code-block .comment {
  color: #6b7280;
}

.code-block .keyword {
  color: #a78bfa;
}

.code-block .string {
  color: #34d399;
}

.code-block .function {
  color: #60a5fa;
}

/* Copy Button */
.copy-btn {
  position: absolute;
  top: 12px;
  right: 60px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

/* Card Component */
.card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(14, 165, 233, 0.4);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.card-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.card-icon {
  width: 24px;
  height: 24px;
  margin-right: 12px;
  color: var(--primary-color);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.card-description {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

/* Button Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* Icon Components */
.icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 32px; height: 32px; }

/* Badge Component */
.badge {
  display: inline-block;
  padding: 4px 8px;
  background: rgba(14, 165, 233, 0.2);
  color: var(--primary-color);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.badge-warning {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

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

.progress-fill {
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  height: 100%;
  border-radius: 8px;
  transition: width 0.3s ease;
}

/* Modal Component */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--background-color);
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal.active .modal-content {
  transform: scale(1);
}

/* Tooltip Component */
.tooltip {
  position: relative;
  cursor: help;
}

.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 100;
}

.tooltip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.tooltip:hover::before,
.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-5px);
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid rgba(14, 165, 233, 0.3);
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Accordion Component */
.accordion-item {
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}

.accordion-header {
  background: rgba(15, 23, 42, 0.5);
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s ease;
}

.accordion-header:hover {
  background: rgba(15, 23, 42, 0.8);
}

.accordion-content {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.accordion-item.active .accordion-content {
  padding: 20px;
  max-height: 500px;
}

.accordion-icon {
  transform: rotate(0deg);
  transition: transform 0.3s ease;
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
}

/* Dropdown Component */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--background-color);
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 8px;
  min-width: 200px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 100;
}

.dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s ease;
}

.dropdown-item:hover {
  background: rgba(14, 165, 233, 0.1);
  color: var(--primary-color);
}

/* Mobile Responsive Components */
@media (max-width: 768px) {
  .tab-nav {
    flex-direction: column;
  }

  .tab-btn {
    margin-bottom: 4px;
  }

  .code-block {
    padding: 16px;
    font-size: 12px;
  }

  .card {
    padding: 16px;
  }

  .modal-content {
    padding: 16px;
    margin: 20px;
  }
}