/* Koda Console — Custom styles (Tailwind handles most, this covers gaps) */

/* Safe area insets for iPhone notch / home indicator */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Full-height app shell */
html, body { height: 100%; overflow: hidden; }
#app { height: 100%; display: flex; flex-direction: column; }

/* Content area scrolls, tab bar stays fixed */
#content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(4rem + var(--safe-bottom));
}

/* Bottom tab bar respects iPhone home indicator */
#tab-bar {
  padding-bottom: var(--safe-bottom);
  padding-top: 0.5rem;
}

/* Status bar area padding for iPhone notch */
#status-header {
  padding-top: calc(var(--safe-top) + 0.75rem);
}

/* Smooth tab transitions */
.tab-pane { animation: fadeIn 0.15s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Usage progress bars */
.usage-bar {
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: #334155;
}
.usage-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* Status dot pulse animation */
.status-dot-online {
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  animation: pulse-green 2s infinite;
}
.status-dot-offline { background: #ef4444; }
@keyframes pulse-green {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  70%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Message bubbles */
.msg-inbound  { background: #1e293b; border-radius: 12px 12px 12px 2px; }
.msg-outbound { background: #312e81; border-radius: 12px 12px 2px 12px; }

/* Skeleton loading shimmer */
.skeleton {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Danger zone red button */
.btn-danger {
  background: #7f1d1d;
  color: #fca5a5;
  border: 1px solid #991b1b;
}
.btn-danger:hover { background: #991b1b; }

/* Touch feedback */
.touch-feedback { -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2); }

/* Scrollbar styling */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }

/* Toast notifications */
.toast {
  position: fixed;
  top: calc(var(--safe-top) + 1rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  animation: slideDown 0.3s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateX(-50%) translateY(-20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
