* { box-sizing: border-box; }

:root {
  --bg-primary: #0f1115;
  --bg-secondary: #151922;
  --bg-card: #1a1f28;
  --bg-card-hover: #1f2633;
  --bg-chat: #1c2230;
  --bg-chat-dark: #171c26;
  --bg-chat-sidebar: #232a3b;
  --bg-chat-content: #2a3245;
  --bg-chat-avatar: #222838;
  --text-primary: #eaeaea;
  --text-secondary: #b0b7c3;
  --border-color: rgba(255, 255, 255, 0.05);
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-elevated: rgba(0, 0, 0, 0.4);
  --accent-blue: #4a9eff;
  --accent-purple: #774aff;
  --accent-green: #2ecc71;
  --gradient-overlay: linear-gradient(135deg, rgba(74, 158, 255, 0.03) 0%, rgba(167, 139, 250, 0.03) 100%);
}

body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-overlay);
  pointer-events: none;
  z-index: 0;
}

header {
  padding: 12px 20px;
  background: var(--bg-secondary);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 4px 20px var(--shadow), 0 1px 0 var(--border-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.home-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  padding: 9px;
  border-radius: 9px;
  transition: all 0.22s;
  flex-shrink: 0;
}

.home-btn:hover {
  background: var(--border-color);
  transform: scale(1.1);
}

.header-search {
  flex: 1;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

#headerSearchInput {
  flex: 1;
  padding: 10px 40px 10px 15px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all 0.3s;
}

#headerSearchInput:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.refresh-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.refresh-btn:hover {
  background: var(--border-color);
  transform: rotate(180deg);
}

.search-settings-btn {
  position: absolute;
  right: 56px;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.hamburger-icon {
  width: 16px;
  height: 2px;
  background: rgba(160, 160, 160, 0.5);
  border-radius: 1px;
  transition: background 0.2s;
}

.search-settings-btn:hover .hamburger-icon {
  background: var(--text-primary);
}

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

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sidebar {
  position: fixed;
  top: 70px;
  left: -320px;
  width: 320px;
  height: calc(100vh - 70px);
  background: var(--bg-secondary);
  box-shadow: 4px 0 20px var(--shadow);
  z-index: 150;
  transition: left 0.3s;
  overflow-y: auto;
}

.sidebar.active {
  left: 0;
}

.sidebar-nav {
  padding: 20px 10px;
}

.sidebar-item {
  display: block;
  padding: 12px 15px;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.2s;
  font-size: 15px;
  margin-bottom: 5px;
}

.sidebar-item:hover {
  background: var(--border-color);
  transform: translateX(-5px);
}

/* Social network items with purple accent */
.sidebar-item[href*="social"],
.sidebar-item[href*="vk"],
.sidebar-item[href*="telegram"],
.sidebar-item[href*="youtube"],
.sidebar-item[href*="instagram"],
.sidebar-item[href*="twitter"],
.sidebar-item[href*="facebook"] {
  position: relative;
}

.sidebar-item[href*="social"]:hover,
.sidebar-item[href*="vk"]:hover,
.sidebar-item[href*="telegram"]:hover,
.sidebar-item[href*="youtube"]:hover,
.sidebar-item[href*="instagram"]:hover,
.sidebar-item[href*="twitter"]:hover,
.sidebar-item[href*="facebook"]:hover {
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.3);
  color: var(--accent-purple);
  box-shadow: 0 0 15px rgba(167, 139, 250, 0.2);
}

.sidebar-item[href*="social"]:hover::before,
.sidebar-item[href*="vk"]:hover::before,
.sidebar-item[href*="telegram"]:hover::before,
.sidebar-item[href*="youtube"]:hover::before,
.sidebar-item[href*="instagram"]:hover::before,
.sidebar-item[href*="twitter"]:hover::before,
.sidebar-item[href*="facebook"]:hover::before {
  content: '🔗';
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 0.8;
}

.sidebar-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sidebar-item.disabled:hover {
  background: none;
  transform: none;
}

.sidebar-divider {
  height: 1px;
  background: var(--border-color);
  margin: 10px 0;
}

.user-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 26px;
}

.user-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px var(--shadow);
}

footer {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  opacity: 0.5;
  margin-top: 20px;
}

@media (max-width: 768px) {
  header {
    font-size: 20px;
    padding: 12px 10px;
    gap: 10px;
  }
  
  .home-btn {
    padding: 6px;
    font-size: 20px;
  }
  
  .header-search {
    max-width: none;
  }
  
  .refresh-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  
  .header-actions {
    gap: 8px;
  }
  
  .user-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
}

.notifications-btn {
  width: 35px;
  height: 35px;
  background: var(--bg-secondary);
  border: none;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.notifications-btn:hover {
  background: var(--border-color);
  transform: scale(1.1);
}

.quick-menu-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
  position: relative;
}

.quick-menu-btn:hover {
  background: var(--border-color);
  transform: scale(1.05);
}

.menu-line {
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Hamburger to Letter "A" animation */
.quick-menu-btn.rotated .menu-line:nth-child(1) {
  transform: rotate(50deg) translate(1px, 0px);
  width: 20px;
}

.quick-menu-btn.rotated .menu-line:nth-child(2) {
  transform: rotate(-50deg) translate(-1px, 0px);
  width: 20px;
}

.quick-menu-btn.rotated .menu-line:nth-child(3) {
  transform: translateY(5px) translateX(0);
  width: 16px;
  opacity: 1;
}

.quick-menu-btn:hover .menu-line {
  background: var(--accent-purple);
}

