/** layout.css === contains the main layout of Salmart **/

.main-layout {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 10px;
}

.header-section {
  position: fixed;
  display: flex;
  justify-content: space-around;
  padding: 20px;
  top: 0;
  height: 50px;
  text-align: center;
  align-items: center;
}

.feed {
  flex: 1;
  max-width: 600px;
  min-width: 300px;
}

/* ===========================
   Modern Sidebar Styles
   =========================== */

/* Overlay Background */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 19999;
  animation: fadeIn 0.3s ease-out;
}

.sidebar-overlay.active {
  display: block;
}

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

/* Sidebar Container */
.modern-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 85%;
  max-width: 360px;
  height: 100vh;
  background: #ffffff;
  z-index: 20000;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 24px rgba(0, 0, 0, 0.15);
}

.modern-sidebar.active {
  transform: translateX(0);
}

/* Sidebar Header */
.sidebar-header {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  padding: 20px;
  color: white;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  flex-shrink: 0;
}

.sidebar-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.2s;
}

.sidebar-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  padding-right: 40px;
}

.sidebar-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sidebar-user-info h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.sidebar-user-info p {
  margin: 4px 0 0 0;
  font-size: 13px;
  opacity: 0.9;
}

/* Sidebar Content */
.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.sidebar-content::-webkit-scrollbar {
  width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Navigation Sections */
.sidebar-section {
  margin-bottom: 8px;
}

.sidebar-section-title {
  padding: 12px 20px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #65676b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  margin: 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: #050505;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s;
  position: relative;
}

.sidebar-nav a:hover {
  background: #f0f2f5;
}

.sidebar-nav a.active {
  background: #e7f3ff;
  color: #28a745;
}

.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #28a745;
}

.sidebar-nav i {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #65676b;
  flex-shrink: 0;
}

.sidebar-nav a.active i {
  color: #28a745;
}

.sidebar-nav a:hover i {
  color: #28a745;
}

/* Badge for notifications */
.nav-badge {
  margin-left: auto;
  background: #28a745;
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* Divider */
.sidebar-divider {
  height: 1px;
  background: #e4e6eb;
  margin: 8px 0;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid #e4e6eb;
  background: #f8f9fa;
  flex-shrink: 0;
}

.sidebar-footer-info {
  font-size: 11px;
  color: #65676b;
  text-align: center;
  line-height: 1.6;
  margin-bottom: 8px;
}

.sidebar-footer-info a {
  color: #28a745;
  text-decoration: none;
}

.sidebar-footer-info a:hover {
  text-decoration: underline;
}

.sidebar-footer-brand {
  font-size: 10px;
  color: #a0a3a8;
  text-align: center;
}

/* Logout Button */
.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: #dc3545;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s;
  border-radius: 8px;
  margin: 8px 12px;
  background: #fff5f5;
  border: 1px solid #ffebee;
}

.sidebar-logout:hover {
  background: #ffe0e0;
  border-color: #ffcdd2;
}

.sidebar-logout i {
  font-size: 20px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Desktop Sidebar Styles */
@media (min-width: 900px) {
  .modern-sidebar {
    width: 280px;
    max-width: 280px;
    position: static;
    transform: translateX(0);
    height: calc(100vh - 70px);
    margin-top: 70px;
    border-radius: 0;
    box-shadow: none;
    border-right: 1px solid #e4e6eb;
  }

  .sidebar-overlay {
    display: none !important;
  }

  .sidebar-close {
    display: none;
  }

  .sidebar-header {
    background: white;
    color: #050505;
    border-bottom: 1px solid #e4e6eb;
  }

  .sidebar-avatar {
    border-color: #e4e6eb;
  }

  .sidebar-user-info h3 {
    color: #050505;
    text-shadow: none;
  }

  .sidebar-user-info p {
    color: #65676b;
  }
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .modern-sidebar {
    width: 90%;
  }

  .sidebar-nav a {
    padding: 10px 16px;
  }
}

/* No scroll when sidebar is open on mobile */
body.sidebar-open {
  overflow: hidden;
}

@media (min-width: 900px) {
  body.sidebar-open {
    overflow: auto;
  }
}

.sidebar {
  width: 200px;
  height: calc(100vh - 80px);
  position: fixed;
  top: 100px;
  z-index: 1;
  padding-top: 40px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  background: #fff;
  overflow: hidden;
}

.sidebar.left {
  left: 0;
}

.sidebar.right {
  right: 0;
}

.sidebar iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.side-bar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20000;
  background-color: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 0 10px #ddd;
  height: 100vh;
  width: 70%;
}

