/* ==========================================================================
   Sngine-Style Layout CSS for Romândru
   ========================================================================== */

/* --------------------------------------------------------------------------
   Top Header - Slim, Modern Design
   -------------------------------------------------------------------------- */
.site-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(140%) blur(8px);
}

body.light .site-header {
  background: rgba(255, 255, 255, 0.95);
}

body.dark .site-header {
  background: rgba(11, 18, 32, 0.92);
}

.brand {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.3px;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
}

/* Search Bar */
.header-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: transparent;
  color: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

body.light .header-search input {
  background: #f1f5f9;
}

body.dark .header-search input {
  background: rgba(255, 255, 255, 0.05);
}

.header-search input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.header-search svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  opacity: 0.5;
}

/* Header Icons (Notifications, Messages, Friend Requests) */
.header-icons {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.header-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s;
  color: inherit;
  text-decoration: none;
}

.header-icon:hover {
  background: rgba(99, 102, 241, 0.1);
}

body.light .header-icon:hover {
  background: rgba(0, 0, 0, 0.06);
}

.header-icon svg {
  width: 22px;
  height: 22px;
}

/* Badge for notification counts */
.header-icon .badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* User Avatar Dropdown */
.user-dropdown {
  position: relative;
}

.user-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 20px;
  transition: background 0.2s;
}

.user-dropdown-toggle:hover {
  background: rgba(99, 102, 241, 0.1);
}

body.light .user-dropdown-toggle:hover {
  background: rgba(0, 0, 0, 0.06);
}

.user-dropdown-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line);
}

.user-dropdown-initials {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  border: 2px solid var(--line);
}

body.light .user-dropdown-initials {
  background: #e2e8f0;
  color: #475569;
}

body.dark .user-dropdown-initials {
  background: #1e293b;
  color: #94a3b8;
}

.user-dropdown-caret {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}

.user-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 0.5rem 0;
  z-index: 200;
  display: none;
}

body.light .user-dropdown-menu {
  background: #ffffff;
}

body.dark .user-dropdown-menu {
  background: #0f172a;
}

.user-dropdown.is-open .user-dropdown-menu {
  display: block;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  color: inherit;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s;
}

.user-dropdown-item:hover {
  background: rgba(99, 102, 241, 0.08);
}

.user-dropdown-item svg {
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--line);
  margin: 0.5rem 0;
}

/* --------------------------------------------------------------------------
   3-Column Feed Layout (Home Page Only)
   -------------------------------------------------------------------------- */
.feed-3col {
  display: grid;
  grid-template-columns: 280px 1fr 300px;
  gap: 1.25rem;
  max-width: 1400px;
  margin: 0 auto;
}

.col-left,
.col-right {
  align-self: start;
  position: sticky;
  top: 70px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}

/* Hide scrollbar but allow scrolling */
.col-left::-webkit-scrollbar,
.col-right::-webkit-scrollbar {
  width: 0;
}

.col-main .card {
  margin-bottom: 1rem;
}

/* Responsive: Tablet */
@media (max-width: 1200px) {
  .feed-3col {
    grid-template-columns: 240px 1fr;
  }

  .col-right {
    display: none;
  }
}

/* Responsive: Mobile */
@media (max-width: 768px) {
  .feed-3col {
    grid-template-columns: 1fr;
  }

  .col-left,
  .col-right {
    display: none;
  }

  .header-search {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Left Sidebar - Navigation Style
   -------------------------------------------------------------------------- */
.sidebar-profile-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}

.sidebar-profile-card:hover {
  background: rgba(99, 102, 241, 0.08);
}

.sidebar-profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line);
}

.sidebar-profile-initials {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid var(--line);
}

body.light .sidebar-profile-initials {
  background: #e2e8f0;
  color: #475569;
}

body.dark .sidebar-profile-initials {
  background: #1e293b;
  color: #94a3b8;
}

.sidebar-profile-info {
  flex: 1;
  min-width: 0;
}

.sidebar-profile-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile-username {
  font-size: 0.8rem;
  opacity: 0.6;
}

/* Sidebar Navigation Items */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.2s, transform 0.1s;
}

.sidebar-nav-item:hover {
  background: rgba(99, 102, 241, 0.1);
  transform: translateX(2px);
}

body.light .sidebar-nav-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.sidebar-nav-item.active {
  background: rgba(99, 102, 241, 0.15);
  font-weight: 600;
}

body.light .sidebar-nav-item.active {
  background: #e0e7ff;
  color: #4338ca;
}

.sidebar-nav-item svg,
.sidebar-nav-item .nav-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  text-align: center;
}

.sidebar-nav-item .nav-emoji {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}

.sidebar-nav-divider {
  height: 1px;
  background: var(--line);
  margin: 0.5rem 0;
}

/* --------------------------------------------------------------------------
   Right Sidebar Widgets
   -------------------------------------------------------------------------- */
.widget-card {
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

body.light .widget-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

body.dark .widget-card {
  background: var(--card);
  border: 1px solid var(--line);
}

.widget-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
}

.widget-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s;
}

.widget-item:hover {
  opacity: 0.8;
}

.widget-item-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.widget-item-initials {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  flex-shrink: 0;
}

body.light .widget-item-initials {
  background: #e2e8f0;
  color: #475569;
}

body.dark .widget-item-initials {
  background: #1e293b;
  color: #94a3b8;
}

.widget-item-info {
  flex: 1;
  min-width: 0;
}

.widget-item-name {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.widget-item-meta {
  font-size: 0.75rem;
  opacity: 0.6;
}

.widget-see-all {
  display: block;
  text-align: center;
  padding: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #6366f1;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.2s;
}

.widget-see-all:hover {
  background: rgba(99, 102, 241, 0.1);
}

/* Mobile menu toggle override */
.nav-links {
  display: none;
  /* Hidden by default */
}

@media (max-width: 768px) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
  }

  body.menu-open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    width: 100%;
    margin: 0.75rem 0 0 0;
    padding: 1rem;
    border-top: 1px solid var(--line);
  }

  .header-search {
    display: none;
  }

  .header-icons {
    margin-left: auto;
  }
}

@media (min-width: 769px) {
  .menu-toggle {
    display: none;
  }
}