/**
 * Nuevo Header Horizontal + Sidebar Deslizable
 */

/* ===== LAYOUT PRINCIPAL ===== */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== TOP HEADER ===== */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background-color: var(--ig-elevated-background);
  border-bottom: 1px solid var(--ig-stroke);
  z-index: var(--ig-z-fixed);
  display: flex;
  align-items: center;
}

.top-header__content {
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 var(--ig-space-6);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--ig-space-8);
}

/* Logo/Título - Estilo original de la derecha */
.top-header__logo {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
  gap: 4px;
}

.top-header__logo:hover {
  opacity: 0.7;
}

.top-header__title {
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
  color: var(--ig-primary-text);
  letter-spacing: -1px;
  font-family: var(--font-family);
}

.top-header__subtitle {
  font-size: 11px;
  font-weight: 400;
  font-style: italic;
  line-height: 1.2;
  color: var(--ig-secondary-text);
  letter-spacing: 0.5px;
  margin-top: 0px;
}

/* Botones centrales */
.top-header__actions {
  display: flex;
  gap: var(--ig-space-3);
  justify-content: center;
  align-items: center;
}

/* Separador vertical */
.top-header__separator {
  width: 1px;
  height: 24px;
  background-color: var(--ig-stroke);
  margin: 0 var(--ig-space-2);
}

/* Botones del header */
.top-header__btn {
  width: 40px;
  height: 40px;
  border-radius: var(--ig-radius-full);
  background-color: transparent;
  border: none;
  color: var(--ig-primary-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.top-header__btn:hover {
  background-color: var(--ig-hover-overlay);
}

.top-header__btn svg {
  flex-shrink: 0;
}

/* View toggle active state */
.view-toggle.active {
  background-color: var(--ig-primary-button);
  color: white;
}

.view-toggle.active:hover {
  background-color: var(--ig-primary-button);
  opacity: 0.9;
}

/* Dice icon button */
.top-header__btn--dice {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dice-icon {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Light theme - sin filtros, dado natural */
.dice-icon {
  filter: none;
  opacity: 0.8;
}

/* Dark theme - también natural */
:root.dark-theme .dice-icon {
  filter: none;
  opacity: 0.85;
}

/* Hover effect - works for both themes */
.top-header__btn--dice:hover .dice-icon {
  opacity: 1;
  transform: scale(1.15);
}

/* Sección derecha (búsqueda + iconos) */
.top-header__right {
  display: flex;
  gap: var(--ig-space-3);
  align-items: center;
  justify-content: flex-end;
}

/* Barra de búsqueda */
.top-header__search {
  position: relative;
  width: 260px;
}

.top-header__search-input {
  width: 100%;
  height: 40px;
  padding: 0 var(--ig-space-4) 0 var(--ig-space-10);
  border-radius: var(--ig-radius-lg);
  border: 1px solid var(--ig-stroke);
  background-color: var(--ig-secondary-background);
  color: var(--ig-primary-text);
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.top-header__search-input:focus {
  border-color: var(--ig-primary-button);
  background-color: var(--ig-primary-background);
}

.top-header__search-input::placeholder {
  color: var(--ig-secondary-text);
}

.top-header__search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ig-secondary-text);
  pointer-events: none;
}

/* ===== MAIN CONTENT (FULL WIDTH) ===== */
.main-content {
  margin-top: 70px;
  padding: var(--ig-space-6);
  width: 100%;
  max-width: 1800px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== DATE SIDEBAR DESLIZABLE ===== */
.date-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  background-color: var(--ig-elevated-background);
  border-left: 1px solid var(--ig-stroke);
  z-index: var(--ig-z-modal);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

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

.date-sidebar__content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.date-sidebar__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--ig-space-6);
  border-bottom: 1px solid var(--ig-stroke);
}

.date-sidebar__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ig-primary-text);
  margin: 0;
}

.date-sidebar__close {
  width: 36px;
  height: 36px;
  border-radius: var(--ig-radius-full);
  background-color: transparent;
  border: none;
  color: var(--ig-primary-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.date-sidebar__close:hover {
  background-color: var(--ig-hover-overlay);
}

.date-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--ig-space-4);
}

/* Ocultar el título duplicado dentro del nav */
.date-sidebar__nav .sidebar__date-title {
  display: none;
}

/* ===== FLOATING DATE BUTTON ===== */
.floating-date-btn {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 64px;
  height: 64px;
  border-radius: var(--ig-radius-full);
  background-color: var(--ig-primary-button);
  color: white;
  border: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: var(--ig-z-fixed);
}

.floating-date-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.floating-date-btn:active {
  transform: scale(0.95);
}

/* Dark theme */
:root.dark-theme .top-header {
  background-color: #000000;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

:root.dark-theme .date-sidebar {
  background-color: #000000;
  border-left-color: rgba(255, 255, 255, 0.1);
}

:root.dark-theme .date-sidebar__header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 1024px) {
  .top-header__content {
    grid-template-columns: auto auto;
    gap: var(--ig-space-4);
  }

  .top-header__actions {
    display: none;
  }

  .top-header__search {
    width: 180px;
  }

  .floating-date-btn {
    width: 56px;
    height: 56px;
    bottom: 24px;
    right: 24px;
  }
}

@media (max-width: 768px) {
  .top-header {
    height: 60px;
  }

  .main-content {
    margin-top: 60px;
    padding: var(--ig-space-4);
  }

  .top-header__search {
    width: 140px;
  }

  .top-header__search-input {
    height: 36px;
    font-size: 13px;
  }

  .date-sidebar {
    width: 280px;
  }
}
