/**
 * BITCORE Design System - Additional Utilities
 * Complements style.css with component utilities
 *
 * @package BITCORE_Theme
 * @version 1.0.0
 */

/* =================================================================
   UTILITY CLASSES
   ================================================================= */

/* Display */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* Flexbox */
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }

/* Text */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-accent { color: var(--accent); }
.font-mono { font-family: var(--font-mono); }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Spacing */
.m-0 { margin: 0; }
.m-auto { margin: auto; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.p-0 { padding: 0; }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }

/* Sizing */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }
.max-w-sm { max-width: 640px; }
.max-w-md { max-width: 768px; }
.max-w-lg { max-width: 1024px; }
.max-w-xl { max-width: 1280px; }

/* Border */
.border { border: 1px solid var(--border); }
.border-0 { border: none; }
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-y-auto { overflow-y: auto; }
.overflow-x-auto { overflow-x: auto; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { inset: 0; }
.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

/* Transitions */
.transition { transition: all var(--transition-base); }
.transition-fast { transition: all var(--transition-fast); }

/* =================================================================
   COMPONENT EXTENSIONS
   ================================================================= */

/* Section Title */
.bitcore-section__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

/* Sidebar Brand */
.bitcore-sidebar__brand {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--primary);
}

.bitcore-sidebar__header {
  padding: var(--space-5);
  border-bottom: 1px solid var(--border);
  gap: var(--space-3);
}

.bitcore-sidebar__footer {
  padding: var(--space-4);
  margin-top: auto;
  border-top: 1px solid var(--border);
}

.bitcore-sidebar__version {
  color: var(--text-muted);
  text-align: center;
}

/* Footer */
.bitcore-footer {
  padding: var(--space-6);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.bitcore-footer__content {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.bitcore-footer__copyright {
  color: var(--text-muted);
}

/* Feed Item */
.bitcore-feed__icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.bitcore-feed__content {
  flex: 1;
  color: var(--text-primary);
}

/* Form Styles */
.bitcore-form {
  background: var(--surface);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.bitcore-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-8);
}

/* Loading States */
.bitcore-loading {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
}

.bitcore-loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty State */
.bitcore-empty {
  text-align: center;
  padding: var(--space-8);
  color: var(--text-secondary);
}

.bitcore-empty__icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

/* Toast Notifications */
.bitcore-toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-tooltip);
  animation: slideIn 0.3s ease;
}

.bitcore-toast--success { border-left: 3px solid var(--success); }
.bitcore-toast--error { border-left: 3px solid var(--error); }
.bitcore-toast--warning { border-left: 3px solid var(--warning); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Badge */
.bitcore-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  background: var(--surface-active);
  color: var(--text-secondary);
}

.bitcore-badge--primary { background: rgba(99, 102, 241, 0.15); color: var(--primary); }
.bitcore-badge--success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.bitcore-badge--warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.bitcore-badge--error { background: rgba(239, 68, 68, 0.15); color: var(--error); }

/* Progress Bar */
.bitcore-progress {
  width: 100%;
  height: 8px;
  background: var(--surface-active);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.bitcore-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}

/* Avatar */
.bitcore-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
}

.bitcore-avatar--sm { width: 24px; height: 24px; font-size: 0.75rem; }
.bitcore-avatar--lg { width: 48px; height: 48px; font-size: 1.25rem; }
.bitcore-avatar--xl { width: 64px; height: 64px; font-size: 1.5rem; }

/* Divider */
.bitcore-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-4) 0;
}

/* Tooltip */
.bitcore-tooltip {
  position: relative;
}

.bitcore-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 0.75rem;
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  z-index: var(--z-tooltip);
}

.bitcore-tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}

/* =================================================================
   RESPONSIVE UTILITIES
   ================================================================= */

@media (max-width: 1024px) {
  .lg\:hidden { display: none !important; }
  .lg\:block { display: block !important; }
}

@media (max-width: 768px) {
  .md\:hidden { display: none !important; }
  .md\:block { display: block !important; }
  .md\:flex-col { flex-direction: column !important; }
  .md\:gap-4 { gap: var(--space-4) !important; }
}

@media (max-width: 640px) {
  .sm\:hidden { display: none !important; }
  .sm\:block { display: block !important; }
  .sm\:text-center { text-align: center !important; }
}

/* Print Styles */
@media print {
  .bitcore-sidebar,
  .bitcore-topbar,
  .bitcore-chat__input {
    display: none !important;
  }
  
  .bitcore-main {
    padding: 0;
  }
  
  body {
    background: #fff;
    color: #000;
  }
}
