* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 1200px;
  width: 100%;
  overflow: hidden;
}

/* Ad Spaces */
.ad-space {
  background: #f0f0f0;
  border: 2px dashed #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 14px;
  text-align: center;
}

.ad-banner {
  height: 90px;
  width: 100%;
}

.ad-banner.bottom {
  margin-top: 20px;
}

.ad-sidebar {
  width: 300px;
  height: 600px;
  flex-shrink: 0;
  margin-right: 20px;
}

/* Header */
header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  text-align: center;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.tagline {
  opacity: 0.9;
  font-size: 1.1rem;
}

/* Landing Page */
#landing-page {
  padding: 40px;
}

.button-container {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.chat-btn {
  flex: 1;
  min-width: 250px;
  padding: 30px;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.chat-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.chat-btn:active {
  transform: translateY(-2px);
}

.chat-btn.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.chat-btn.secondary {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.btn-icon {
  font-size: 3rem;
}

.btn-text {
  font-size: 1.5rem;
  font-weight: bold;
}

.btn-subtitle {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Info Section */
.info-section {
  background: #f8f9fa;
  padding: 30px;
  border-radius: 15px;
}

.info-section h3 {
  margin-bottom: 15px;
  color: #333;
}

.info-section ul {
  list-style: none;
  padding-left: 0;
}

.info-section li {
  padding: 10px 0;
  padding-left: 30px;
  position: relative;
}

.info-section li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #667eea;
  font-weight: bold;
  font-size: 1.2rem;
}

/* Chat Interface */
#chat-interface {
  padding: 20px;
  min-height: 600px;
  display: flex;
  flex-direction: column;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
  margin-bottom: 20px;
}

#chat-info {
  display: flex;
  gap: 15px;
  font-weight: 600;
  color: #333;
}

.chat-controls {
  display: flex;
  gap: 10px;
}

.icon-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 5px;
  transition: background 0.2s;
}

.icon-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

.icon-btn.danger:hover {
  background: rgba(255, 0, 0, 0.1);
}

.chat-content-wrapper {
  display: flex;
  flex: 1;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.status-message {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 500;
}

.status-message.success {
  background: #d4edda;
  border-color: #28a745;
  color: #155724;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 10px;
  margin-bottom: 20px;
  min-height: 400px;
  max-height: 500px;
}

.message {
  margin-bottom: 15px;
  padding: 12px 16px;
  border-radius: 10px;
  max-width: 70%;
  word-wrap: break-word;
  animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.own {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  margin-left: auto;
  text-align: right;
}

.message.other {
  background: white;
  border: 1px solid #ddd;
  color: #333;
}

.message-meta {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 5px;
}

.message-input-container {
  display: flex;
  gap: 10px;
}

#message-input {
  flex: 1;
  padding: 15px;
  border: 2px solid #ddd;
  border-radius: 25px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

#message-input:focus {
  border-color: #667eea;
}

.send-btn {
  padding: 15px 30px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 25px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s;
}

.send-btn:hover {
  transform: scale(1.05);
}

.send-btn:active {
  transform: scale(0.95);
}

/* Footer */
footer {
  background: #f8f9fa;
  padding: 20px;
  text-align: center;
  color: #666;
  font-size: 0.9rem;
}

/* System messages */
.system-message {
  text-align: center;
  color: #666;
  font-style: italic;
  margin: 15px 0;
  padding: 10px;
  background: #e9ecef;
  border-radius: 8px;
  font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .button-container {
    flex-direction: column;
  }
  
  .chat-btn {
    min-width: 100%;
  }
  
  .chat-content-wrapper {
    flex-direction: column;
  }
  
  .ad-sidebar {
    width: 100%;
    height: 250px;
    margin-right: 0;
    margin-bottom: 20px;
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  .message {
    max-width: 85%;
  }
}

/* Loading state */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: "...";
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% {
    content: ".";
  }
  40% {
    content: "..";
  }
  60%, 100% {
    content: "...";
  }
}
