/* API Console Styles */

.api-console {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 600px;
  height: 400px;
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-bottom: none;
  border-right: none;
  display: flex;
  flex-direction: column;
  z-index: 9999;
  box-shadow: -4px -4px 20px rgba(0, 0, 0, 0.5);
  font-family: "Courier New", monospace;
  font-size: 12px;
}

.api-console.hidden {
  display: none;
}

.console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #1a1a1a;
  border-bottom: 1px solid #2a2a2a;
}

.console-header h3 {
  margin: 0;
  font-size: 14px;
  color: #4a9eff;
  font-weight: 600;
}

.console-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.console-btn {
  background: transparent;
  border: 1px solid #3a3a3a;
  color: #aaa;
  padding: 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.console-btn:hover {
  background: #2a2a2a;
  border-color: #4a4a4a;
  color: #e0e0e0;
}

.console-checkbox {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #aaa;
  font-size: 11px;
  cursor: pointer;
  user-select: none;
}

.console-checkbox input[type="checkbox"] {
  cursor: pointer;
  accent-color: #4a9eff;
}

.console-close {
  background: transparent;
  border: none;
  color: #888;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  line-height: 1;
  margin-left: 0.5rem;
}

.console-close:hover {
  color: #e0e0e0;
}

.console-logs {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  background: #0a0a0a;
}

.console-log-entry {
  margin-bottom: 0.5rem;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  background: #1a1a1a;
  overflow: hidden;
}

.console-log-entry.console-error {
  border-color: #660000;
  background: #1a0000;
}

.log-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  transition: background 0.2s;
}

.log-header:hover {
  background: #252525;
}

.log-time {
  color: #666;
  font-size: 11px;
  min-width: 70px;
}

.log-method {
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-weight: 600;
  font-size: 10px;
  min-width: 45px;
  text-align: center;
}

.log-method.get {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.log-method.post {
  background: rgba(74, 158, 255, 0.2);
  color: #4a9eff;
}

.log-method.put {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

.log-method.delete {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.log-url {
  flex: 1;
  color: #aaa;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-status {
  font-weight: 600;
  min-width: 40px;
  text-align: center;
}

.log-duration {
  color: #888;
  font-size: 11px;
  min-width: 50px;
  text-align: right;
}

.log-toggle {
  background: transparent;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 0;
  font-size: 12px;
  width: 20px;
  height: 20px;
  line-height: 1;
}

.log-details {
  padding: 0 0.5rem 0.5rem 0.5rem;
  border-top: 1px solid #2a2a2a;
  background: #0a0a0a;
}

.log-details.hidden {
  display: none;
}

.log-section {
  margin-top: 0.5rem;
}

.log-section strong {
  color: #4a9eff;
  display: block;
  margin-bottom: 0.25rem;
  font-size: 11px;
}

.log-section pre {
  background: #000;
  padding: 0.5rem;
  border-radius: 3px;
  overflow-x: auto;
  margin: 0;
  color: #e0e0e0;
  font-size: 11px;
  line-height: 1.4;
  border: 1px solid #1a1a1a;
}

.log-section code {
  background: #2a2a2a;
  padding: 0.15rem 0.3rem;
  border-radius: 3px;
  color: #fbbf24;
}

.log-section div {
  padding: 0.25rem 0;
  color: #aaa;
}

/* Console Toggle Button */
.console-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  transition: all 0.3s;
}

.console-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.6);
}

.console-toggle svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Responsive */
@media (max-width: 768px) {
  .api-console {
    width: 100%;
    height: 300px;
  }

  .console-toggle {
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }
}

/* Scrollbar styling */
.console-logs::-webkit-scrollbar {
  width: 8px;
}

.console-logs::-webkit-scrollbar-track {
  background: #0a0a0a;
}

.console-logs::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 4px;
}

.console-logs::-webkit-scrollbar-thumb:hover {
  background: #3a3a3a;
}
