/* Deutsche Demo Chat - CSS */

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

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #000 0%, #d4182a 50%, #ffdd00 100%);
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== HEADER ===== */
header {
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 3px solid #d4182a;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-menu-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 0.8rem;
  border-radius: 10px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: none;
}

.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.flag {
  font-size: 2rem;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
}

header h1 {
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.logout-btn {
  background: linear-gradient(135deg, #d4182a, #b8152a);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(212, 24, 42, 0.3);
}

/* ===== MOBILE NAVIGATION ===== */
.mobile-nav {
  position: fixed;
  top: 0;
  left: -100%;
  width: 300px;
  height: 100%;
  background: rgba(0, 0, 0, 0.98);
  backdrop-filter: blur(10px);
  z-index: 200;
  transition: left 0.3s ease;
  overflow-y: auto;
  display: none;
}

.mobile-nav.active {
  left: 0;
}

.mobile-nav-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.mobile-nav-header {
  background: linear-gradient(135deg, #d4182a, #b8152a);
  color: white;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.mobile-nav-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.mobile-nav-close:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(90deg);
}

.mobile-channel-list {
  padding: 1rem;
  flex: 1;
}

.mobile-channel-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 1rem;
  margin-bottom: 0.8rem;
  border-radius: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  font-size: 0.95rem;
}

.mobile-channel-btn:hover {
  background: rgba(212, 24, 42, 0.2);
  border-color: #d4182a;
  transform: translateX(5px);
}

.mobile-channel-btn.active {
  background: linear-gradient(135deg, #d4182a, #b8152a);
  color: white;
  border-color: #d4182a;
  box-shadow: 0 4px 15px rgba(212, 24, 42, 0.3);
}

/* ===== MAIN CONTAINER ===== */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  min-height: calc(100vh - 100px);
}

.hidden {
  display: none !important;
}

/* ===== LOGIN SECTION ===== */
.login-section {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 70vh;
}

.login-container {
  width: 100%;
  max-width: 450px;
}

.login-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 3rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header h2 {
  color: #333;
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.login-header p {
  color: #666;
  font-size: 1rem;
}

.login-form {
  margin-bottom: 2rem;
}

.input-group {
  margin-bottom: 1.5rem;
}

.input-group input {
  width: 100%;
  padding: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.9);
}

.input-group input:focus {
  outline: none;
  border-color: #d4182a;
  box-shadow: 0 0 0 3px rgba(212, 24, 42, 0.1);
}

.login-btn {
  width: 100%;
  background: linear-gradient(135deg, #d4182a, #b8152a);
  color: white;
  border: none;
  padding: 1rem;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 24, 42, 0.3);
}

.login-footer {
  text-align: center;
}

.login-footer p {
  color: #666;
  margin-bottom: 1rem;
}

.register-btn {
  background: transparent;
  color: #d4182a;
  border: 2px solid #d4182a;
  padding: 0.8rem 2rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.register-btn:hover {
  background: #d4182a;
  color: white;
  transform: translateY(-2px);
}

/* ===== CHAT INTERFACE ===== */
.chat-interface {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  height: calc(100vh - 150px);
}

/* ===== NAVIGATION PANEL ===== */
.navigation-panel {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.nav-header {
  background: linear-gradient(135deg, #333, #000);
  color: white;
  padding: 1.5rem;
  border-bottom: 3px solid #d4182a;
}

.nav-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.channel-list {
  padding: 1rem;
  max-height: calc(100vh - 250px);
  overflow-y: auto;
}

.main-channel-btn {
  width: 100%;
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  color: #333;
  padding: 1rem;
  margin-bottom: 0.8rem;
  border-radius: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  font-size: 0.95rem;
}

.main-channel-btn:hover {
  background: #e9ecef;
  border-color: #d4182a;
  transform: translateX(5px);
}

.main-channel-btn.active {
  background: linear-gradient(135deg, #d4182a, #b8152a);
  color: white;
  border-color: #d4182a;
  box-shadow: 0 4px 15px rgba(212, 24, 42, 0.3);
}

/* ===== CHAT PANEL ===== */
.chat-panel {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== CHAT HEADER (Sub-Navigation) ===== */
.chat-header {
  background: #f8f9fa;
  border-bottom: 2px solid #e9ecef;
  padding: 1rem 1.5rem;
}

.chat-tabs {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.normal-chat-btn {
  background: #6c757d;
  color: white;
  border: none;
  padding: 0.8rem 1.2rem;
  border-radius: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.normal-chat-btn.active {
  background: #28a745;
  box-shadow: 0 2px 10px rgba(40, 167, 69, 0.3);
}

.extra-chat-btn {
  background: #007bff;
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.extra-chat-btn.active {
  background: #28a745;
  box-shadow: 0 2px 10px rgba(40, 167, 69, 0.3);
}

.delete-extra-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  margin-left: 0.3rem;
}

.add-extra-btn {
  background: #28a745;
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
  transition: all 0.3s ease;
}

.add-extra-btn:hover {
  background: #218838;
  transform: translateY(-2px);
}

/* ===== MESSAGES CONTAINER ===== */
.messages-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.welcome-message {
  text-align: center;
  color: #666;
  margin-top: 2rem;
}

.welcome-message h3 {
  color: #333;
  margin-bottom: 1rem;
}

/* ===== MESSAGE STYLES ===== */
.message {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 1.2rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.message:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.message.admin {
  border-left: 4px solid #ffc107;
  background: linear-gradient(135deg, #fff9c4, #fff);
}

.message .meta {
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
  margin-bottom: 0.8rem;
  display: block;
}

.message img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 8px;
  margin-top: 1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
}

.message img:hover {
  transform: scale(1.02);
}

.deleteBtn, .banBtn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  margin-left: 0.8rem;
  margin-top: 0.5rem;
  transition: all 0.3s ease;
}

.deleteBtn:hover, .banBtn:hover {
  background: #c82333;
  transform: translateY(-1px);
}

/* ===== INPUT PANEL ===== */
.input-panel {
  border-top: 2px solid #e9ecef;
  padding: 1.5rem;
  background: #f8f9fa;
}

.message-form {
  margin-bottom: 1rem;
}

.message-input-container {
  display: flex;
  gap: 1rem;
  align-items: center;
}

#messageInput {
  flex: 1;
  padding: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: white;
}

#messageInput:focus {
  outline: none;
  border-color: #d4182a;
  box-shadow: 0 0 0 3px rgba(212, 24, 42, 0.1);
}

.send-btn {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

/* ===== IMAGE FORM ===== */
.image-form {
  border-top: 1px solid #e0e0e0;
  padding-top: 1rem;
  margin-top: 1rem;
}

.image-input-container {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.file-input {
  display: none;
}

.file-label {
  background: #6c757d;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.file-label:hover {
  background: #5a6268;
  transform: translateY(-2px);
}

.upload-btn {
  background: linear-gradient(135deg, #6f42c1, #e83e8c);
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.upload-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(111, 66, 193, 0.3);
}

/* ===== LOADING & NOTIFICATIONS ===== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.loading-spinner {
  background: white;
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #d4182a;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem auto;
}

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

.notification-container {
  position: fixed;
  top: 100px;
  right: 2rem;
  z-index: 1000;
}

.notification {
  background: white;
  border-left: 4px solid #28a745;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.3s ease;
}

.notification.error {
  border-left-color: #dc3545;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== SCROLLBAR STYLING ===== */
.chat-messages::-webkit-scrollbar,
.channel-list::-webkit-scrollbar,
.mobile-channel-list::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track,
.channel-list::-webkit-scrollbar-track,
.mobile-channel-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb,
.channel-list::-webkit-scrollbar-thumb,
.mobile-channel-list::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.channel-list::-webkit-scrollbar-thumb:hover,
.mobile-channel-list::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
  .chat-interface {
    grid-template-columns: 250px 1fr;
  }
}

@media (max-width: 768px) {
  header {
    padding: 0.8rem 0;
  }
  
  .header-content {
    padding: 0 1rem;
  }
  
  header h1 {
    font-size: 1.4rem;
  }
  
  main {
    padding: 1rem;
  }
  
  .chat-interface {
    grid-template-columns: 1fr;
    height: calc(100vh - 120px);
  }
  
  .navigation-panel {
    display: none;
  }
  
  .mobile-nav {
    display: block;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .login-card {
    padding: 2rem 1.5rem;
  }
  
  .message-input-container,
  .image-input-container {
    flex-direction: column;
  }
  
  .message-input-container input,
  .send-btn,
  .file-label,
  .upload-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .header-content {
    padding: 0 0.5rem;
  }
  
  .flag {
    font-size: 1.5rem;
  }
  
  header h1 {
    font-size: 1.2rem;
  }
  
  main {
    padding: 0.5rem;
  }
  
  .login-card {
    padding: 1.5rem 1rem;
  }
  
  .chat-messages {
    padding: 1rem;
  }
  
  .input-panel {
    padding: 1rem;
  }
  
  .message {
    padding: 1rem;
  }
  
  .mobile-nav {
    width: 250px;
  }
  
  .mobile-nav-header {
    padding: 1rem;
  }
  
  .mobile-channel-list {
    padding: 0.5rem;
  }
  
  .mobile-channel-btn {
    padding: 0.8rem;
    font-size: 0.9rem;
  }
  
  .chat-tabs {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .normal-chat-btn,
  .extra-chat-btn,
  .add-extra-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== FOCUS STYLES ===== */
.mobile-menu-btn:focus,
.mobile-nav-close:focus,
.mobile-channel-btn:focus,
.main-channel-btn:focus,
.send-btn:focus,
.upload-btn:focus,
.file-label:focus,
.login-btn:focus,
.register-btn:focus,
.logout-btn:focus {
  outline: 3px solid #ffdd00;
  outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
  .navigation-panel,
  .mobile-nav,
  .mobile-menu-btn,
  .input-panel,
  header .header-right {
    display: none !important;
  }
  
  body {
    background: white !important;
  }
  
  .chat-panel {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  .message {
    page-break-inside: avoid;
  }
}