/* kebebasan.css - Responsive Chat Room Styling */

* {
  box-sizing: border-box;
}

/* Login Section */
.login-section {
  max-width: 500px;
  margin: 2rem auto;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(30, 50, 80, 0.8));
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.login-section h2 {
  color: #e0e7ff;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #c7d2e0;
  font-weight: bold;
  font-family: 'Orbitron', sans-serif;
}

.form-group input {
  width: 100%;
  padding: 0.8rem;
  border: 2px solid rgba(59, 130, 246, 0.4);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08));
  color: #fff;
  font-size: 1rem;
  font-family: 'Orbitron', sans-serif;
  outline: none;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.form-group input:focus {
  border-color: #8b5cf6;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
  transform: scale(1.02);
}

.login-form button {
  width: 100%;
  padding: 0.8rem 1.5rem;
  border: 2px solid rgba(59, 130, 246, 0.4);
  border-radius: 25px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.05));
  color: #a0aec0;
  font-size: 1rem;
  font-weight: bold;
  font-family: 'Orbitron', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.5rem;
}

.login-form button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(139, 92, 246, 0.3);
  transition: left 0.3s ease;
  z-index: -1;
}

.login-form button:hover {
  border-color: rgba(139, 92, 246, 0.6);
  color: #e0e7ff;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
  transform: translateY(-2px);
}

.login-form button:hover::before {
  left: 0;
}

.login-form button:active {
  transform: translateY(0);
}

#login-message {
  margin-top: 1rem;
  color: #8b5cf6;
  font-weight: bold;
}

/* Chat Room Section */
#chat-room {
  margin-top: 3rem;
}

#chat-room h2 {
  text-align: center;
  color: #e0e7ff;
  font-size: 2rem;
  margin-bottom: 2rem;
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.chat-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(30, 50, 80, 0.8));
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.chat-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.chat-meta div:first-child {
  flex: 1;
  min-width: 200px;
}

.chat-meta label {
  display: block;
  margin-bottom: 0.3rem;
  color: #c7d2e0;
  font-weight: bold;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
}

.chat-meta input {
  width: 100%;
  padding: 0.5rem;
  border: 2px solid rgba(59, 130, 246, 0.4);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08));
  color: #fff;
  font-size: 0.9rem;
  font-family: 'Orbitron', sans-serif;
  outline: none;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.chat-meta input:focus {
  border-color: #8b5cf6;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.chat-meta button {
  padding: 0.5rem 1rem;
  border: 2px solid rgba(59, 130, 246, 0.4);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.05));
  color: #a0aec0;
  font-size: 0.85rem;
  font-weight: bold;
  font-family: 'Orbitron', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chat-meta button:hover {
  border-color: rgba(139, 92, 246, 0.6);
  color: #e0e7ff;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
  transform: translateY(-1px);
}

.messages {
  height: 400px;
  overflow-y: auto;
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.message {
  padding: 0.5rem 0.8rem;
  border-radius: 15px;
  margin-bottom: 0.3rem;
  word-wrap: break-word;
  max-width: 80%;
  line-height: 1.4;
}

.message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(139, 92, 246, 0.2));
  color: #e0e7ff;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.message.other {
  align-self: flex-start;
  background: linear-gradient(135deg, rgba(30, 50, 80, 0.6), rgba(50, 70, 120, 0.4));
  color: #c7d2e0;
  border: 1px solid rgba(30, 50, 80, 0.4);
}

.message .username {
  font-weight: bold;
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
  opacity: 0.8;
}

.message .timestamp {
  font-size: 0.7rem;
  opacity: 0.6;
  margin-top: 0.2rem;
}

.chat-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.chat-form input {
  flex: 1;
  padding: 0.8rem;
  border: 2px solid rgba(59, 130, 246, 0.4);
  border-radius: 25px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08));
  color: #fff;
  font-size: 1rem;
  font-family: 'Orbitron', sans-serif;
  outline: none;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.chat-form input:focus {
  border-color: #8b5cf6;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
  transform: scale(1.01);
}

