/* ============================================
   ZOPECONNECT — GLOBAL STYLES
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #0f1419;
  --surface: #1a1a24;
  --card: #2a1a1a;
  --border: #3d2a2a;
  --accent: #ff3333;
  --accent2: #ff3333;
  --text: #ffffff;
  --text-secondary: #e5e7eb;
  --muted: #9ca3af;
  --danger: #ff3333;
  --online: #ff3333;
  --sidebar-w: 240px;
  --right-w: 260px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Syne', sans-serif;
  min-height: 100vh;
  transition: background-color 0.4s ease;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
button { cursor: pointer; font-family: 'Syne', sans-serif; transition: var(--transition); }
input, textarea, select { font-family: 'Syne', sans-serif; transition: var(--transition); }

/* ============================================
   APP LAYOUT (3-panel)
   ============================================ */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--right-w);
  min-height: 100vh;
}

/* ============================================
   LEFT SIDEBAR
   ============================================ */
.sidebar {
  background: linear-gradient(180deg, var(--surface) 0%, #1f2937 100%);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.3);
}

.sidebar-logo {
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeInDown 0.5s ease;
}

.sidebar-logo .logo-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent), 0 0 24px rgba(16, 217, 129, 0.4);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.sidebar-logo .logo-text {
  display: flex;
  align-items: center;
  gap: 3px;
  font-weight: 900;
}

.sidebar-logo .logo-text > span:first-child { font-size: 28px; }
.sidebar-logo .logo-text span { color: var(--accent); font-size: 12px; letter-spacing: 0.5px; }

.sidebar-nav {
  padding: 20px 12px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  transition: var(--transition);
  margin-bottom: 2px;
  cursor: pointer;
  position: relative;
}

.nav-item:hover { background: rgba(16, 217, 129, 0.08); color: var(--text); transform: translateX(4px); }
.nav-item.active { background: rgba(16, 217, 129, 0.15); color: var(--accent); border-left: 3px solid var(--accent); padding-left: 9px; }

.nav-item .nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-item .nav-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 16px 12px 8px;
  font-family: 'IBM Plex Mono', monospace;
}

.group-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 2px;
}

.group-item:hover { background: rgba(16, 217, 129, 0.08); transform: translateX(3px); }

.group-avatar {
  width: 30px; height: 30px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.group-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-bottom {
  padding: 12px;
  border-top: 1px solid var(--border);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  padding: 24px;
  overflow-y: auto;
  max-height: 100vh;
  background: linear-gradient(135deg, var(--bg) 0%, #1a2435 50%, var(--bg) 100%);
  animation: fadeIn 0.5s ease;
}

.main-content::-webkit-scrollbar { width: 6px; }
.main-content::-webkit-scrollbar-track { background: transparent; }
.main-content::-webkit-scrollbar-thumb { background: rgba(16, 217, 129, 0.3); border-radius: 3px; }
.main-content::-webkit-scrollbar-thumb:hover { background: rgba(16, 217, 129, 0.5); }

/* ============================================
   RIGHT PANEL
   ============================================ */
.right-panel {
  background: linear-gradient(180deg, var(--surface) 0%, #1f2937 100%);
  border-left: 1px solid var(--border);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.3);
}

.panel-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  font-family: 'IBM Plex Mono', monospace;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: linear-gradient(135deg, var(--card) 0%, rgba(26, 35, 50, 0.8) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
  animation: fadeInUp 0.5s ease;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(16, 217, 129, 0.2);
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(16, 217, 129, 0.05) 0%, rgba(26, 35, 50, 0.9) 100%);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  transition: left 0.3s ease;
  z-index: -1;
}

.btn:hover::before { left: 0; }

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 217, 129, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 217, 129, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--accent);
  background: rgba(16, 217, 129, 0.08);
  color: var(--accent);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: var(--danger);
}

.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* ============================================
   BADGES / TAGS
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  transition: var(--transition);
  animation: slideInRight 0.4s ease;
}

.badge-country {
  background: rgba(16, 217, 129, 0.15);
  color: var(--accent);
  border: 1px solid rgba(16, 217, 129, 0.3);
}

