@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

/* CSS Reset */
*,
*::after,
*::before {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

*,
button,
input,
select,
textarea {
  font-family: 'Roboto', sans-serif;
}

/* Variables */
:root {
  --primary: hsl(0, 0%, 100%);
  --secondary: hsl(0, 0%, 98%);
  --border: hsl(0, 0%, 86%);

  --story-border: hsl(0, 0%, 78%);
  --img-border: hsla(0, 0%, 0%, 0.1);

  --text-dark: hsl(0, 0%, 15%);
  --text-light: hsl(0, 0%, 60%);

  --like: hsl(355, 82%, 61%);
  --link: hsl(204, 100%, 48%);

  --header-height: 44px;
  --nav-height: 44px;
  --sidebar-width: 245px;
}

:root.darkTheme {
  --primary: hsl(0, 0%, 0%);
  --secondary: hsl(0, 0%, 2%);
  --border: hsl(0, 0%, 15%);

  --story-border: hsl(0, 0%, 44%);
  --img-border: hsla(0, 0%, 100%, 0.1);

  --text-dark: hsl(0, 0%, 98%);
  --text-light: hsl(0, 0%, 60%);
}

/* General Styles */
body {
  min-height: 100vh;
  background-color: var(--primary);
  display: flex;
  overflow-y: auto;
}

svg {
  display: block;
}

img {
  max-width: 100%;
}

/* Desktop Sidebar Navigation */
.sidebar-nav {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--primary);
  border-right: 1px solid var(--border);
  z-index: 1000;
  display: none;
}

.sidebar-nav__content {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 32px 12px 24px;
  overflow-y: auto;
}

.sidebar-nav__logo {
  margin-bottom: 0px;
  padding: 0 16px;
}

.sidebar-nav__logo-link {
  text-decoration: none;
}

.sidebar-nav__logo img {
  height: 192px;
  width: auto;
  max-width: 100%;
  display: block;
  /* Light theme: make logo dark */
  filter: brightness(0.2);
}

/* Dark theme: make logo light */
:root.darkTheme .sidebar-nav__logo img {
  filter: brightness(5) invert(1);
}

.sidebar-nav__menu {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  min-height: 0;
}

.sidebar-nav__item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-dark);
  font-size: 16px;
  font-weight: 400;
  transition: background-color 0.2s ease;
}

.sidebar-nav__item:hover {
  background-color: var(--secondary);
}

/* Date Navigation Styles */
.sidebar-nav__section {
  margin-top: 32px;
}

.sidebar-nav__section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  padding: 8px 16px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-nav__year {
  margin-bottom: 4px;
}

.sidebar-nav__year-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  color: var(--text-dark);
  text-decoration: none;
  border-radius: 8px;
  transition: background-color 0.2s ease;
  font-weight: 500;
}

.sidebar-nav__year-link:hover {
  background-color: var(--secondary);
}

.sidebar-nav__year-link svg {
  flex-shrink: 0;
}

.sidebar-nav__count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-light);
  font-weight: 400;
}

.sidebar-nav__months {
  margin-left: 16px;
  border-left: 1px solid var(--border);
  padding-left: 16px;
  margin-top: 8px;
}

.sidebar-nav__month-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  color: var(--text-dark);
  text-decoration: none;
  border-radius: 6px;
  transition: background-color 0.2s ease;
  font-size: 14px;
  margin-bottom: 2px;
}

.sidebar-nav__month-link:hover {
  background-color: var(--secondary);
}

.sidebar-nav__month-link .sidebar-nav__count {
  margin-left: 8px;
}

.sidebar-nav__item--active {
  font-weight: 700;
}

.sidebar-nav__profile {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
}

.sidebar-nav__profile::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  border: 1px solid var(--img-border);
  border-radius: 50%;
}

.sidebar-nav__bottom {
  margin-top: auto;
  padding: 16px 0;
}

.sidebar-nav__footer-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}

.sidebar-nav__footer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-dark);
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.sidebar-nav__footer-btn:hover {
  background-color: var(--secondary);
  color: var(--text-dark);
}

