/**
 * MCP Max Portal Styles
 * Custom styles for the portal interface
 */

/* Base styles */
* {
  box-sizing: border-box;
}

/* Disable Scolling */
body {
  margin: 0;
  height: 100%;
  width: 100%;
  min-height: calc(100vh + 100px);
  overflow: hidden;
  overflow-x: hidden !important;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior: none !important;
  outline: none !important;
}

/* Sidebar animations */
#sidebar-container {
  transition: transform 0.2s ease-in-out;
}

@media (max-width: 1023px) {
  #sidebar-container {
    transform: translateX(-100%);
  }
  
  #sidebar-container:not(.-translate-x-full) {
    transform: translateX(0);
  }
}

/* Mobile overlay */
#sidebar-overlay {
  transition: opacity 0.2s ease-in-out;
}

/* Focus styles */
button:focus,
[role="button"]:focus {
  outline: none !important;
  outline-offset: 2px;
}

button * {
  pointer-events: none !important;
}

/* Loading animations */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Status indicators */
@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

.animate-ping {
  animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Transitions */
.transition-colors {
  transition-property: color, background-color, border-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Navigation active states */
.nav-item-active {
  background-color: #eff6ff;
  color: #1d4ed8;
}

.nav-item-active svg {
  color: #1d4ed8;
}

/* Button variants */
.btn-primary {
  background-color: #3B82F6;
  color: white;
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out;
}

.btn-primary:hover {
  background-color: #2563EB;
}

.btn-primary:focus {
  outline: 2px solid #3B82F6;
  outline-offset: 2px;
}

.btn-secondary {
  background-color: white;
  color: #374151;
  border: 1px solid #D1D5DB;
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.btn-secondary:hover {
  background-color: #F9FAFB;
  border-color: #9CA3AF;
}

button svg, 
button path { 
  pointer-events: none !important; 
}

/* Card styles with professional dark mode */
.card {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  border: 1px solid #E5E7EB;
}

/* Dark mode card styles */
.dark .card {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
}

.card-header {
  padding: 1.5rem 1.5rem 0 1.5rem;
  border-bottom: 1px solid #E5E7EB;
  margin-bottom: 1.5rem;
}

.dark .card-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-body {
  padding: 1.5rem;
}

/* Notification styles */
.notification {
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 0.5rem;
  border-left: 4px solid;
}

.notification-success {
  background-color: #ECFDF5;
  border-color: #10B981;
  color: #065F46;
}

.notification-error {
  background-color: #FEF2F2;
  border-color: #EF4444;
  color: #991B1B;
}

.notification-warning {
  background-color: #FFFBEB;
  border-color: #F59E0B;
  color: #92400E;
}

.notification-info {
  background-color: #EFF6FF;
  border-color: #3B82F6;
  color: #1E40AF;
}

/* Modal styles */
.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  background-color: var(--bg-modal);
  border-radius: 0.5rem;
  max-height: 90vh;
  overflow-y: auto;
}

/* Ensure modal inner content inherits background */
.modal-content > div,
.modal-content .p-6 {
  background-color: transparent !important;
}

/* Form styles */
.form-input {
  appearance: none;
  border-radius: 0.375rem;
  border: 1px solid #D1D5DB;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  width: 100%;
}

.form-input:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-label {
  font-weight: 500;
  font-size: 0.875rem;
  color: #374151;
  margin-bottom: 0.25rem;
  display: block;
}

.form-error {
  color: #EF4444;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Utility classes */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

/* Enhanced Component Styles for Tailwind Fidelity */

.enhanced-shadow {
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}

.dark .enhanced-shadow {
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

.panel-border-accent {
  position: relative;
}

.dark .panel-border-accent::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.1)
  );
}

/* Backdrop blur enhancement */
.panel-backdrop {
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* Enhanced focus states */
.panel-close-btn:focus {
  outline: 2px solid rgb(99 102 241);
  outline-offset: 2px;
}

.dark .panel-close-btn:focus {
  outline-color: rgb(129 140 248);
}

/* Smooth state transitions */
.panel-content {
  transition-property: transform, opacity;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.panel-backdrop {
  transition-property: opacity, backdrop-filter;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive utilities */
@media (min-width: 1024px) {
  .lg\:hidden {
    display: none !important;
  }
}

/* Print styles */
@media print {
  #sidebar-container,
  #header-container button,
  .no-print {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
  }
}