/* Container for entire component */
.sms-component-wrapper {
  display: flex;
  gap: 1.5rem;
  max-width: 900px;
  margin: 2rem auto;
  align-items: flex-start;
}

/* Conversation selector on the left */
.conversation-selector {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 200px;
  flex-shrink: 0;
}

.conversation-selector button {
  padding: 1rem 1.5rem;
  border: 2px solid #ddd;
  background: white;
  color: #333;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.conversation-selector button.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.conversation-selector button:hover {
  border-color: #667eea;
  transform: translateX(4px);
}

.conversation-selector button:hover:not(.active) {
  background: #f8f9fa;
}

/* SMS conversation on the right */
.sms-conversation {
  flex: 1;
  max-width: 500px;
  margin: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.conversation-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.conversation-header .contact-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid white;
  object-fit: cover;
}

.conversation-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

/* Phone status bar */
.phone-status-bar {
  background: #000;
  color: white;
  padding: 0.4rem 1rem;
  font-size: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-time {
  font-weight: 600;
}

.status-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-icon {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

/* Signal strength bars */
.signal-bars {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 10px;
}

.signal-bar {
  width: 3px;
  background: white;
  border-radius: 1px;
}

.signal-bar:nth-child(1) {
  height: 3px;
}
.signal-bar:nth-child(2) {
  height: 5px;
}
.signal-bar:nth-child(3) {
  height: 7px;
}
.signal-bar:nth-child(4) {
  height: 10px;
}

/* WiFi icon */
.wifi-icon {
  width: 12px;
  height: 10px;
  position: relative;
}

.wifi-arc {
  position: absolute;
  border: 1.5px solid white;
  border-radius: 50%;
  border-bottom: none;
}

.wifi-arc:nth-child(1) {
  width: 12px;
  height: 6px;
  bottom: 2px;
  left: 0;
}

.wifi-arc:nth-child(2) {
  width: 8px;
  height: 4px;
  bottom: 2px;
  left: 2px;
}

.wifi-arc:nth-child(3) {
  width: 4px;
  height: 2px;
  bottom: 2px;
  left: 4px;
}

/* Battery icon */
.battery-icon {
  width: 22px;
  height: 11px;
  border: 1.5px solid white;
  border-radius: 2px;
  position: relative;
  display: flex;
  align-items: center;
  padding: 1.5px;
}

.battery-icon::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 3px;
  width: 2px;
  height: 3px;
  background: white;
  border-radius: 0 1px 1px 0;
}

.battery-level {
  height: 100%;
  background: white;
  border-radius: 1px;
}

.battery-level.full {
  width: 100%;
}
.battery-level.high {
  width: 75%;
}
.battery-level.medium {
  width: 50%;
}
.battery-level.low {
  width: 25%;
  background: #ff3b30;
}

/* Bluetooth icon */
.bluetooth-icon {
  font-size: 0.85rem;
}

/* Carrier name */
.carrier-name {
  font-size: 0.75rem;
  letter-spacing: 0.3px;
}

.messages-container {
  padding: 1.5rem;
  height: 150px;
  max-height: 500px;
  overflow-y: auto;
  background: #f8f9fa;
  transition: height 0.4s ease-out;
  will-change: height;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateY(10px);
  animation: messageSlideIn 0.3s ease-out forwards;
}

@keyframes messageSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.left {
  justify-content: flex-start;
}

.message.right {
  justify-content: flex-end;
}

.message-bubble {
  max-width: 70%;
  padding: 0.75rem 1rem;
  border-radius: 18px;
  position: relative;
}

.message.left .message-bubble {
  background: white;
  color: #333;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message.right .message-bubble {
  background: #667eea;
  color: white;
  border-bottom-right-radius: 4px;
}

.message-text {
  margin: 0;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.message-timestamp {
  font-size: 0.7rem;
  opacity: 0.6;
  margin-top: 0.25rem;
  text-align: right;
}

.message.left .message-timestamp {
  text-align: left;
}

.typing-indicator {
  display: none;
  align-items: center;
  padding: 0.75rem 1rem;
  background: white;
  border-radius: 18px;
  width: fit-content;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.typing-indicator.active {
  display: flex;
}

.typing-dot {
  width: 8px;
  height: 8px;
  margin: 0 2px;
  background: #999;
  border-radius: 50%;
  animation: typingAnimation 1.4s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingAnimation {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

.conversation-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border-top: 1px solid #e1e5e9;
}

.conversation-controls button {
  padding: 0.5rem 1rem;
  border: 1px solid #667eea;
  background: white;
  color: #667eea;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.conversation-controls button:hover {
  background: #667eea;
  color: white;
}

.conversation-controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.loading {
  text-align: center;
  padding: 2rem;
  color: #666;
}

/* Responsive - stack on mobile */
@media (max-width: 768px) {
  .sms-component-wrapper {
    flex-direction: column;
  }

  .conversation-selector {
    flex-direction: row;
    width: 100%;
    min-width: unset;
    overflow-x: auto;
  }

  .conversation-selector button {
    flex-shrink: 0;
  }
}