.sidebar-nav__footer-btn--active {
  background-color: var(--link);
  color: white;
}

.sidebar-nav__footer-btn--active:hover {
  background-color: var(--link);
  color: white;
}

/* Mobile footer buttons - mirror desktop styles */
.side-menu__footer-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

.side-menu__footer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-dark);
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.side-menu__footer-btn:hover {
  background-color: var(--secondary);
  color: var(--text-dark);
}

.side-menu__footer-btn--active {
  background-color: var(--link);
  color: white;
}

.side-menu__footer-btn--active:hover {
  background-color: var(--link);
  color: white;
}

/* Mobile Menu Styles */
.header__menu-button {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-dark);
  transition: background-color 0.2s ease;
}

/* Hide mobile menu on desktop */
@media (min-width: 1024px) {
  .mobile-menu-overlay {
    display: none !important;
  }
}

.header__menu-button:hover {
  background-color: var(--secondary);
}

.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0);
  z-index: 1000;
  pointer-events: none;
  transition: background-color 0.3s ease;
  display: block;
}

.mobile-menu-overlay--active {
  background-color: rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  height: 100%;
  background-color: var(--primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.mobile-menu-overlay--active .mobile-menu {
  transform: translateX(0);
}

.mobile-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  min-height: var(--header-height);
  background-color: var(--primary);
}

.mobile-menu__logo img {
  height: 32px;
}

.mobile-menu__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-dark);
  transition: background-color 0.2s ease;
}

.mobile-menu__close:hover {
  background-color: var(--secondary);
}

.mobile-menu__content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.mobile-menu__section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.mobile-menu__year {
  margin-bottom: 12px;
}

.mobile-menu__year-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.mobile-menu__year-link:hover {
  background-color: var(--secondary);
}

.mobile-menu__item--active {
  background-color: var(--link);
  color: white;
}

.mobile-menu__item--active:hover {
  background-color: var(--link);
  color: white;
}

.mobile-menu__count {
  font-size: 14px;
  color: var(--text-light);
  margin-left: auto;
}

.mobile-menu__item--active .mobile-menu__count {
  color: rgba(255, 255, 255, 0.8);
}

.mobile-menu__months {
  margin-left: 28px;
  margin-top: 8px;
}

.mobile-menu__month-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-radius: 6px;
  color: var(--text-dark);
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.2s ease;
  margin-bottom: 4px;
}

.mobile-menu__month-link:hover {
  background-color: var(--secondary);
}

.mobile-menu__footer {
  border-top: 1px solid var(--border);
  padding: 20px;
}

.mobile-menu__footer-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.mobile-menu__footer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-dark);
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.mobile-menu__footer-btn:hover {
  background-color: var(--secondary);
  color: var(--text-dark);
}

.mobile-menu__footer-btn--active {
  background-color: var(--link);
  color: white;
}

.mobile-menu__footer-btn--active:hover {
  background-color: var(--link);
  color: white;
}

/* Collapsible Year Navigation */
.sidebar-nav__year-header {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sidebar-nav__year-toggle,
.mobile-menu__year-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-light);
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.sidebar-nav__year-toggle:hover,
.mobile-menu__year-toggle:hover {
  color: var(--text-dark);
}

.sidebar-nav__chevron,
.mobile-menu__chevron {
  transition: transform 0.2s ease;
}

.sidebar-nav__year-toggle--expanded .sidebar-nav__chevron,
.mobile-menu__year-toggle--expanded .mobile-menu__chevron {
  transform: rotate(90deg);
}

.sidebar-nav__year-link {
  flex: 1;
  min-width: 0;
}

