/*!
 * Kennis Debug Panel Styles
 * Standalone version with hardcoded colors
 * Version: 2.0.0
 */

.ks-debug-panel {
  position: fixed;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
}

/* Position variants */
.ks-debug-panel[data-position="bottom-right"] {
  bottom: 20px;
  right: 20px;
}

.ks-debug-panel[data-position="bottom-left"] {
  bottom: 20px;
  left: 20px;
}

.ks-debug-panel[data-position="top-right"] {
  top: 20px;
  right: 20px;
}

.ks-debug-panel[data-position="top-left"] {
  top: 20px;
  left: 20px;
}

/* Collapsed button */
.ks-debug-panel__button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #bb0e6d, #3d14b8);
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ks-debug-panel__button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.ks-debug-panel__button:active {
  transform: scale(0.95);
}

.ks-debug-panel__button i {
  animation: pulse 2s infinite;
}

/* Expanded panel */
.ks-debug-panel__panel {
  position: absolute;
  top: 70px;
  right: 0;
  width: 450px;
  max-height: 600px;
  background: #1a1827;
  border: 1px solid #625f6c;
  border-radius: 0.55rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  animation: slideDown 0.3s ease;
}

.ks-debug-panel[data-position="bottom-right"] .ks-debug-panel__panel,
.ks-debug-panel[data-position="bottom-left"] .ks-debug-panel__panel {
  top: auto;
  bottom: 70px;
  animation: slideUp 0.3s ease;
}

.ks-debug-panel[data-position="bottom-left"] .ks-debug-panel__panel,
.ks-debug-panel[data-position="top-left"] .ks-debug-panel__panel {
  right: auto;
  left: 0;
}

/* Header */
.ks-debug-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #2d2b38;
  background: #1a1827;
  border-radius: 0.55rem 0.55rem 0 0;
}

.ks-debug-panel__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #f8f8fa;
  display: flex;
  align-items: center;
}

.ks-debug-panel__title i {
  color: #f257ac;
}

.ks-debug-panel__close {
  background: none;
  border: none;
  color: #bcbac0;
  font-size: 18px;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.325rem;
  transition: all 0.2s;
}

.ks-debug-panel__close:hover {
  background: #2d2b38;
  color: #f8f8fa;
}

/* Tabs */
.ks-debug-panel__tabs {
  display: flex;
  border-bottom: 1px solid #2d2b38;
  background: #1a1827;
  overflow-x: auto;
}

.ks-debug-panel__tab {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  background: none;
  color: #bcbac0;
  font-size: 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.ks-debug-panel__tab i {
  font-size: 14px;
}

.ks-debug-panel__tab:hover {
  background: #2d2b38;
  color: #f8f8fa;
}

.ks-debug-panel__tab.active {
  color: #f257ac;
  border-bottom-color: #f257ac;
  background: #2d2b38;
}

/* Content area */
.ks-debug-panel__content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #1a1827;
  border-radius: 0 0 0.55rem 0.55rem;
  max-height: 450px;
}

/* Section */
.ks-debug-panel__section:not(:last-child) {
  margin-bottom: 1.5rem;
}

.ks-debug-panel__section-title {
  font-size: 14px;
  font-weight: 600;
  color: #e9e8ea;
  margin: 0 0 0.75rem 0;
}

/* Table */
.ks-debug-panel__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.ks-debug-panel__table tr {
  border-bottom: 1px solid #2d2b38;
}

.ks-debug-panel__table tr:last-child {
  border-bottom: none;
}

.ks-debug-panel__table td {
  padding: 0.5rem 0;
  vertical-align: top;
}

.ks-debug-panel__table-label {
  color: #bcbac0;
  font-weight: 500;
  width: 40%;
  padding-right: 1rem;
}

.ks-debug-panel__table-value {
  color: #e9e8ea;
  word-break: break-word;
  font-family: 'Courier New', monospace;
}

/* Datastore */
.ks-debug-panel__datastore {
  background: #1a1827;
  border: 1px solid #2d2b38;
  border-radius: 0.45rem;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.ks-debug-panel__datastore:last-child {
  margin-bottom: 0;
}

.ks-debug-panel__datastore-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #2d2b38;
  border-bottom: 1px solid #625f6c;
}

.ks-debug-panel__datastore-header strong {
  color: #f8f8fa;
  font-size: 13px;
}

.ks-debug-panel__datastore-body {
  padding: 0.75rem 1rem;
  max-height: 200px;
  overflow-y: auto;
}

.ks-debug-panel__datastore-body pre {
  margin: 0;
  font-size: 11px;
  color: #d2d1d5;
  font-family: 'Courier New', monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Badge */
.ks-debug-panel__badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.325rem;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #2d2b38;
  color: #d2d1d5;
}

.ks-debug-panel__badge--get {
  background: #0d6efd;
  color: white;
}

.ks-debug-panel__badge--post {
  background: #198754;
  color: white;
}

.ks-debug-panel__badge--put,
.ks-debug-panel__badge--patch {
  background: #fd7e14;
  color: white;
}

.ks-debug-panel__badge--delete {
  background: #dc3545;
  color: white;
}

.ks-debug-panel__badge--success {
  background: #198754;
  color: white;
}

.ks-debug-panel__badge--error {
  background: #dc3545;
  color: white;
}

.ks-debug-panel__badge--info {
  background: #0dcaf0;
  color: #000;
}

.ks-debug-panel__badge--log {
  background: #625f6c;
  color: #d2d1d5;
}

.ks-debug-panel__badge--warn {
  background: #dd7e0a;
  color: white;
}

.ks-debug-panel__badge--datastore {
  background: #bb0e6d;
  color: white;
}

.ks-debug-panel__badge--value {
  background: #3d14b8;
  color: white;
}

.ks-debug-panel__badge--form {
  background: #0d6efd;
  color: white;
}

.ks-debug-panel__badge--component {
  background: #625f6c;
  color: #d2d1d5;
}

/* Time and timestamp */
.ks-debug-panel__time {
  font-size: 11px;
  color: #a5a3ab;
  font-family: 'Courier New', monospace;
}

.ks-debug-panel__timestamp {
  font-size: 10px;
  color: #8f8c96;
  font-family: 'Courier New', monospace;
  margin-left: auto;
}

/* Empty state */
.ks-debug-panel__empty {
  color: #a5a3ab;
  text-align: center;
  padding: 2rem 1rem;
  font-style: italic;
}

/* Scrollbar styling */
.ks-debug-panel__content::-webkit-scrollbar,
.ks-debug-panel__datastore-body::-webkit-scrollbar {
  width: 8px;
}

.ks-debug-panel__content::-webkit-scrollbar-track,
.ks-debug-panel__datastore-body::-webkit-scrollbar-track {
  background: #1a1827;
}

.ks-debug-panel__content::-webkit-scrollbar-thumb,
.ks-debug-panel__datastore-body::-webkit-scrollbar-thumb {
  background: #625f6c;
  border-radius: 4px;
}

.ks-debug-panel__content::-webkit-scrollbar-thumb:hover,
.ks-debug-panel__datastore-body::-webkit-scrollbar-thumb:hover {
  background: #787681;
}

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

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .ks-debug-panel__panel {
    width: calc(100vw - 40px);
    max-width: 450px;
  }
}
