/* ================================================
   E-CHAT - Modern Professional UI/UX Design v7.0
   Clean, Minimal, Professional Interface
   ================================================ */

:root {
  /* Primary Colors - Softer & Lighter */
  --primary: #7BA3F5;
  --primary-dark: #6B93E5;
  --primary-light: #F0F5FF;
  --primary-gradient: linear-gradient(135deg, #A8C7FA 0%, #C4B5FD 100%);
  
  /* Semantic Colors - Softer */
  --success: #4ADE80;
  --warning: #FCD34D;
  --danger: #FB7185;
  --info: #60A5FA;
  
  /* Neutral Colors - Much Lighter */
  --white: #FFFFFF;
  --gray-50: #FAFBFC;
  --gray-100: #F5F7FA;
  --gray-200: #EDF0F5;
  --gray-300: #E2E6ED;
  --gray-400: #B8BFC9;
  --gray-500: #8B93A1;
  --gray-600: #6B7280;
  --gray-700: #505967;
  --gray-800: #363C47;
  --gray-900: #1F2329;
  
  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
  --transition-slow: all 0.3s ease;
}

/* ================================================
   BASE STYLES
   ================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 50%, #F3E8FF 100%);
  background-attachment: fixed;
  color: var(--gray-800);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ================================================
   SCREEN MANAGEMENT
   ================================================ */

.screen {
  display: none;
  height: 100vh;
  width: 100vw;
}

.screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ================================================
   LOGIN / REGISTER SCREEN
   ================================================ */

#login-screen {
  background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 50%, #F3E8FF 100%);
  padding: 20px;
}

.auth-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 32px rgba(123, 163, 245, 0.15);
  max-width: 440px;
  width: 100%;
  padding: 40px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  overflow: hidden;
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-header {
  background: var(--primary-gradient);
  padding: 40px 32px;
  text-align: center;
  color: var(--white);
}

.auth-header h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.auth-header p {
  font-size: 15px;
  opacity: 0.95;
  font-weight: 400;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.tab {
  flex: 1;
  padding: 16px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: var(--transition);
  background: transparent;
  border: none;
  outline: none;
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--white);
}

.tab:hover:not(.active) {
  color: var(--gray-700);
  background: var(--white);
}

.auth-content {
  padding: 32px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.input {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  outline: none;
  transition: var(--transition);
  font-family: inherit;
  background: var(--white);
  color: var(--gray-800);
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(123, 163, 245, 0.15);
  background: var(--white);
}

.input::placeholder {
  color: var(--gray-400);
}

select.input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 20px;
  padding-right: 40px;
}

.btn {
  width: 100%;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, #A8C7FA 0%, #C4B5FD 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(123, 163, 245, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #98B7EA 0%, #B4A5ED 100%);
  box-shadow: 0 6px 20px rgba(123, 163, 245, 0.35);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(123, 163, 245, 0.2);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

.btn-secondary:hover {
  background: var(--gray-200);
  border-color: var(--gray-300);
}

.message {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
  display: none;
}

.message.success {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #10B981;
  display: block;
}

.message.error {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #EF4444;
  display: block;
}

/* ================================================
   MAIN SCREEN LAYOUT
   ================================================ */

#main-screen {
  background: linear-gradient(135deg, #FAFBFF 0%, #F5F7FF 100%);
}

.main-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  max-width: 1920px;
  margin: 0 auto;
}

/* ================================================
   SIDEBAR
   ================================================ */

.sidebar {
  width: 380px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: 2px 0 16px rgba(123, 163, 245, 0.06);
}

.sidebar-header {
  padding: 20px 24px;
  background: linear-gradient(135deg, #A8C7FA 0%, #C4B5FD 100%);
  color: var(--white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 12px rgba(123, 163, 245, 0.1);
}

.user-info h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.user-info .status {
  font-size: 13px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: var(--transition);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.sidebar-tabs {
  display: flex;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 8px;
}

.sidebar-tab {
  flex: 1;
  padding: 14px 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.sidebar-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.sidebar-tab:hover:not(.active) {
  color: var(--gray-700);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-content::-webkit-scrollbar {
  width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

.tab-content {
  padding: 8px;
}

.contact-item,
.group-item,
.directory-user-item {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.contact-item:hover,
.group-item:hover,
.directory-user-item:hover {
  background: var(--gray-100);
}

.contact-item.active,
.group-item.active {
  background: var(--primary-light);
}

.contact-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  flex-shrink: 0;
}

.contact-info {
  flex: 1;
  min-width: 0;
}

.contact-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-last-message,
.contact-status {
  font-size: 13px;
  color: var(--gray-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ================================================
   CHAT AREA
   ================================================ */

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #F5F7FA 0%, #E8EBF0 100%);
  position: relative;
}

.chat-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 30L30 0L60 30L30 60Z' fill='%23A8C7FA' fill-opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.5;
  pointer-events: none;
}

#no-chat-selected {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--gray-500);
  font-size: 18px;
  z-index: 1;
}

#no-chat-selected .icon {
  font-size: 80px;
  margin-bottom: 16px;
  opacity: 0.5;
}

#chat-container {
  display: none;
  flex-direction: column;
  height: 100%;
  z-index: 1;
}

#chat-container.active {
  display: flex;
}

.chat-header {
  background: var(--white);
  padding: 16px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.chat-contact-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.chat-contact-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
}

.chat-contact-details h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 2px;
}

.chat-contact-details .status {
  font-size: 13px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-actions {
  display: flex;
  gap: 8px;
}

.chat-actions .icon-btn {
  background: var(--gray-100);
  color: var(--gray-700);
}

.chat-actions .icon-btn:hover {
  background: var(--gray-200);
}

#messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#messages-container::-webkit-scrollbar {
  width: 8px;
}

#messages-container::-webkit-scrollbar-track {
  background: transparent;
}