.chat-form button {
  padding: 0.8rem 1.5rem;
  border: 2px solid rgba(59, 130, 246, 0.4);
  border-radius: 25px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.05));
  color: #a0aec0;
  font-size: 1rem;
  font-weight: bold;
  font-family: 'Orbitron', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.chat-form button:hover {
  border-color: rgba(139, 92, 246, 0.6);
  color: #e0e7ff;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
  transform: translateY(-2px);
}

/* Mobile Optimizations */
@media (max-width: 1024px) {
  header, main, footer {
    padding: 1rem 0.75rem;
  }

  main {
    max-width: 100%;
    overflow-x: hidden;
  }

  .login-section {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 1.5rem 0;
    padding: 1.5rem;
  }

  .chat-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 1rem;
  }

  .messages {
    height: 350px;
  }
}

@media (max-width: 768px) {
  body {
    padding-top: 80px;
  }

  header, main, footer {
    padding: 0.75rem 0.5rem;
  }

  main {
    max-width: 100%;
    overflow-x: hidden;
  }

  .login-section {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 15px;
  }

  .login-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  .login-form {
    gap: 0.8rem;
  }

  .form-group input {
    padding: 0.7rem;
    font-size: 0.9rem;
    border-radius: 8px;
  }

  .login-form button {
    padding: 0.7rem 1.2rem;
    font-size: 0.9rem;
    border-radius: 20px;
  }

  #chat-room h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
  }

  .chat-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.8rem;
    border-radius: 15px;
  }

  .chat-meta {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
  }

  .chat-meta div:first-child {
    flex: none;
  }

  .chat-meta input {
    padding: 0.4rem;
    font-size: 0.8rem;
    border-radius: 6px;
  }

  .chat-meta button {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    border-radius: 15px;
  }

  .messages {
    height: 300px;
    padding: 0.8rem;
    gap: 0.4rem;
  }

  .message {
    max-width: 85%;
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
  }

  .chat-form {
    gap: 0.4rem;
  }

  .chat-form input {
    padding: 0.7rem;
    font-size: 0.9rem;
    border-radius: 20px;
  }

  .chat-form button {
    padding: 0.7rem 1.2rem;
    font-size: 0.9rem;
    border-radius: 20px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 13px;
    padding-top: 60px;
  }

  header, main, footer {
    padding: 0.5rem;
  }

  main {
    max-width: 100%;
    overflow-x: hidden;
  }

  .login-section {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0.75rem 0;
    padding: 0.75rem;
    border-radius: 12px;
  }

  .login-section h2 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
  }

  .login-form {
    gap: 0.6rem;
  }

  .form-group input {
    padding: 0.6rem;
    font-size: 13px;
    border-radius: 6px;
  }

  .login-form button {
    padding: 0.6rem 1rem;
    font-size: 13px;
    border-radius: 16px;
  }

  #chat-room h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  .chat-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.6rem;
    border-radius: 12px;
  }

  .chat-meta {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .chat-meta input {
    padding: 0.35rem;
    font-size: 13px;
    border-radius: 5px;
  }

  .chat-meta button {
    padding: 0.35rem 0.7rem;
    font-size: 13px;
    border-radius: 12px;
  }

  .messages {
    height: 250px;
    padding: 0.6rem;
    gap: 0.3rem;
    border-radius: 8px;
  }

  .message {
    max-width: 90%;
    padding: 0.35rem 0.5rem;
    font-size: 13px;
    border-radius: 10px;
  }

  .chat-form {
    gap: 0.3rem;
  }

  .chat-form input {
    padding: 0.6rem;
    font-size: 13px;
    border-radius: 16px;
  }

  .chat-form button {
    padding: 0.6rem 1rem;
    font-size: 13px;
    border-radius: 16px;
  }

  /* Ensure no overflow on any element */
  * {
    max-width: 100vw;
  }

  body {
    overflow-x: hidden;
  }
}

/* Accessibility: Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  .form-group input,
  .login-form button,
  .chat-meta input,
  .chat-meta button,
  .chat-form input,
  .chat-form button {
    animation: none !important;
  }
}