@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto+Condensed:ital,wght@0,100..900;1,100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'poppins', sans-serif;
  }
  
h1 {
    margin-bottom: 50px;
    text-align: center;
  }
  
body {
    background: #1e1e1e;
    --sidebar-width: 250px;
    transition: margin-left 0.3s ease;
  }

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background: #1b1a1a;
    overflow-y: auto;
    -ms-overflow-style: none;
    padding: 25px 20px;
    transition: transform 0.3s ease;
    justify-content: space-between;
    padding-bottom: 10px;
    z-index: 1000;
    transform: translateX(-100%);
    font-size: 16px;
  }

body.sidebar-open .sidebar {
    transform: translateX(0);
  }

.menu-title span {
    color: white;
    text-align: left;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease, margin-left 0.3s ease;
    padding: 0;
    margin: 5px 0;
    display: none;
  }

.menu-title {
    margin: 5px 0;
  }

body.sidebar-open .menu-title span {
    opacity: 1;
    margin-left: 0;
    display: inline-block;
  }

.sidebar::-webkit-scrollbar {
    display: none;
  }

@supports (scrollbar-width: none) {
  .sidebar {
    scrollbar-width: none;
  }
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 85px;
    height: 80px;
    position: relative;
  }

.sidebar-header img {
    border-radius: 50%;
    transition: opacity 0.3s ease-in-out;
    align-items: center;
    justify-content: center;
  }

.sidebar-links h4 {
    color: #fff;
    font-weight: 500;
    margin: 10px 0;
    white-space: nowrap;
  }

.sidebar-links li a {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    color: #d5d5d5;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    gap: 20px;
  }

.sidebar-links {
    list-style: none;
    padding-right: 18px;
    margin: 0;
  }

.sidebar-links li {
    margin: 2px 1px;
    padding: 6px 2px;
  }

.sidebar-links li a:hover {
    background: #ffffff2d;
    color: #fff;
    border-radius: 4px;
  }

.sidebar-notification-link {
    width: 100%;
    position: relative;
  }

.sidebar-notification-label {
    flex: 1;
    min-width: 0;
  }

.sidebar-nav-dot {
    flex-shrink: 0;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.35);
    align-self: center;
  }

.sidebar-nav-dot--hidden {
    display: none !important;
}

.user-account .user-profile {
    display: flex;
    align-items: center;
    color: white;
  }

.user-profile img {
    width: 30px;
    border-radius: 50%;
    margin-top: -3px;
    border-top: 15px;
    object-fit: cover;
  }

.user-profile h3 {
    font-size: 1rem;
    text-align: center;
    margin-left: 20px;
  }

.user-profile span {
    font-size: 0.775rem;
    font-weight: 500;
    margin-left: 40px;
  }

.user-account {
    white-space: nowrap;
    position: sticky;
    bottom: 0;
    background: inherit;
    z-index: 100;
    padding: -8px;
    margin-top: auto;
  }

#sidebar-status {
    font-size: 0.875rem;
    color: #ccc;
    text-align: left;
  }

.user-account.detail {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

.menu-separator {
    border: #808080 solid 1px;
    width: 100%;
    margin: 8px 0;
    opacity: 1;
  }

.logo-collapsed {
    opacity: 1;
    width: 60px;
    height: 60px;
    position: absolute;
    transition: opacity 0.3s ease-in-out;
    margin-left: -50px;
  }

.logo-expanded {
    opacity: 0;
    width: 200px;
    height: auto;
    position: relative;
    transition: opacity 0.3s ease-in-out;
    margin-top: 10px;
    margin-right: -90px;
  }

body.sidebar-open .logo-collapsed {
    opacity: 0;
  }

body.sidebar-open .logo-expanded {
    opacity: 1;
  }

/* Toggle button with icons */
.sidebar-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: #1b1a1a;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-radius: 4px;
    padding: 0;
    transition: left 0.3s ease;
}

