@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

body {
  font-family: 'Roboto', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  min-height: 100vh;
  overflow-x: hidden;
  padding-top: 20px;
}

#app {
  width: 100%;
  max-width: 700px;
  height: 80vh;
  padding: 20px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fadeIn 0.5s ease-in;
}

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

.hidden {
  display: none !important;
}

h1 {
  font-size: 2.5em;
  margin-bottom: 20px;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

h2 {
  margin-bottom: 20px;
  color: #e0e0e0;
}

form {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 300px;
}

label {
  margin-top: 15px;
  margin-bottom: 5px;
  font-weight: 500;
  color: #ffffff;
}

input, select {
  padding: 12px;
  margin-bottom: 15px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 16px;
  transition: all 0.3s ease;
}

input::placeholder, select option {
  color: #cccccc;
}

input:focus, select:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

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

#terms-container {
  margin-top: 15px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

#terms-container input[type="checkbox"] {
  margin-top: 2px;
}

#terms-container label {
  font-size: 14px;
  line-height: 1.4;
  color: #cccccc;
  cursor: pointer;
}

#waiting .spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #4ecdc4;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 20px 0;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#chat {
  width: 100%;
  display: flex;
  flex-direction: column;
  height: 100%;
}

#stranger-info {
  margin-bottom: 15px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

#stranger-info p {
  margin: 0;
  flex-grow: 1;
}

#messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  border: none;
  padding: 20px;
  margin-bottom: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

#messages::-webkit-scrollbar {
  width: 6px;
}

#messages::-webkit-scrollbar-track {
  background: transparent;
}

.message {
  margin-bottom: 10px;
  padding: 10px 15px;
  border-radius: 20px;
  width: 80%;
  overflow-wrap: break-word;
  word-break: break-word;
  animation: slideIn 0.3s ease-out;
  font-size: 18px;
}

.message::-webkit-scrollbar {
  width: 4px;
}

.message::-webkit-scrollbar-track {
  background: transparent;
}

.message::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.you {
  background: linear-gradient(45deg, #ff6b6b, #ffa726);
  color: #ffffff;
  align-self: flex-end;
  margin-left: auto;
  border-bottom-right-radius: 5px;
}

.stranger {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  align-self: flex-start;
  border-bottom-left-radius: 5px;
}

#messages {
  display: flex;
  flex-direction: column;
}

#input-area {
  display: flex;
  width: 100%;
  margin-bottom: 15px;
  align-items: center;
  flex-shrink: 0;
}

#message-input {
  flex: 1;
  margin-right: 10px;
  padding: 15px;
  border: none;
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 16px;
  transition: all 0.3s ease;
}

#message-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

#send-btn {
  width: 55px;
  height: 55px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(45deg, #4ecdc4, #44a08d);
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 5px;
  flex-shrink: 0;
}

#send-btn:hover {
  transform: scale(1.1);
}

#send-btn {
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
}

#send-btn::before {
  content: '➤';
  font-size: 18px;
  transform: rotate(45deg);
}

#buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  width: 100%;
  flex-shrink: 0;
}

#next-btn, #disconnect-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
  max-width: 200px;
}

#next-btn {
  background: linear-gradient(45deg, #ffa726, #ff6b6b);
}

#next-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

#disconnect-btn {
  background: linear-gradient(45deg, #ff4757, #c44569);
}

#disconnect-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4);
}

#next-btn:disabled, #disconnect-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

#report-btn {
  background: linear-gradient(45deg, #ff6b35, #f7931e);
  color: #ffffff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

#report-btn:hover {
  transform: scale(1.05);
}

#report-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

#report-btn:disabled:hover {
  transform: none;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal:not(.hidden) {
  display: flex;
}

.modal-content {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  color: #333;
}

.modal-content h3 {
  margin-top: 0;
  color: #ff4757;
  text-align: center;
}

.modal-content label {
  display: block;
  margin-top: 15px;
  margin-bottom: 5px;
  font-weight: 500;
  color: #333;
}

.modal-content select, .modal-content textarea {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  color: #333;
  font-size: 14px;
  box-sizing: border-box;
}

.modal-content textarea {
  resize: vertical;
  min-height: 60px;
}

.modal-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.modal-buttons button {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

#report-cancel {
  background: #6c757d;
  color: white;
}

#report-cancel:hover {
  background: #5a6268;
}

.modal-buttons button[type="submit"] {
  background: #ff4757;
  color: white;
}

.modal-buttons button[type="submit"]:hover {
  background: #ff3742;
}

#seo-section {
  display: block;
  width: 100%;
  max-width: 700px;
  margin-top: 30px;
  padding: 20px;
  box-sizing: border-box;
}

#seo-section h1, #seo-section h2 {
  color: #ffffff;
  text-align: left;
}

#seo-section p {
  color: #e0e0e0;
  text-align: left;
  line-height: 1.6;
}

@media (max-width: 600px) {
  #app {
    padding: 15px;
    margin: 10px;
    height: 90vh;
    max-width: 95%;
  }

  h1 {
    font-size: 2em;
    margin-bottom: 15px;
  }

  form {
    max-width: 100%;
    width: 100%;
  }

  label {
    margin-top: 12px;
    margin-bottom: 8px;
    font-size: 14px;
    text-align: left;
    width: 100%;
  }

  input, select {
    padding: 12px;
    margin-bottom: 12px;
    width: 100%;
    box-sizing: border-box;
    font-size: 16px;
  }

  #terms-container {
    margin-top: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
  }

  #terms-container label {
    font-size: 12px;
    line-height: 1.4;
  }

  button {
    padding: 12px 24px;
    font-size: 16px;
    margin-top: 10px;
    width: 100%;
  }

  #buttons {
    flex-direction: column;
    max-width: 100%;
    width: 100%;
  }

  #buttons button {
    margin-bottom: 10px;
  }

  #stranger-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  #report-btn {
    align-self: flex-end;
    font-size: 11px;
    padding: 6px 10px;
  }

  #messages {
    height: 40vh;
    padding: 15px;
  }

  .message {
    max-width: 90%;
    font-size: 16px;
  }

  #message-input {
    padding: 12px;
    font-size: 16px;
  }

  #send-btn {
    width: 45px;
    height: 45px;
    font-size: 16px;
  }

  #input-area {
    margin-bottom: 12px;
  }

  #seo-section {
    display: block;
    margin-top: 20px;
    padding: 15px;
    max-width: 95%;
  }

  #seo-section h1 {
    font-size: 1.5em;
  }

  #seo-section h2 {
    font-size: 1.2em;
  }

  #seo-section p {
    font-size: 14px;
  }

  .modal-content {
    padding: 15px;
    max-width: 95%;
  }

  .modal-buttons {
    flex-direction: column;
  }

  .modal-buttons button {
    margin-bottom: 10px;
  }
}

#learn-more-btn {
  background: linear-gradient(45deg, #4ecdc4, #44a08d);
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 20px 0;
}

#learn-more-btn:hover {
  background: linear-gradient(45deg, #44a08d, #4ecdc4);
}