.mobile-menu__year-header {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mobile-menu__year-link {
  flex: 1;
  min-width: 0;
}

.sidebar-nav__months,
.mobile-menu__months {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.sidebar-nav__months--expanded,
.mobile-menu__months--expanded {
  max-height: 500px;
}

/* Enhanced Active State Styling */
.sidebar-nav__item--active,
.mobile-menu__item--active {
  background-color: var(--link) !important;
  color: white !important;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(52, 144, 220, 0.3);
}

.sidebar-nav__item--active:hover,
.mobile-menu__item--active:hover {
  background-color: var(--link) !important;
  color: white !important;
}

.sidebar-nav__item--active .sidebar-nav__count,
.mobile-menu__item--active .mobile-menu__count {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 500;
}

.sidebar-nav__item--active svg,
.mobile-menu__item--active svg {
  color: white !important;
}

/* Year link when it has active month */
.sidebar-nav__year--has-active-month .sidebar-nav__year-link,
.mobile-menu__year--has-active-month .mobile-menu__year-link {
  background-color: rgba(52, 144, 220, 0.1);
  border-left: 3px solid var(--link);
  padding-left: 13px;
}

/* Search Functionality */
.sidebar-nav__search,
.mobile-menu__search {
  position: relative;
  margin-bottom: 16px;
}

.sidebar-nav__search-input,
.mobile-menu__search-input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: var(--secondary);
  color: var(--text-dark);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.sidebar-nav__search-input:focus,
.mobile-menu__search-input:focus {
  border-color: var(--link);
  background-color: var(--primary);
}

.sidebar-nav__search-input::placeholder,
.mobile-menu__search-input::placeholder {
  color: var(--text-light);
}

.sidebar-nav__search-icon,
.mobile-menu__search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.sidebar-nav__section {
  margin-bottom: 24px;
}

.mobile-menu__section {
  margin-bottom: 24px;
}

/* Theme toggle icons */
.header__theme-button-sun {
  display: none;
}
.header__theme-button-moon {
  display: unset;
}
:root.darkTheme .header__theme-button-sun {
  display: unset;
}
:root.darkTheme .header__theme-button-moon {
  display: none;
}

/* Mobile Header - Hidden on Desktop */
.header {
  width: 100%;
  height: var(--header-height);
  background-color: var(--primary);
  display: flex;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2;
  border-bottom: 1px solid var(--border);
}

.header__content {
  width: 100%;
  max-width: 975px;
  padding: 0 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header__buttons {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 80px;
}

.header__logo {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.header__logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.header__logo img {
  height: 112px;
  max-width: 480px;
  object-fit: contain;
  display: block;
  filter: brightness(0) invert(0);
  transition: filter 0.2s ease;
  transform: translateY(9px);
}

:root.darkTheme .header__logo img {
  filter: brightness(0) invert(1);
}

.header__theme-button {
  background-color: transparent;
  border: none;
  cursor: pointer;
}

.header__search {
  width: 216px;
  height: 28px;
  display: none;
  align-items: center;
  position: relative;
}

.header__search svg {
  width: 12px;
  height: 12px;
  position: absolute;
  left: 8px;
}

.header__search input {
  width: 100%;
  height: 100%;
  background-color: var(--secondary);
  padding: 4px 10px 4px 28px;
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
  font-size: 12px;
  font-weight: 300;
  text-decoration: none;
  color: var(--text-light);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.header__search input:focus {
  color: var(--text-dark);
}

/* Main Container */
.main-container {
  flex: 1;
  min-height: 100vh;
  margin-top: var(--header-height);
  margin-bottom: var(--nav-height);
  background-color: var(--primary);
}

.content-container {
  width: 100%;
  max-width: 935px;
  margin: 0 auto;
  display: flex;
  padding: 0 0 8px;
}

.content {
  width: 100%;
  max-width: 614px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* Stories */
.stories {
  width: 100%;
  background-color: var(--primary);
  padding: 16px 0;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  display: none;
}

.stories::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 1px;
  background-color: var(--border);
}

.stories__content {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 16px;
  padding: 0 16px;
  position: relative;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

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

/* Posts */
.posts {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

/* Post */
.post {
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 24px;
}

.post__header {
  background-color: var(--primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
}

.post__profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.post__user {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  text-decoration: none;
  text-transform: lowercase;
}

.post__user:hover {
  text-decoration: underline;
}

.post__more-options {
  background-color: transparent;
  border: none;
  cursor: pointer;
}

.post__content {
  display: flex;
  position: relative;
}

.post__medias {
  display: flex;
  overflow-y: hidden;
  overflow-x: auto;
  width: 100%;
  scroll-snap-type: both mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

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

.post__media {
  width: 100%;
  flex: none;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.post__footer {
  background-color: var(--primary);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 8px 12px;
}

.post__buttons {
  display: flex;
  position: relative;
}

.post__button {
  background-color: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.post__button--align-right {
  margin-left: auto;
}

.post__indicators {
  display: flex;
  align-items: center;
  gap: 4px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -100%);
}

.post__indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--text-light);
}

.post__indicator--active {
  background-color: var(--link);
}

.post__infos {
  display: flex;
  flex-direction: column;
  padding: 0 8px;
  gap: 10px;
}

.post__likes,
.post__description {
  display: flex;
}

.post__likes {
  align-items: center;
  gap: 6px;
}

.post__likes-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
}

.post__likes-avatar::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  border: 1px solid var(--img-border);
  border-radius: 50%;
}

.post__likes span,
.post__description span {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-dark);
}

.post__likes a,
.post__description a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  text-decoration: none;
}

.post__name--underline:hover {
  text-decoration: underline;
}

.post__date-time {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-light);
  text-transform: uppercase;
  margin-top: 6px;
}

/* Side Menu */
.side-menu {
  max-width: 290px;
  position: fixed;
  left: 50%;
  top: 84px;
  transform: translateX(calc(-50% + 322px));
  display: none;
  flex-direction: column;
}

.side-menu__user-profile {
  display: flex;
  align-items: center;
  margin: 20px 0 22px;
}

.side-menu__user-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin-right: 12px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.side-menu__user-avatar::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  border: 1px solid var(--img-border);
  border-radius: 50%;
}

.side-menu__user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  gap: 4px;
}

.side-menu__user-info a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  text-decoration: none;
  text-transform: lowercase;
  max-width: 180px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.side-menu__user-info span {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-light);
  max-width: 180px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.side-menu__user-button {
  background-color: transparent;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--link);
  flex-shrink: 0;
}