#messages-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.message-item {
  display: flex;
  gap: 8px;
  max-width: 75%;
  animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-item.sent {
  margin-left: auto;
  flex-direction: row-reverse;
}

.message-item.received {
  margin-right: auto;
}

.message-bubble {
  background: var(--white);
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(123, 163, 245, 0.08);
  position: relative;
  max-width: 100%;
  word-wrap: break-word;
}

.message-item.sent .message-bubble {
  background: linear-gradient(135deg, #D4E4FD 0%, #E0D4FD 100%);
  border-bottom-right-radius: 6px;
  box-shadow: 0 2px 4px rgba(123, 163, 245, 0.12);
}

.message-item.received .message-bubble {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom-left-radius: 6px;
  border: 1px solid var(--gray-200);
}

.message-text {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.message-time {
  font-size: 11px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

.encryption-indicator {
  font-size: 10px;
}

.message-status {
  color: var(--primary);
}

/* ================================================
   MESSAGE INPUT
   ================================================ */

.message-input-area {
  background: var(--white);
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.input-controls {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.input-wrapper {
  flex: 1;
  position: relative;
}

#message-input {
  width: 100%;
  min-height: 44px;
  max-height: 120px;
  padding: 12px 16px;
  padding-right: 120px;
  font-size: 15px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  outline: none;
  resize: none;
  font-family: inherit;
  transition: var(--transition);
}

#message-input:focus {
  border-color: var(--primary);
}

.input-actions {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  gap: 4px;
}

.input-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: var(--transition);
}

.input-btn:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}

#send-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: var(--transition);
  flex-shrink: 0;
}

#send-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

#send-btn:active {
  transform: scale(0.95);
}

/* ================================================
   MODALS
   ================================================ */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
}

.close-modal {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: none;
  border: none;
  font-size: 20px;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-modal:hover {
  background: var(--gray-100);
  color: var(--danger);
  transform: scale(1.1);
}

/* ================================================
   SETTINGS STYLES
   ================================================ */

/* Fullscreen Settings Modal */
.fullscreen-modal {
  padding: 0 !important;
}

.fullscreen-modal .settings-fullscreen {
  width: 100%;
  max-width: 800px;
  height: 90vh;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.settings-header {
  background: linear-gradient(135deg, #A8C7FA 0%, #C4B5FD 100%);
  color: white;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 2px 12px rgba(123, 163, 245, 0.15);
  flex-shrink: 0;
}

.settings-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  flex: 1;
  text-align: center;
}

.back-btn,
.close-btn {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.back-btn:hover,
.close-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.back-btn .icon,
.close-btn .icon {
  font-size: 18px;
}

.close-modal {
  background: var(--gray-100);
  border: none;
  color: var(--gray-600);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: var(--transition);
}

.close-modal:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}

.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--gray-50);
}

.settings-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.settings-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0 0 20px 0;
}

.settings-item {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-200);
}

.settings-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.settings-item label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.settings-value {
  display: block;
  font-size: 14px;
  color: var(--gray-600);
  background: var(--gray-100);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  word-break: break-word;
}

.settings-hint {
  display: block;
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 6px;
  font-style: italic;
}

.settings-select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--gray-800);
  background: var(--white);
  transition: var(--transition);
}

.settings-select:focus {
  outline: none;
  border-color: var(--primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ================================================
   RESPONSIVE DESIGN
   ================================================ */

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: absolute;
    left: 0;
    z-index: 10;
    transition: transform 0.3s ease;
  }
  
  .sidebar.hidden {
    transform: translateX(-100%);
  }
  
  .chat-area {
    width: 100%;
  }
  
  .chat-area.fullwidth {
    width: 100%;
  }
  
  #mobile-back-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: var(--gray-100);
  border: none;
  border-radius: var(--radius-md);
  color: var(--gray-700);
  cursor: pointer;
  transition: var(--transition);
  font-size: 18px;
  font-weight: 600;
}

