/* React-specific fixes and enhancements */

/* Remove blue outline from all buttons and interactive elements */
button,
button:focus,
button:active,
input:focus,
input:active,
textarea:focus,
textarea:active,
a:focus,
a:active,
[role="button"]:focus,
[role="button"]:active {
  outline: none !important;
  box-shadow: none !important;
}

/* Ensure proper height for React root */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

#root {
  height: 100%;
}

/* Reset any conflicting flex styles */
body {
  display: block !important;
  place-items: initial !important;
}

#tooltip {
  transition: opacity 0.3s ease;
}

#tooltip.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Ensure modals work properly with React */
.modal {
  display: none;
}

.modal.active {
  display: flex;
}

.overlay {
  display: none;
}

.overlay.active {
  display: block;
}

/* Chat settings dropdown */
.set-block {
  display: none;
}

.set-block.open {
  display: block;
}

/* Removed burger menu logic - sidebar is now always visible */

/* Ensure the chat list is scrollable */
.custom-scroll {
  overflow-y: auto;
  max-height: calc(100vh - 150px);
}

/* Fix for chat page layout */
.chat-page {
  height: 100vh;
  overflow: hidden;
}

.chat-page .page-holder {
  height: 100%;
}

.chat-page .page-holder .page-inner {
  height: 100%;
}

/* Message auto-scroll */
.chat-w-inner {
  overflow-y: auto;
  scroll-behavior: smooth;
}

/* Simple Modal Styling - No animations, minimalistic */
.modal {
  z-index: 1000;
}

/* Ensure modals display properly in React */
.modal.active {
  display: block;
}

.modal-description {
  margin: 0 0 17px 0;
  color: #000;
  line-height: 1.5;
  font-size: 14px;
  font-family: var(--font-family);
}

/* Override button styles to match original design */
.modal .button-input {
  background: #907aff;
  color: #fff;
  border: 1px solid #907aff;
  border-radius: 17px;
  cursor: pointer;
}

.modal .button-input:hover {
  background-color: transparent;
  color: #000 !important;
}

.button-secondary {
  background: #fff !important;
  border: 1px solid #907aff !important;
  color: #000 !important;
}

.button-secondary:hover {
  background-color: #907aff !important;
  color: #fff !important;
}

/* Simple overlay - no blur, no animations */
.overlay {
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 999;
}

/* Fix for chat sidebar - always visible, no slider behavior */
@media (max-width: 950px) {
  .chat-page .page-holder .page-inner .chat-body .chat-center .chat-user {
    margin-left: 0 !important;
    position: relative !important;
  }

  .chat-page .page-holder .page-inner .chat-body .chat-center .chat-user .burger_btn {
    display: none !important;
  }

  .chat-page .page-holder .page-inner .chat-body .chat-center .chat-user::before {
    display: none !important;
  }

  /* Make chat area take remaining space */
  .chat-page .page-holder .page-inner .chat-body .chat-center {
    display: flex !important;
  }

  .chat-page .page-holder .page-inner .chat-body .chat-center .chat-holder {
    flex: 1 !important;
    min-width: 0 !important;
  }
}

@media (max-width: 768px) {
  .chat-page .page-holder .page-inner .chat-body .chat-center .chat-user {
    margin-left: 0 !important;
  }

  .chat-page .page-holder .page-inner .chat-body .chat-center .chat-user .burger_btn {
    display: none !important;
  }
}

@media (max-width: 576px) {
  .chat-page .page-holder .page-inner .chat-body .chat-center .chat-user {
    margin-left: 0 !important;
    min-width: 200px !important;
    max-width: 250px !important;
  }

  .chat-page .page-holder .page-inner .chat-body .chat-center .chat-user .burger_btn {
    display: none !important;
  }
}

/* Fast custom tooltips */
.tooltip-container {
  position: relative;
}

.custom-tooltip {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease, transform 0.1s ease;
  z-index: 1000;
}

.tooltip-container:hover .custom-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Fix for chat title editing in header */
.chat-name input.chat-name-input {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 9999 !important;
  width: 250px !important;
  height: auto !important;
  min-height: 35px !important;
}

/* Full width layout - remove max-width restrictions */
.page-holder {
  max-width: none !important;
  padding: 0 !important;
}

.page-inner {
  max-width: none !important;
  padding: 0 !important;
}

.chat-body {
  max-width: none !important;
  width: 100% !important;
}

.chat-center {
  max-width: none !important;
  width: 100% !important;
}

/* Remove excessive padding from chat containers */
.chat-holder {
  padding: 0 !important;
}

.chat-w {
  max-width: none !important;
  width: 100% !important;
}

/* Sidebar width adjustments for full screen */
.chat-user {
  min-width: 280px !important;
  max-width: 320px !important;
  flex-shrink: 0 !important;
}

/* Chat area takes remaining space */
.chat-w {
  flex: 1 !important;
  min-width: 0 !important;
}

/* Fix chat holder to use full height and proper flex layout */
.chat-holder {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}

.chat-window {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  flex: 1 !important;
}

/* Message area scrolls, taking remaining space */
.chat-w-inner {
  flex: 1 !important;
  overflow-y: auto !important;
  min-height: 0 !important;
}

/* Message input area sticks to bottom */
.chat-w-bottom {
  flex-shrink: 0 !important;
  margin-top: auto !important;
}

/* Ensure chat-w uses proper flex layout */
.chat-w {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}

/* Fix for chat-center to use full height */
.chat-center {
  display: flex !important;
  flex-direction: row !important;
  height: 100vh !important;
}

/* Fix for chat-body to use full height */
.chat-body {
  display: flex !important;
  height: 100vh !important;
}