/* Post navigation buttons */
.stories__left-button,
.post__left-button,
.stories__right-button,
.post__right-button {
  width: 24px;
  height: 24px;
  display: none;
  background-color: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  filter: drop-shadow(0px 0px 5px rgba(0, 0, 0, 0.5));
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}

.stories__left-button {
  left: 10px;
}

.stories__right-button {
  right: 10px;
}

.post__left-button {
  left: 16px;
  opacity: 0.7;
}

.post__right-button {
  right: 16px;
  opacity: 0.7;
}

/* Story */
.story {
  background-color: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.story__avatar {
  position: relative;
}

.story__border {
  width: 64px;
  height: 64px;
  fill: none;
  stroke: var(--story-border);
  stroke-width: 1.5;
}

.story--has-story .story__border {
  stroke: url(#--story-gradient);
  stroke-width: 2;
}

.story__picture {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
}

.story__picture::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  border: 1px solid var(--img-border);
  border-radius: 50%;
}

.story__user {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-light);
  text-transform: lowercase;
  max-width: 72px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.story--has-story .story__user {
  color: var(--text-dark);
}

/* Profile Button */
.profile-button {
  background-color: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  position: relative;
}

.profile-button__border {
  display: none;
  width: 30px;
  height: 30px;
  border: 1px solid var(--text-dark);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.profile-button:focus .profile-button__border {
  display: block;
}

.profile-button__picture {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
}

.profile-button__picture::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  border: 1px solid var(--img-border);
  border-radius: 50%;
}

/* Bottom Navbar - Hidden on Desktop */
.navbar {
  width: 100%;
  height: var(--nav-height);
  background-color: var(--primary);
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 2;
  border-top: 1px solid var(--border);
}

.navbar__button {
  flex: 1 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.navbar__button.profile-button .profile-button__border {
  width: 28px;
  height: 28px;
  border-width: 2px;
}

/* Media Queries */
@media (max-width: 767px) {
  :root {
    --sidebar-width: 0px;
    --header-height: 44px;
    --nav-height: 44px;
  }
  
  .sidebar-nav {
    display: none !important;
  }
  
  .header {
    display: flex !important;
  }
  
  .header__menu-button {
    display: flex !important;
  }
  
  .main-container {
    margin-left: 0;
    margin-top: var(--header-height);
    margin-bottom: var(--nav-height);
    padding: 0;
  }
  
  .navbar {
    display: flex;
  }
  
  .header__buttons--desktop {
    display: none;
  }
  
  .post__medias {
    gap: 1px;
  }
  
  .post {
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
  }
  
  .content-container {
    padding: 0;
  }
}

@media (min-width: 768px) {
  :root {
    --header-height: 0px;
    --nav-height: 0px;
  }
  
  .sidebar-nav {
    display: flex;
  }
  
  .header {
    display: none;
  }
  
  .navbar {
    display: none;
  }
  
  .main-container {
    margin-left: var(--sidebar-width);
    margin-top: 0;
    margin-bottom: 0;
    padding: 30px 0;
  }
  
  .content-container {
    padding: 0 20px;
  }
  
  .content {
    gap: 24px;
  }
  
  .posts {
    gap: 24px;
  }
  
  .stories {
    border: 1px solid var(--border);
    border-radius: 8px;
  }
  
  .stories::after {
    content: none;
  }
}

@media (min-width: 1024px) {
  .sidebar-nav {
    display: flex;
  }
  
  .header {
    display: none;
  }
  
  .navbar {
    display: none !important;
  }
  
  .main-container {
    background-color: var(--secondary);
    margin-left: var(--sidebar-width);
    margin-top: 0;
    margin-bottom: 0;
    min-height: 100vh;
  }
  
  .content-container {
    padding: 0 20px;
  }
  
  .content {
    margin: 0 auto;
    max-width: 1075px; /* 935px * 1.15 = 1075px (15% larger) */
  }
  
  .posts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px; /* 28px * 1.15 = 32px (15% larger gap) */
    padding: 32px 0; /* 28px * 1.15 = 32px (15% larger padding) */
  }
  
  .post {
    margin-bottom: 0;
    border: none;
    border-radius: 0;
    background-color: transparent;
    cursor: pointer;
    aspect-ratio: 1;
    overflow: hidden;
    position: relative;
  }
  
  .post__header {
    display: none;
  }
  
  .post__footer {
    display: none !important;
  }
  
  .post__medias {
    height: 100%;
    overflow: hidden;
    display: flex;
  }
  
  .post__media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
  }
  
  .post__media:not(:first-child) {
    display: none;
  }
  
  .post__left-button,
  .post__right-button {
    display: none !important;
  }
  
  .post__indicators {
    display: none !important;
  }
  
  .post:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
  }
  
  /* Multi-image indicator */
  .post[data-multiple-images="true"]::before {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-2 0H8V4h12v12zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 10;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
  }
  
  .side-menu {
    display: flex;
  }
}