#mobile-back-btn:hover {
  background: var(--gray-200);
  color: var(--primary);
}

@media (min-width: 769px) {
  #mobile-back-btn {
    display: none !important;
  }
  
  .message-item {
    max-width: 85%;
  }
}

@media (max-width: 480px) {
  .auth-container {
    max-width: 100%;
    border-radius: var(--radius-lg);
  }
  
  .auth-header {
    padding: 32px 24px;
  }
  
  .auth-content {
    padding: 24px;
  }
  
  .message-item {
    max-width: 90%;
  }
}

/* ================================================
   UTILITY CLASSES
   ================================================ */

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.fw-medium { font-weight: 500; }

.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-gray { color: var(--gray-500); }
/* ================================================
   AUTH SCREEN ENHANCEMENTS
   ================================================ */

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.logo-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: pulse 2s ease-in-out infinite;
}

.logo-title {
  font-size: 32px;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.logo-subtitle {
  font-size: 14px;
  color: var(--gray-500);
  font-weight: 500;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-xl);
}

.auth-footer {
  margin-top: 24px;
  text-align: center;
}

.footer-text {
  font-size: 13px;
  color: var(--white);
  opacity: 0.9;
  font-weight: 500;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  font-size: 18px;
  pointer-events: none;
  z-index: 1;
}

.input-wrapper .input {
  padding-left: 44px;
}

.form-hint {
  display: block;
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 6px;
  font-style: italic;
}

.tab-icon,
.tab-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tab-icon {
  font-size: 16px;
}

.btn-text {
  flex: 1;
}

.btn-icon {
  font-size: 18px;
  margin-left: 8px;
}

/* ================================================
   MAIN APP ENHANCEMENTS
   ================================================ */

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}

.user-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

.user-status {
  font-size: 12px;
  color: var(--success);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-btn .icon {
  font-size: 20px;
  display: block;
}

.icon-btn-small {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-md);
  color: var(--gray-600);
  transition: var(--transition);
  font-size: 20px;
}

.icon-btn-small:hover {
  background: var(--gray-100);
  color: var(--primary);
  transform: scale(1.1);
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-600);
  margin: 0;
}

/* ================================================
   NO CHAT SELECTED
   ================================================ */

.no-chat-selected {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: linear-gradient(135deg, #E5DDD5 0%, #F1E9E2 100%);
}

.no-chat-content {
  text-align: center;
  max-width: 400px;
  padding: 40px;
}

.no-chat-icon {
  font-size: 80px;
  margin-bottom: 24px;
  animation: float 3s ease-in-out infinite;
}

.no-chat-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 12px;
}

.no-chat-text {
  font-size: 16px;
  color: var(--gray-600);
  margin-bottom: 16px;
}

.no-chat-hint {
  font-size: 14px;
  color: var(--gray-500);
  font-style: italic;
}

/* ================================================
   CHAT HEADER ENHANCEMENTS
   ================================================ */

.contact-avatar-small {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}

.contact-details {
  flex: 1;
  min-width: 0;
}

.contact-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0 0 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--gray-400);
  animation: pulse 2s ease-in-out infinite;
}

.status-dot.online {
  background: var(--success);
}

.status-text {
  color: var(--gray-600);
  font-weight: 500;
}

.encryption-badge {
  background: var(--success);
  color: var(--white);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ================================================
   MESSAGE INPUT AREA ENHANCEMENTS
   ================================================ */

.icon-btn-input {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-md);
  color: var(--gray-600);
  transition: var(--transition);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn-input:hover {
  background: var(--gray-100);
  color: var(--primary);
  transform: scale(1.1);
}

.icon-btn-input:active {
  transform: scale(0.95);
}

/* ================================================
   ANIMATIONS
   ================================================ */

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

/* ================================================
   MOBILE RESPONSIVE
   ================================================ */

@media (max-width: 768px) {
  .logo-icon {
    font-size: 48px;
  }
  
  .logo-title {
    font-size: 24px;
  }
  
  .auth-card {
    padding: 24px;
  }
  
  .no-chat-icon {
    font-size: 60px;
  }
  
  .no-chat-title {
    font-size: 20px;
  }
  
  .fullscreen-modal .settings-fullscreen {
    height: 100vh;
    max-width: 100%;
    border-radius: 0;
  }
  
  .settings-content {
    padding: 16px;
  }
  
  .settings-card {
    padding: 20px;
    margin-bottom: 16px;
  }
}

@media (max-width: 480px) {
  .auth-container {
    max-width: 100%;
    padding: 16px;
  }
  
  .auth-card {
    padding: 20px;
  }
  
  .logo-icon {
    font-size: 40px;
  }
  
  .logo-title {
    font-size: 20px;
  }
}