:root {
  --bg-main: #0e1621;
  --bg-sidebar: #17212b;
  --bg-card: #242f3d;
  --text-main: #f5f5f5;
  --text-sub: #7f91a4;
  --accent-color: #5288c1;
  --border-color: rgba(0, 0, 0, 0.2);
}

.theme-aero-dark {
  --bg-main: #0e1621;
  --bg-sidebar: #17212b;
  --bg-card: #242f3d;
  --text-main: #f5f5f5;
  --text-sub: #7f91a4;
  --accent-color: #5288c1;
}

.theme-light {
  --bg-main: #eef2f5;
  --bg-sidebar: #ffffff;
  --bg-card: #f8f9fa;
  --text-main: #1c1d21;
  --text-sub: #828a99;
  --accent-color: #2a75d3;
}

.theme-cyberpunk {
  --bg-main: #0d0221;
  --bg-sidebar: #190535;
  --bg-card: #2c0b59;
  --text-main: #00ffff;
  --text-sub: #ff007f;
  --accent-color: #ff007f;
}

.theme-emerald {
  --bg-main: #021a16;
  --bg-sidebar: #052c25;
  --bg-card: #0a3d34;
  --text-main: #e0f2f1;
  --text-sub: #4db6ac;
  --accent-color: #00bfa5;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-main);
  color: var(--text-main);
}

.app-viewport {
  width: 100vw;
  height: 100vh;
  display: flex;
}

.auth-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, var(--bg-card) 0%, var(--bg-main) 100%);
}

.auth-card {
  width: 360px;
  padding: 30px;
  background: rgba(23, 33, 43, 0.85);
  backdrop-filter: blur(15px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 15px 35px rgba(0,0,0,0.4);
  text-align: center;
}

.aero-brand h1 {
  font-size: 24px;
  margin-top: 10px;
}

.aero-brand p {
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 20px;
}

.input-group {
  text-align: left;
  margin-bottom: 15px;
}

.input-group label {
  display: block;
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 5px;
}

.aero-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-main);
  outline: none;
  font-size: 14px;
}

.aero-input.sm {
  padding: 6px 10px;
  font-size: 12px;
}

.aero-input:focus {
  border-color: var(--accent-color);
}

.auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.aero-button {
  padding: 10px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.aero-button.sm {
  padding: 6px 12px;
  font-size: 12px;
}

.glossy-blue {
  background: var(--accent-color);
  color: #fff;
}

.glossy-glass {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.aero-alert {
  background: rgba(255, 95, 86, 0.2);
  border: 1px solid #ff5f56;
  color: #ff5f56;
  padding: 8px;
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 15px;
}

.aero-fullscreen-app {
  width: 100%;
  height: 100%;
  display: flex;
  position: relative;
}

.aero-sidebar {
  width: 300px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header-bar {
  padding: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.burger-btn {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 18px;
  cursor: pointer;
}

.friends-container {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.friend-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  margin-bottom: 4px;
}

.friend-card:hover {
  background: rgba(255, 255, 255, 0.05);
}

.user-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.unread-badge {
  background: #ff5f56;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 7px;
  border-radius: 10px;
}

.owner-badge {
  background: gold;
  color: #000;
  font-size: 9px;
  font-weight: bold;
  padding: 1px 4px;
  border-radius: 4px;
}

.aero-drawer {
  position: absolute;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100%;
  background: var(--bg-sidebar);
  z-index: 100;
  box-shadow: 5px 0 25px rgba(0,0,0,0.5);
  transition: left 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.aero-drawer.open {
  left: 0;
}

.drawer-profile {
  padding: 20px;
  background: var(--bg-card);
  position: relative;
}

.drawer-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 16px;
  cursor: pointer;
}

/* CORRECTION DE L'ENCADRÉ DE L'AVATAR DE PROFIL */
.drawer-avatar {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: var(--bg-main);
  border: 2px solid var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.drawer-name {
  font-weight: bold;
  font-size: 16px;
}

.drawer-id {
  font-size: 12px;
  color: var(--text-sub);
}

.drawer-menu-list {
  flex: 1;
  padding: 15px 0;
  display: flex;
  flex-direction: column;
}

.drawer-item {
  padding: 12px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.drawer-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.drawer-footer-info {
  padding: 15px 20px;
  font-size: 11px;
  color: var(--text-sub);
  border-top: 1px solid var(--border-color);
}

.aero-chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
}

.chat-tabs-bar {
  display: flex;
  background: var(--bg-sidebar);
  overflow-x: auto;
  border-bottom: 1px solid var(--border-color);
}

.chat-tab {
  padding: 8px 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border-right: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.1);
  opacity: 0.7;
}

.chat-tab.active-tab {
  background: var(--bg-main);
  opacity: 1;
  border-bottom: 2px solid var(--accent-color);
}

.close-tab {
  font-size: 12px;
  opacity: 0.5;
}

.close-tab:hover {
  opacity: 1;
}

.chat-topbar {
  padding: 12px 20px;
  background: var(--bg-sidebar);
  display: flex;
  align-items: center;
  font-weight: bold;
  border-bottom: 1px solid var(--border-color);
}

.mobile-back-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 18px;
  margin-right: 10px;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aero-placeholder-info {
  margin: auto;
  text-align: center;
  color: var(--text-sub);
}

.shield-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.chat-msg-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 65%;
}

.chat-msg-wrapper.sent {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-msg-wrapper.received {
  align-self: flex-start;
  align-items: flex-start;
}

.msg-sender-info {
  font-size: 11px;
  margin-bottom: 3px;
  display: flex;
  gap: 4px;
}

.chat-msg-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.sent .chat-msg-bubble {
  background: var(--accent-color);
  color: #fff;
  border-bottom-right-radius: 2px;
}

.received .chat-msg-bubble {
  background: var(--bg-card);
  color: var(--text-main);
  border-bottom-left-radius: 2px;
}

.chat-bottombar {
  padding: 12px 20px;
  background: var(--bg-sidebar);
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--border-color);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-window {
  width: 400px;
  background: var(--bg-sidebar);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  overflow: hidden;
}

.modal-body {
  padding: 20px;
}

.settings-section {
  margin-bottom: 18px;
}

.settings-section h3 {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sessions-box {
  background: var(--bg-card);
  padding: 10px;
  border-radius: 6px;
  font-size: 12px;
  max-height: 120px;
  overflow-y: auto;
}

/* STYLE MODALE À PROPOS & CRÉDITS */
.about-card-content {
  color: var(--text-main);
}

.credits-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
  padding: 15px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.credit-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.credit-item strong {
  color: var(--text-sub);
}

.credit-item span {
  font-weight: 600;
  color: var(--accent-color);
}

.ringtone-selector-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.ringtone-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px;
  color: var(--text-main);
  cursor: pointer;
  text-align: center;
  font-size: 13px;
  transition: all 0.2s ease;
}

.ringtone-btn small {
  display: block;
  opacity: 0.6;
  font-size: 10px;
  margin-top: 2px;
}

.ringtone-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.ringtone-btn.active {
  background: #007aff;
  border-color: #007aff;
  box-shadow: 0 0 12px rgba(0, 122, 255, 0.4);
  color: #fff;
}

.mac-notif-container {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.mac-notif-popup {
  pointer-events: auto;
  width: 330px;
  background: rgba(246, 246, 246, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.1);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #1d1d1f;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  animation: macSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.mac-notif-popup:hover {
  transform: scale(1.02);
}

@keyframes macSlideIn {
  from {
    opacity: 0;
    transform: translateX(120%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.mac-notif-avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, #e3e3e8, #d1d1d6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: inset 0 0 1px rgba(0,0,0,0.2);
}

.mac-notif-body {
  flex: 1;
  min-width: 0;
}

.mac-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.mac-notif-title {
  font-weight: 600;
  font-size: 13px;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mac-notif-sub {
  font-size: 11px;
  color: #007aff;
  font-weight: 500;
  margin-bottom: 2px;
}

.mac-notif-text {
  font-size: 12px;
  color: #48484a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

@media (max-width: 768px) {
  .aero-sidebar {
    width: 100%;
  }
  .mobile-chat-open .aero-sidebar {
    display: none;
  }
  .mobile-chat-open .aero-chat-main {
    display: flex;
  }
  .aero-chat-main {
    display: none;
  }
  .mobile-back-btn {
    display: block;
  }
}
