/* Layout Styles - Các style cho layout chính */
.main-content {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1 !important;
}

/* Background Container */
.background-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.background-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1;
}

/* Fullscreen behavior for per-mode UI is now handled inside each mode CSS */

/*
  Hide chrome (header + sidebar) in fullscreen
  - Works when body gets `.fullscreen` (JS)
  - Also works with native Fullscreen API via :fullscreen (and -webkit- variant)
  - Uses !important to win over fixed positioning rules from component CSS
*/
/* Sidebar */
body.fullscreen .sidebar,
html:fullscreen .sidebar,
:root:fullscreen .sidebar,
:-webkit-full-screen .sidebar,
body.fullscreen #sidebar-component,
html:fullscreen #sidebar-component,
:root:fullscreen #sidebar-component,
:-webkit-full-screen #sidebar-component {
  transform: translateX(-100%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1) !important;
}

/* Header */
body.fullscreen .header,
html:fullscreen .header,
:root:fullscreen .header,
:-webkit-full-screen .header,
body.fullscreen #header-component .header,
html:fullscreen #header-component .header,
:root:fullscreen #header-component .header,
:-webkit-full-screen #header-component .header {
  transform: translateY(-100%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1) !important;
}

/* Add hover zone at top of screen in fullscreen */
/* Only create hover zone when body has fs-reveal */
body.fullscreen.fs-reveal::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 30px;
  z-index: 5;
  background: transparent;
  pointer-events: auto;
}

/* Show header on hover when fs-reveal is enabled */
body.fullscreen.fs-reveal:hover .header {
  transform: translateY(0);
  opacity: 1 !important;
  pointer-events: auto !important;
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1) !important;
}

/* Show sidebar on hover when fs-reveal is enabled */
body.fullscreen.fs-reveal:hover .sidebar {
  transform: translateX(0);
  opacity: 1 !important;
  pointer-events: auto !important;
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1) !important;
}

/* Remove focus hacks: header stays hidden via CSS above */

/* Modal behavior in fullscreen */
.fullscreen .modal {
  z-index: 1000 !important;
}

.fullscreen .modal-content {
  max-width: 90vw !important;
  max-height: 90vh !important;
}

/* Music player UI in fullscreen */
.fullscreen .music-player-ui {
  z-index: 9999 !important;
  transform: translateY(0) !important;
}

/* Notification modal in fullscreen */
.fullscreen #alarm-notification {
  z-index: 1100 !important;
}

@keyframes fullscreenEnter {
  from {
    opacity: 0.7;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* === Z-INDEX LAYER SYSTEM === */
/* Organized z-index hierarchy to prevent overlapping issues */

/* Background layers */
.background-container {
  z-index: -1;
}

/* Main content layers */
.main-content {
  z-index: 1;
}

/* Navigation layers */
.header {
  z-index: 10;
}

.sidebar {
  z-index: 20;
}

/* UI component layers */
.dropdown-content,
.url-list {
  z-index: 100;
}

/* Modal layers */
.modal {
  z-index: 1000;
}

.notification-modal,
#alarm-notification {
  z-index: 1100;
}

/* Music player layers */
.music-player-ui {
  z-index: 2000;
}

.music-player-ui.show {
  z-index: 2000;
}

/* PiP overlay layer - highest priority */
#pip-active-overlay {
  z-index: 10000;
}

/* Fullscreen adjustments */
.fullscreen .modal {
  z-index: 1000;
}

.fullscreen .music-player-ui {
  z-index: 2000;
}

.fullscreen #alarm-notification {
  z-index: 1100;
}

/* Responsive behavior for fullscreen is handled within each mode's CSS */