.badge-country:hover {
  background: rgba(16, 217, 129, 0.25);
  box-shadow: 0 0 12px rgba(16, 217, 129, 0.2);
}

.badge-region {
  background: rgba(255, 107, 26, 0.15);
  color: var(--accent2);
  border: 1px solid rgba(255, 107, 26, 0.3);
}

.badge-region:hover {
  background: rgba(255, 107, 26, 0.25);
  box-shadow: 0 0 12px rgba(255, 107, 26, 0.2);
}

.badge-online {
  background: rgba(16, 217, 129, 0.15);
  color: var(--accent);
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group { margin-bottom: 18px; animation: fadeInUp 0.5s ease; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  font-family: 'IBM Plex Mono', monospace;
}

.form-input {
  width: 100%;
  background: rgba(50, 50, 50, 0.7);
  border: 1px solid rgba(200, 20, 20, 0.3);
  border-radius: 8px;
  padding: 12px 14px;
  color: #ffffff;
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
  background: rgba(50, 50, 50, 0.9);
  box-shadow: 0 0 12px rgba(16, 217, 129, 0.2);
}
.form-input::placeholder { color: var(--muted); }

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

/* ============================================
   ONLINE INDICATOR
   ============================================ */
.online-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent), 0 0 16px rgba(16, 217, 129, 0.4);
  flex-shrink: 0;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.offline-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

/* ============================================
   AVATAR
   ============================================ */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-placeholder {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
  background: #e5e7eb;
  color: var(--text);
}

/* ============================================
   PING BADGE
   ============================================ */
.ping-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f3f4f6;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-family: 'IBM Plex Mono', monospace;
  color: #6b7280;
}

.ping-good { color: var(--accent); }
.ping-mid { color: #ffd23f; }
.ping-bad { color: var(--danger); }

/* ============================================
   TOP BAR (inside main content)
   ============================================ */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  animation: slideInDown 0.4s ease;
}

.top-bar-title {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: linear-gradient(135deg, var(--card) 0%, rgba(26, 35, 50, 0.8) 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 13px;
  min-width: 240px;
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
}

.toast.success { border-color: var(--accent); }
.toast.error { border-color: var(--danger); }

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

/* ============================================
   LOADING SPINNER
   ============================================ */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(16, 217, 129, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  box-shadow: 0 0 12px rgba(16, 217, 129, 0.2);
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; transform: scale(1.05); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  animation: fadeIn 0.4s ease;
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  animation: bounce 2s ease infinite;
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 20px;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(16, 217, 129, 0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(16, 217, 129, 0.4); }

/* ============================================
   RESPONSIVE (mobile)
   ============================================ */
@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
  .sidebar { display: none; }
  .right-panel { display: none; }
  .main-content { max-height: unset; }
}

/* ============ ICON OVERRIDES IN NAV ============ */
.nav-item {
  gap: 10px;
}
.nav-item .zc-icon svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Search bar in top of app */
.app-search-bar {
  flex: 1;
  max-width: 380px;
}

/* Post action buttons with icons */
.post-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Syne', sans-serif;
}
.post-action-btn:hover {
  background: rgba(16, 217, 129, 0.1);
  color: var(--accent);
}
.post-action-btn.active {
  color: var(--accent);
  background: rgba(16, 217, 129, 0.15);
}

/* Icon button styling */
.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 7px;
  border-radius: 7px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(16, 217, 129, 0.08);
  transform: scale(1.1);
}

/* SVG icon styling */
svg {
  width: 18px;
  height: 18px;
  display: inline-block;
}

.feat-icon svg {
  width: 24px;
  height: 24px;
}

/* Reaction animations */
@keyframes reactionPop {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); opacity: 1; }
}
.reaction-pop { animation: reactionPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* Smooth text transitions */
* {
  transition-property: background-color, border-color, color, fill, stroke, box-shadow;
  transition-duration: 0.2s;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

button, a, input:not(:focus), .nav-item, .group-item, .icon-btn, .post-action-btn {
  transition: var(--transition);
}