.side-bar ul {
  list-style: none;
  padding-top: 20px;
  margin-left: 5px;
}

.side-bar li {
  margin-bottom: 10px;
  border: 0.1px solid #fff;
  padding: 10px;
  border-end-end-radius: 20px;
  background-color: #fff;
  box-shadow: 0 0 10px #ddd;
  margin-right: 3px;
}

.side-bar .active {
  color: #ddd;
}

.side-bar a {
  text-decoration: none;
  color: var(--primary-color);
  padding-right: 10%;
}

.side-bar i {
  margin-right: 20px;
}

.profile-sec {
  width: 100%;
  border-bottom: 0.1px solid #fff;
  padding-bottom: 5px;
  display: flex;
  box-shadow: 0 0 10px #ddd;
}

.profile-sec img {
  border: 0.1px solid #fff;
  box-shadow: 0 0 10px #ddd;
  border-radius: 100%;
  width: 45px;
  height: 45px;
  object-fit: cover;
  margin-left: 5px;
  margin-top: 10px;
}

.menu-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 20px;
  height: 15px;
  cursor: pointer;
  position: fixed;
  z-index: 2;
  margin-bottom: 9px;
  margin-left: 20px;
  margin-top: 20px;
}

.menu-icon div {
  width: 100%;
  height: 2px;
  background-color: var(--primary-color);
  border-radius: 2px;
  text-align: center;
}

.category-filter {
  top: 70px;
  z-index: 80;
  background: #fff;
  width: 100vw;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  margin: 0 auto;
}

.category-scroll {
  display: inline-flex;
  overflow-x: auto;
  gap: 8px;
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-scroll::-webkit-scrollbar {
  display: none;
}

.category-btn {
  flex: 0 auto;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid #e0e0e0;
  background-color: #f8f9fa;
  color: #333;
  font-size: 12px;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  white-space: nowrap;
}

.category-btn:hover {
  background-color: #e9ecef;
}

.category-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.category-scroll-wrapper {
  display: flex;
  justify-content: center;
  overflow-x: auto;
}

.create-post-container {
  text-align: center;
  position: relative;
  align-items: center;
  margin: 0 auto;
  box-shadow: 0 0 10px #ddd;
  padding: 10px 0;
  border: 1px solid #fff;
}

.post-input {
  margin-bottom: 0;
  border: 1px solid white;
  width: 48.5%;
  height: 40px;
  margin-top: 70px;
  box-shadow: 0 0 10px #ddd;
  border-radius: 30px;
  color: grey;
}

/* Responsive Design */
@media (min-width: 900px) {
  .main-layout {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 10px;
  }

  .sidebar {
    display: block;
    width: 370px;
    height: 100vh;
    position: fixed;
    top: 100px;
    z-index: 0;
    margin-top: -40px;
    padding-top: 60px;
    padding-bottom: 60px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    background: #fff;
    overflow: hidden;
  }

  /* Left sidebar */
  .sidebar.left {
    left: 0;
  }

  /* Right sidebar */
  .sidebar.right {
    right: 0;
  }

  .feed {
    flex: 1;
    max-width: 700px;
    min-width: 300px;
  }

  .category-scroll-wrapper {
    margin: 0 auto;
  }

  .category-filter {
  }
}

@media (max-width: 899px) {
  .sidebar {
    display: none;
  }
  .feed {
    padding: 10px;
  }
}
