* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #0f0f0f;
  color: #e0e0e0;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== LOGIN PAGE ===== */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: radial-gradient(circle at center, #1a1a1a 0%, #050505 100%);
}

.login-box {
  background: rgba(25, 25, 25, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

.login-box h1 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 28px;
  background: linear-gradient(135deg, #00d4ff, #0099ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #aaa;
}

.form-group input, .text-input {
  width: 100%;
  padding: 12px 15px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  transition: all 0.2s;
}

.form-group input:focus, .text-input:focus {
  outline: none;
  border-color: #00d4ff;
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
}

.login-btn, .primary-btn, .send-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #00d4ff, #0099ff);
  border: none;
  border-radius: 10px;
  color: #000;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.login-btn:hover, .primary-btn:hover, .send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 212, 255, 0.3);
}

/* ===== CHAT PAGE ===== */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.chat-header {
  background: #151515;
  border-bottom: 1px solid #222;
  padding: 15px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.chat-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.header-actions {
  display: flex;
  gap: 12px;
}

.primary-btn {
  width: auto;
  padding: 8px 20px;
  font-size: 14px;
}

.logout-btn {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid #444;
  border-radius: 8px;
  color: #aaa;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: #666;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #0f0f0f;
}

.message {
  max-width: 80%;
  align-self: flex-start;
  animation: fadeIn 0.3s ease;
}

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

.message-content {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 15px;
  padding: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.message-text {
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 10px;
}

.message-info-badge {
  display: inline-block;
  background: rgba(0, 212, 255, 0.1);
  color: #00d4ff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}

.message-video video {
  width: 100%;
  max-width: 400px;
  border-radius: 10px;
  display: block;
}

.message-time {
  font-size: 11px;
  color: #666;
  margin-top: 8px;
  text-align: right;
}

/* ===== MODAL POPUP ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  animation: modalSlideUp 0.3s ease;
}

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

.modal-header {
  padding: 20px 25px;
  border-bottom: 1px solid #222;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 18px;
  color: #fff;
}

.close-modal {
  color: #666;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

.close-modal:hover {
  color: #fff;
}

.modal-body {
  padding: 25px;
}

.modal-footer {
  padding: 15px 25px;
  border-top: 1px solid #222;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.secondary-btn {
  background: transparent;
  border: 1px solid #444;
  color: #ccc;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.file-input-wrapper {
  margin-bottom: 10px;
}

.file-input-btn {
  background: #333;
  border: 1px solid #444;
  color: #fff;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.file-input-btn:hover {
  background: #444;
}

.file-name {
  font-size: 13px;
  color: #888;
  margin-top: 5px;
}

.upload-progress {
  width: 100%;
  height: 6px;
  background: #333;
  border-radius: 3px;
  margin-top: 20px;
  display: none;
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  background: #00d4ff;
  width: 0%;
  transition: width 0.3s;
}

.upload-info {
  font-size: 12px;
  color: #00d4ff;
  margin-top: 8px;
  text-align: center;
  display: none;
}

/* ===== UTILS ===== */
.message-status {
  font-size: 12px;
  margin-top: 5px;
}
.message-status.success { color: #4ade80; }
.message-status.error { color: #ff6464; }

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(0, 212, 255, 0.3);
  border-top-color: #00d4ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0f0f0f; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

@media (max-width: 600px) {
  .modal-content { width: 95%; }
  .message { max-width: 95%; }
}
