/* IDEAL CONNECTA - CSS MODERNO v3.0 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  background: linear-gradient(135deg, #1a365d 0%, #2d3748 25%, #1a202c 75%, #2a69ac 100%) !important;
  color: #ffffff !important;
  overflow: hidden;
  min-height: 100vh;
}

.main-container {
  display: flex;
  height: 100vh;
  backdrop-filter: blur(10px);
}

/* Sidebar Styles */
.sidebar {
  width: 320px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar h2 {
  padding: 25px 20px 15px;
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #3182ce 0%, #00a8cc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Instance Selector */
.instance-selector {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.instance-selector select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.instance-selector select:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.instance-selector select:focus {
  outline: none;
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.2);
}

.instance-selector select option {
  background: #2a2d47;
  color: #ffffff;
}

/* Conversations List */
.conversations-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}

.conversations-list::-webkit-scrollbar {
  width: 6px;
}

.conversations-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.conversations-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.conversations-list ul {
  list-style: none;
}

.conversation-item {
  margin: 2px 10px;
}

.conversation-item a {
  display: block;
  padding: 16px 20px;
  color: #ffffff;
  text-decoration: none;
  border-radius: 12px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.conversation-item a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.conversation-item a:hover::before {
  left: 100%;
}

.conversation-item a:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.conversation-name {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
}

.conversation-time {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
}

/* Chat Container */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
}

.chat-header {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
  backdrop-filter: blur(20px);
  padding: 25px 30px;
  font-size: 20px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.chat-header strong {
  background: linear-gradient(135deg, #3182ce 0%, #00a8cc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Chat Area */
.chat-area {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.05) 100%);
}

.chat-area::-webkit-scrollbar {
  width: 8px;
}

.chat-area::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.chat-area::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.chat-area::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* Chat Bubbles */
.chat-bubble {
  max-width: 70%;
  padding: 16px 20px;
  border-radius: 20px;
  word-wrap: break-word;
  position: relative;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: slideIn 0.3s ease-out;
  line-height: 1.5;
  font-size: 15px;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-left {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.1) 100%);
  align-self: flex-start;
  border-bottom-left-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.chat-right {
  background: linear-gradient(135deg, #3182ce 0%, #2b77cb 50%, #00a8cc 100%);
  align-self: flex-end;
  border-bottom-right-radius: 8px;
  box-shadow: 0 4px 15px rgba(49, 130, 206, 0.3);
  color: #ffffff;
}

.chat-bubble::before {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  bottom: 0;
}

.chat-left::before {
  left: -8px;
  border-left: 8px solid transparent;
  border-right: 8px solid rgba(255, 255, 255, 0.15);
  border-bottom: 8px solid rgba(255, 255, 255, 0.15);
  border-top: 8px solid transparent;
}

.chat-right::before {
  right: -8px;
  border-left: 8px solid #3182ce;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #3182ce;
  border-top: 8px solid transparent;
}

.timestamp {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 8px;
  text-align: right;
  font-weight: 400;
  letter-spacing: 0.5px;
}

.chat-right .timestamp {
  color: rgba(255, 255, 255, 0.8);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  opacity: 0.7;
}

.empty-state h3 {
  font-size: 24px;
  margin-bottom: 10px;
  font-weight: 600;
}

.empty-state p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
}

/* Hover Effects */
.chat-bubble:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.chat-right:hover {
  box-shadow: 0 6px 25px rgba(49, 130, 206, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
  .main-container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: 200px;
    order: 2;
  }
  
  .chat-container {
    order: 1;
  }
  
  .chat-bubble {
    max-width: 85%;
  }
}