/* Loading Indicator Styles */
.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-light);
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top: 2px solid var(--text-dark);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-indicator p {
  font-size: 14px;
  margin: 0;
}

@media (min-width: 1024px) {
  .loading-indicator {
    grid-column: 1 / -1;
    padding: 60px 20px;
  }
  
  .end-of-posts {
    grid-column: 1 / -1;
  }
}

/* End of posts indicator */
.end-of-posts {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  color: var(--text-light);
  font-size: 14px;
  text-align: center;
}

.end-of-posts p {
  margin: 0;
}

@media (min-width: 1200px) {
  .content-container {
    max-width: 1200px;
  }
}

/* Tablet specific styles */
@media (min-width: 768px) and (max-width: 1023px) {
  :root {
    --nav-height: 44px;
  }
  
  .navbar {
    display: flex !important;
  }
  
  .main-container {
    margin-bottom: var(--nav-height);
  }
  
  .sidebar-nav {
    width: 72px;
    height: 100vh;
  }
  
  .sidebar-nav__content {
    align-items: center;
    padding: 16px 8px 8px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }
}

/* iPad Portrait specific fixes */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: portrait) {
  .sidebar-nav {
    display: none !important;
  }
  
  :root {
    --sidebar-width: 0px;
    --header-height: 44px;
    --nav-height: 44px;
  }
  
  .header {
    display: flex !important;
  }
  
  .main-container {
    margin-left: 0;
    margin-top: var(--header-height);
    margin-bottom: var(--nav-height);
    padding: 0;
  }
  
  .posts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    padding: 4px;
  }
  
  .post {
    border: none;
    border-radius: 4px;
    margin-bottom: 0;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    background-color: transparent;
  }
  
  .post__header {
    display: none;
  }
  
  .post__footer {
    display: none !important;
  }
  
  .post__medias {
    height: 100%;
    overflow: hidden;
    display: flex;
  }
  
  .post__media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
  }
  
  .post__media:not(:first-child) {
    display: none;
  }
  
  .side-menu__footer {
    display: none !important;
  }
  
  .navbar {
    display: none !important;
  }
  
  .header__menu-button {
    display: flex !important;
  }
  
  .header__theme-button {
    display: none !important;
  }
}