.toggle-open,
.toggle-close {
    width: 24px;
    height: 24px;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.toggle-open {
    opacity: 1;
}

.toggle-close {
    opacity: 0;
    position: absolute;
}

body.sidebar-open .toggle-open {
    opacity: 0;
}

body.sidebar-open .toggle-close {
    opacity: 1;
}

body.sidebar-open .sidebar-toggle {
    left: calc(var(--sidebar-width) + 20px);
}

/* Push content when open */
body.sidebar-open {
    margin-left: var(--sidebar-width);
}

/* Responsive styles ************************************************************************************/
@media (max-width: 768px) {
    body {
        --sidebar-width: 200px;
    }

    .sidebar-header {
        width: 60px;
        height: 60px;
    }

    .logo-collapsed {
        width: 50px;
        height: 50px;
        margin-left: -40px;
    }

    .logo-expanded {
        width: 150px;
        margin-right: -70px;
    }

    .sidebar-links li {
        margin: 1px 0;
        padding: 4px 1px;
    }

    .user-profile h3 {
        font-size: 0.9rem;
        margin-left: 15px;
    }

    .user-profile span {
        font-size: 0.7rem;
        margin-left: 30px;
    }

    .sidebar-toggle {
        top: 10px;
        left: 10px;
        width: 35px;
        height: 35px;
    }

    .toggle-open,
    .toggle-close {
        width: 20px;
        height: 20px;
    }
}

/* Responsive styles */
@media (max-width: 768px) {
  body {
      --sidebar-width: 200px;
  }

  .sidebar {
      --full-width: 100vw; /* Full screen on mobile */
  }

  body.sidebar-open .sidebar {
      width: var(--full-width);
      transform: translateX(0);
  }

  body.sidebar-open {
      margin-left: 0;
      overflow: hidden; /* Prevent background scroll */
  }

  .sidebar-header {
      width: 60px;
      height: 60px;
  }

  .logo-collapsed {
      width: 50px;
      height: 50px;
      margin-left: -40px;
  }

  .logo-expanded {
      width: 150px;
      margin-right: -70px;
  }

  .sidebar-links li {
      margin: 1px 0;
      padding: 4px 1px;
  }

  .user-profile h3 {
      font-size: 0.9rem;
      margin-left: 15px;
  }

  .user-profile span {
      font-size: 0.7rem;
      margin-left: 30px;
  }

  .sidebar-toggle {
      top: 10px;
      left: 10px;
      width: 35px;
      height: 35px;
  }

  .toggle-open,
  .toggle-close {
      width: 20px;
      height: 20px;
  }

  body.sidebar-open .sidebar-toggle {
      left: auto;
      right: 30px; /* Move to top-right for full-screen close */
  }

  /* Adjust sidebar content for full-width */
  .sidebar {
      padding: 20px;
      justify-content: flex-start;
      padding-bottom: 20px;
  }

  .menu-title span {
      font-size: 14px;
  }

  .sidebar-links li a {
      gap: 15px;
      padding: 12px 8px;
  }

  /* Scroll full nav on small screens; respect safe areas */
  .sidebar {
      max-height: 100vh;
      max-height: 100dvh;
      padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
      -webkit-overflow-scrolling: touch;
  }
}

/*logout button******************************************************************************/





.logout-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    padding: 32px 36px 28px;
    width: min(92vw, 380px);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
    text-align: center;
    z-index: 1000;
    border-radius: 12px;
    color: #111111;
    border: 1px solid #e5e5e5;
}

#logout-btn {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    color: #d5d5d5;
    font-weight: 500;
    text-decoration: none;
    gap: 20px;
    border-radius: 4px;
    background: inherit; /* Matches sidebar background */
    border: none; /* Removes any border */
    cursor: pointer;
    width: 100%;
    font-size: 16px;
}

#logout-btn:hover {
    background: #ffffff2d;
    color: #fff;
    width: 100%;
    transition: all 0.3s ease;
   
}


.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
}

.logout-popup p {
    font-size: 15px;
    font-weight: 500;
    margin: 12px 0 16px;
    color: #1a1a1a;
    line-height: 1.45;
}

