/* Main Application Layout CSS - Meetzy Client 1:1 Pixel-Perfect */
:root {
  --bg-primary: #f1f5f9;
  --bg-sidebar: #166861;
  --bg-subpanel: #ffffff;
  --bg-chat: #eef2f5;
  --bg-header: #ffffff;
  --text-main: #0f172a;
  --text-sub: #475569;
  --msg-in-bg: #ffffff;
  --msg-in-text: #1e293b;
  --msg-out-bg: #166861;
  --msg-out-text: #ffffff;
  --border-color: #e2e8f0;
}

body.dark-theme {
  --bg-primary: #0f172a;
  --bg-sidebar: #093437;
  --bg-subpanel: #1e293b;
  --bg-chat: #0f172a;
  --bg-header: #1e293b;
  --text-main: #f8fafc;
  --text-sub: #cbd5e1;
  --msg-in-bg: #334155;
  --msg-in-text: #f8fafc;
  --msg-out-bg: #166861;
  --msg-out-text: #ffffff;
  --border-color: #334155;
}

* {
  box-sizing: border-box !important;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

body, html {
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
  background-color: var(--bg-primary);
  color: var(--text-main);
}

#app {
  display: flex !important;
  width: 100vw !important;
  height: 100vh !important;
  overflow: hidden !important;
}

/* 1. SOL DİKEY MENÜ */
.sidebar-nav {
  width: 64px !important;
  min-width: 64px !important;
  max-width: 64px !important;
  height: 100vh !important;
  background-color: var(--bg-sidebar) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  padding: 16px 0 !important;
  z-index: 100 !important;
  flex-shrink: 0 !important;
}

.sidebar-logo {
  width: 40px !important;
  height: 40px !important;
  background: #ffffff !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-bottom: 20px !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
}

.sidebar-logo svg {
  width: 24px;
  height: 24px;
  fill: #166861;
}

.sidebar-menu {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  width: 100% !important;
  align-items: center !important;
}

.nav-item {
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: rgba(255, 255, 255, 0.75) !important;
  cursor: pointer !important;
  position: relative !important;
  flex-shrink: 0 !important;
}

.nav-item:hover, .nav-item.active {
  background-color: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
}

.nav-item svg {
  width: 22px !important;
  height: 22px !important;
}

/* 2. İKİNCİL YAN PANEL */
.sub-panel {
  width: 320px !important;
  min-width: 320px !important;
  max-width: 320px !important;
  height: 100vh !important;
  background-color: var(--bg-subpanel) !important;
  border-right: 1px solid var(--border-color) !important;
  display: flex !important;
  flex-direction: column !important;
  flex-shrink: 0 !important;
  overflow: hidden !important;
}

.user-profile-bar {
  height: 64px !important;
  min-height: 64px !important;
  padding: 0 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-bottom: 1px solid var(--border-color) !important;
  flex-shrink: 0 !important;
}

.user-profile-info {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  min-width: 0 !important;
}

.user-avatar-lg {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
}

.user-name-text {
  font-weight: 700 !important;
  font-size: 14px !important;
  color: var(--text-main) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-bio-text {
  font-size: 11px !important;
  color: var(--text-sub) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-sub);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background-color: rgba(22, 104, 97, 0.1);
  color: #166861;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.status-section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.status-title {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: var(--text-sub) !important;
  margin-bottom: 8px;
}

.status-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.status-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.status-ring {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 2px solid #166861;
  padding: 2px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-label {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: var(--text-main) !important;
  margin-top: 4px;
}

.my-status-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: #166861;
  color: #fff;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

#sub-panel-content {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-y: auto !important;
}

.panel-header {
  padding: 14px 16px 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.panel-title {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--text-main) !important;
}

.filter-pills {
  display: flex;
  gap: 6px;
  padding: 8px 16px 14px 16px;
  flex-shrink: 0;
}

.filter-pill {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background-color: rgba(148, 163, 184, 0.15);
  color: var(--text-sub);
  border: none;
  cursor: pointer;
}

.filter-pill.active {
  background-color: #166861 !important;
  color: #ffffff !important;
}

.item-list {
  flex: 1 !important;
  overflow-y: auto !important;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
}

.list-item:hover, .list-item.active {
  background-color: rgba(22, 104, 97, 0.15);
}

.avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.avatar-img {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
}

.online-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background-color: #10b981;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.item-content {
  flex: 1;
  min-width: 0;
}

.item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.item-name {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.dark-theme .item-name {
  color: #f8fafc !important;
}

.item-time {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: var(--text-sub) !important;
}

.item-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-snippet {
  font-size: 12px !important;
  color: var(--text-sub) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.unread-badge {
  background-color: #166861;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  padding: 2px 6px;
  min-width: 18px;
  text-align: center;
}

/* 3. SAĞ CHAT ALANI */
.chat-view {
  flex: 1 !important;
  min-width: 0 !important;
  height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  background-color: var(--bg-chat) !important;
  position: relative !important;
  overflow: hidden !important;
}

.chat-wallpaper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.04;
  pointer-events: none;
  background-image: radial-gradient(#166861 1px, transparent 1px);
  background-size: 16px 16px;
}

.chat-header {
  height: 64px !important;
  min-height: 64px !important;
  background-color: var(--bg-header) !important;
  border-bottom: 1px solid var(--border-color) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 20px !important;
  z-index: 10 !important;
  flex-shrink: 0 !important;
}

.chat-user-details {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.chat-user-name {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--text-main) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-user-status {
  font-size: 12px;
  color: #10b981;
}

.typing-text {
  color: #166861;
  font-weight: 600;
  font-style: italic;
}

.chat-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.message-feed {
  flex: 1 !important;
  overflow-y: auto !important;
  padding: 20px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  z-index: 5 !important;
}

.date-divider {
  align-self: center;
  background: var(--bg-header);
  color: var(--text-sub);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin: 8px 0;
}

.msg-bubble {
  max-width: 480px !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 12px !important;
  padding: 10px 14px !important;
  font-size: 14px !important;
  position: relative !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08) !important;
  word-wrap: break-word !important;
}

.msg-incoming {
  align-self: flex-start !important;
  background-color: var(--msg-in-bg) !important;
  color: var(--msg-in-text) !important;
  border-bottom-left-radius: 2px !important;
}

.msg-outgoing {
  align-self: flex-end !important;
  background-color: var(--msg-out-bg) !important;
  color: var(--msg-out-text) !important;
  border-bottom-right-radius: 2px !important;
}

.msg-image {
  max-width: 260px !important;
  max-height: 180px !important;
  width: 100% !important;
  height: auto !important;
  border-radius: 8px !important;
  object-fit: cover !important;
  display: block !important;
  margin-bottom: 4px !important;
}

.chat-input-bar {
  height: 64px !important;
  min-height: 64px !important;
  background-color: var(--bg-header) !important;
  border-top: 1px solid var(--border-color) !important;
  padding: 0 20px !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  z-index: 10 !important;
  flex-shrink: 0 !important;
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.chat-input-field {
  flex: 1 !important;
  border: 1px solid var(--border-color) !important;
  outline: none !important;
  background-color: var(--bg-primary) !important;
  padding: 10px 16px !important;
  border-radius: 24px !important;
  font-size: 14px !important;
  color: var(--text-main) !important;
}

.send-btn {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  background-color: #166861 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
}