/* iPad Landscape specific styles */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: landscape) {
  .sidebar-nav__logo img {
    height: 24px;
    max-width: 40px;
    /* Light theme: make logo dark */
    filter: brightness(0.2);
  }
  
  :root.darkTheme .sidebar-nav__logo img {
    filter: brightness(5) invert(1);
  }
  
  .sidebar-nav__item span {
    display: none;
  }
  
  .sidebar-nav__item {
    justify-content: center;
    padding: 12px;
  }
  
  .sidebar-nav__footer-buttons {
    flex-direction: column;
    gap: 8px;
    padding: 0 4px;
  }
  
  .sidebar-nav__footer-btn {
    width: 40px;
    height: 40px;
  }
  
  .sidebar-nav__bottom {
    margin-top: auto;
    padding: 8px 0 20px;
    flex-shrink: 0;
  }
  
  .main-container {
    margin-left: 72px;
  }
  
  :root {
    --sidebar-width: 72px;
  }
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.modal.active {
  display: flex;
}

.modal__content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background-color: var(--primary);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.modal__image-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #000;
  min-width: 400px;
  min-height: 400px;
}

.modal__image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.modal__info {
  background-color: var(--primary);
  width: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal__date {
  font-size: 14px;
  font-weight: 400;
  font-style: italic;
  color: var(--text-light);
  margin: 0 0 8px 0;
  text-align: center;
}

.modal__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
  text-align: center;
}

.modal__bottom-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal__counter {
  font-size: 14px;
  color: var(--text-light);
}

.modal__share-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  color: var(--text-dark);
  transition: background-color 0.2s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__share-button:hover {
  background-color: var(--secondary);
}

.modal__share-feedback {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--text-dark);
  background-color: var(--secondary);
  padding: 2px 6px;
  border-radius: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

.modal__share-feedback.show {
  opacity: 1;
}


.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  z-index: 10000;
}

.modal__close:hover {
  background: rgba(0, 0, 0, 0.7);
}

.modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background-color 0.2s ease;
}

.modal__nav:hover {
  background: rgba(0, 0, 0, 0.7);
}

.modal__nav--prev {
  left: 16px;
}

.modal__nav--next {
  right: 16px;
}

.modal__nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .modal__content {
    flex-direction: column;
    max-width: 95vw;
    max-height: 95vh;
  }
  
  .modal__sidebar {
    width: 100%;
    max-height: 200px;
  }
  
  .modal__image-container {
    min-width: unset;
    min-height: 300px;
  }
}

/* Hover effects for desktop */
@media (min-width: 1024px) {
  .post {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  
  .post:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  }
  
  .sidebar-nav__item:hover svg {
    transform: scale(1.05);
  }
  
  .sidebar-nav__theme-button:hover svg {
    transform: scale(1.05);
  }
}