.logout-popup label {
    font-size: 13px;
    color: #444444;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.logout-popup-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 18px;
}

.yes-btn {
    background-color: #111111;
    padding: 10px 22px;
    border-radius: 8px;
    color: #ffffff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.yes-btn:hover {
    background-color: #333333;
}

.no-btn {
    background-color: #ffffff;
    padding: 10px 22px;
    border-radius: 8px;
    color: #111111;
    border: 1px solid #cccccc;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
}

.no-btn:hover {
    background-color: #f5f5f5;
}

#logout-popup img {
    width: 48px;
    height: 48px;
    margin: 0 auto 8px;
    display: block;
    object-fit: contain;
}

/* *********************************************************8************************************* */

.profile-pic-container {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #ccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Profile Image */
.profile-pic-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hidden File Input */
#upload-pic {
    display: none;
}

/* Upload Overlay */
.upload-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

/* Show Overlay on Hover */
.profile-pic-container:hover .upload-overlay {
    opacity: 1;
}


.reset-btn {
  margin-top: 10px;
  padding: 5px 10px;
  background-color: #444;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.reset-btn:hover {
  background-color: #555;
}

/* Expand/Collapse functionality for nested menus */
.sidebar-links li.has-children {
  position: relative;
}

.sidebar-links li.has-children > a {
  position: relative;
  cursor: pointer;
}

.expand-arrow {
  margin-left: auto;
  font-size: 10px;
  transition: transform 0.3s ease;
  color: #d5d5d5;
  display: inline-block;
}

.sidebar-links li.has-children.expanded > a .expand-arrow {
  transform: rotate(90deg);
}

.nested-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  padding-left: 20px;
}

.sidebar-links li.has-children.expanded .nested-menu {
  max-height: 200px;
  opacity: 1;
  margin-top: 4px;
}

/* Insight submenu only: tall enough to list links, scroll when needed, visible scrollbar while open */
.sidebar-links li.insight-nested.expanded .nested-menu {
  max-height: min(52vh, 380px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(160, 160, 160, 0.95) rgba(36, 36, 36, 0.95);
  padding-right: 6px;
  -webkit-overflow-scrolling: touch;
}

.sidebar-links li.insight-nested.expanded .nested-menu::-webkit-scrollbar {
  width: 8px;
}

.sidebar-links li.insight-nested.expanded .nested-menu::-webkit-scrollbar-track {
  background: rgba(42, 42, 42, 0.95);
  border-radius: 4px;
  margin: 4px 0;
}

.sidebar-links li.insight-nested.expanded .nested-menu::-webkit-scrollbar-thumb {
  background: rgba(120, 120, 120, 0.95);
  border-radius: 4px;
  border: 2px solid rgba(42, 42, 42, 0.95);
}

.sidebar-links li.insight-nested.expanded .nested-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(175, 175, 175, 1);
}

.nested-menu li {
  margin: 2px 0;
  padding: 4px 2px;
}

.nested-menu li a {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  color: #b5b5b5;
  font-weight: 400;
  white-space: nowrap;
  text-decoration: none;
  gap: 20px;
  font-size: 0.9em;
}

.nested-menu li a:hover {
  background: #ffffff1a;
  color: #fff;
  border-radius: 4px;
}

/* Hide nested menu when sidebar is collapsed */
body:not(.sidebar-open) .nested-menu {
  display: none;
}

body:not(.sidebar-open) .expand-arrow {
  display: none;
}

/* Push main content below toggle button + logo on small screens */
@media (max-width: 768px) {
  .content,
  .main-card,
  .settings-wrapper,
  .profile-wrapper,
  .notification-wrapper,
  .content-wrapper,
  .container,
  main.content {
    padding-top: 60px !important;
  }

  /* Hide flip-to-daily button when sidebar is open on mobile */
  body.sidebar-open .flip-to-daily {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .content,
  .main-card,
  .settings-wrapper,
  .profile-wrapper,
  .notification-wrapper,
  .content-wrapper,
  .container,
  main.content {
    padding-top: 55px !important;
  }
}