/* Service Management Application Styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f5f5;
}

.service-map-app {
  display: flex;
  height: 100vh;
  width: 100vw;
}

.gdm-map-app {
  display: flex;
  height: 100vh;
  width: 100vw;
}

.main-container {
  flex: 1;
  position: relative;
  background: #000;
}

.map-error-message {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  background: #f44336;
  color: white;
  padding: 15px;
  border-radius: 8px;
  z-index: 1000;
  font-weight: bold;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  line-height: 1.5;
}

.map-error-message a {
  color: #ffeb3b;
  text-decoration: underline;
}

.map-error-message code {
  background: rgba(255,255,255,0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

.sidebar {
  width: 400px;
  background: #ffffff;
  border-left: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.selector {
  background: #1976d2;
  padding: 0;
  border-bottom: 1px solid #e0e0e0;
}

.selector button {
  width: 100%;
  padding: 16px 20px;
  background: transparent;
  border: none;
  color: white;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.selector button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.selector button.selected-tab {
  background: rgba(255, 255, 255, 0.2);
}

.tabcontent {
  flex: 1;
  display: none;
  flex-direction: column;
  height: calc(100vh - 70px);
}

.tabcontent.showtab {
  display: flex;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: 0;
}

.turn {
  margin-bottom: 20px;
  padding: 16px;
  border-radius: 12px;
  max-width: 90%;
}

.turn.role-user {
  background: #e3f2fd;
  margin-left: auto;
  margin-right: 0;
  border-bottom-right-radius: 4px;
}

.turn.role-assistant {
  background: #f5f5f5;
  margin-right: auto;
  margin-left: 0;
  border-bottom-left-radius: 4px;
}

.turn.role-error {
  background: #ffebee;
  border-left: 4px solid #f44336;
}

.turn .text {
  line-height: 1.5;
  color: #333;
}

.turn .text h1, .turn .text h2, .turn .text h3 {
  margin-top: 0;
}

.turn .text p {
  margin: 0 0 10px 0;
}

.turn .text p:last-child {
  margin-bottom: 0;
}

.turn .text strong {
  color: #1976d2;
  font-weight: 600;
}

.welcome-message {
  background: #e8f5e8;
  border: 2px solid #4caf50;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.welcome-message h3 {
  margin: 0 0 12px 0;
  color: #2e7d32;
}

.welcome-message p {
  margin: 8px 0;
  color: #333;
}

.welcome-message ul {
  margin: 8px 0 0 20px;
  color: #555;
}

.welcome-message li {
  margin: 4px 0;
}

/* Services Panel Styles */
.services-panel {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 320px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 1000;
  max-height: 60vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.services-header {
  background: #1976d2;
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 12px 12px 0 0;
}

.services-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.services-count {
  background: rgba(255,255,255,0.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 14px;
}

.services-list {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  max-height: 400px;
}

.no-services {
  padding: 30px 20px;
  text-align: center;
  color: #666;
  font-style: italic;
}

.service-item {
  border-bottom: 1px solid #e0e0e0;
  padding: 16px 20px;
  transition: background-color 0.2s;
}

.service-item:hover {
  background: #f8f9fa;
}

.service-item:last-child {
  border-bottom: none;
}

.service-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.service-id {
  font-family: monospace;
  font-size: 12px;
  color: #666;
  font-weight: bold;
}

.service-status {
  padding: 4px 8px;
  border-radius: 12px;
  color: white;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
}

.service-details {
  font-size: 13px;
  line-height: 1.4;
}

.service-details > div {
  margin: 2px 0;
  color: #555;
}

.service-customer {
  font-weight: 600;
  color: #333;
}

.service-type {
  color: #1976d2;
  font-weight: 500;
}

.service-location {
  color: #666;
}

.service-time {
  color: #888;
  font-size: 12px;
}

.thinking {
  margin-bottom: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
}

.thinking summary {
  padding: 8px 12px;
  cursor: pointer;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 14px;
  color: #666;
}

.thinking summary:hover {
  background: #e9ecef;
}

.footer {
  border-top: 1px solid #e0e0e0;
  padding: 20px;
  background: white;
}

#chatStatus {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 16px;
  color: #666;
  font-size: 14px;
}

#chatStatus.hidden {
  display: none;
}

.rotating {
  animation: spin 1s linear infinite;
}

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

#inputArea {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

#messageInput {
  flex: 1;
  padding: 14px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 24px;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  resize: none;
  min-height: 48px;
  max-height: 120px;
}

#messageInput:focus {
  border-color: #1976d2;
}

#sendButton {
  width: 48px;
  height: 48px;
  border: none;
  background: #1976d2;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

#sendButton:hover:not(:disabled) {
  background: #1565c0;
}

#sendButton:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

/* Code highlighting styles */
.hljs {
  background: #f8f9fa;
  border-radius: 4px;
  padding: 12px;
  margin: 8px 0;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  overflow-x: auto;
}

/* Responsive design */
@media (max-width: 768px) {
  .gdm-map-app {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: 40vh;
    border-left: none;
    border-top: 1px solid #e0e0e0;
  }
  
  .main-container {
    height: 60vh;
  }
  
  .tabcontent {
    height: calc(40vh - 70px);
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  .rotating {
    animation: none;
  }
  
  .turn, #messageInput:focus {
    transition: none;
  }
}