/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
    font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    font-weight: 400;

    color-scheme: light dark;
    color: rgba(255, 255, 255, 0.87);
    background-color: #242424;

    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    font-weight: 500;
    color: #646cff;
    text-decoration: inherit;
}
a:hover {
    color: #535bf2;
}

html, body {
    margin: 0;
    height: 100vh;
    overflow: hidden;
}

body {
    display: flex;
    flex-direction: column;
    min-width: 320px;
}

h1 {
    font-size: 3.2em;
    line-height: 1.1;
}

button {
    border-radius: 8px;
    border: 1px solid transparent;
    padding: 0.6em 1.2em;
    font-size: 1em;
    font-weight: 500;
    font-family: inherit;
    background-color: #1a1a1a;
    cursor: pointer;
    transition: border-color 0.25s;
}
button:hover {
    border-color: #646cff;
}
button:focus,
button:focus-visible {
    outline: 4px auto -webkit-focus-ring-color;
}

@media (prefers-color-scheme: light) {
    :root {
        color: #213547;
        background-color: #ffffff;
    }
    a:hover {
        color: #747bff;
    }
    button {
        background-color: #f9f9f9;
    }
}

/* ===== NAVBAR STYLES ===== */
/* Z-Index Layering Strategy:
 * 0.5 = .navbar-background (navbar bar)
 * 10 = .navbar-container (navbar content)
 * 100000 = .mobile-menu (mobile menu overlay - above everything)
 */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  color: rgba(255, 255, 255, 0.87);
  /* No background or z-index - just a container */
}

.navbar-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background-color: transparent;
  box-shadow: none;
  z-index: 0.5;
}

.navbar-container {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 0 1rem;
  z-index: 10;
  overflow: visible;
  box-sizing: border-box;
}

/* Left Section: Logo & Version */
.navbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.navbar-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: transform 0.2s;
}

.navbar-logo-link:hover {
  transform: scale(1.05);
}

.navbar-logo-image {
  height: 70px;
  min-width: 70px;
  object-fit: contain;
}

.navbar-version {
  font-size: 0.875rem;
  opacity: 0.8;
  white-space: nowrap;
}

/* Right Section: Actions & Nav */
.navbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.navbar-icon-button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.375rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.navbar-icon-button:hover:not(:disabled) {
  transform: scale(1.05);
  opacity: 0.8;
}

.navbar-icon-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.navbar-icon-button svg {
  width: 20px;
  height: 20px;
}


/* Desktop Navigation */
.navbar-nav {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1rem;
}

.nav-item {
  margin: 0;
}

.nav-link {
  color: inherit;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.2s;
  padding: 0.5rem;
  white-space: nowrap;
}

.nav-link:hover {
  transform: scale(1.05);
  opacity: 0.9;
  color: #646cff;
}

/* Browse Dropdown Form */
.browse-form {
  margin: 0;
  padding: 0;
}

.browse-dropdown {
  background: none;
  border: none;
  color: inherit;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0.5rem;
  white-space: nowrap;
  transition: all 0.2s;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='rgba(255,255,255,0.87)' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.2rem center;
  padding-right: 1.5rem;
}

.browse-dropdown:hover {
  transform: scale(1.05);
  opacity: 0.9;
  color: #646cff;
}

.browse-dropdown:focus {
  outline: none;
}

.browse-dropdown option {
  background-color: #242424;
  color: rgba(255, 255, 255, 0.87);
  padding: 0.5rem;
}

/* Mobile Elements */
.navbar-hamburger {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
}

.navbar-hamburger svg {
  width: 28px;
  height: 28px;
}

.mobile-only {
  display: flex;
}

/* Mobile Menu Overlay */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: #242424;
  z-index: 100000;
  padding: 2rem;
}

.mobile-menu-header {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 3rem;
}

.mobile-menu-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.87);
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-menu-close svg {
  width: 32px;
  height: 32px;
}

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

.mobile-menu-nav li {
  margin-bottom: 2rem;
}

.mobile-nav-link {
  font-size: 2.25rem;
  color: rgba(255, 255, 255, 0.87);
  text-decoration: none;
  font-weight: bold;
  display: block;
}

.mobile-nav-link:hover {
  color: #646cff;
}

.browse-dropdown.mobile {
  font-size: 2.25rem;
  font-weight: bold;
  padding: 0;
  background-position: right 0.5rem center;
  padding-right: 3rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='rgba(255,255,255,0.87)' d='M12 18L4 8h16z'/%3E%3C/svg%3E");
}

/* Responsive Breakpoints */

/* Mobile-specific styles (< 768px) */
@media (max-width: 767px) {
  .navbar-container {
    padding: 0 0.5rem;
  }

  .navbar-left {
    gap: 0.5rem;
  }

  .navbar-version {
    display: none;
  }

  .navbar-logo-image {
    height: 50px;
    min-width: 50px;
  }

  .navbar-right {
    gap: 0.35rem;
  }

  .navbar-nav {
    gap: 0.5rem;
  }

  .nav-link {
    font-size: 0.85rem;
    padding: 0.25rem 0.4rem;
  }

  .browse-dropdown:not(.mobile) {
    font-size: 0.85rem;
    padding: 0.25rem 0.4rem;
    padding-right: 1.2rem;
  }

  .navbar-icon-button {
    padding: 0.25rem;
  }

  .navbar-icon-button svg {
    width: 20px;
    height: 20px;
  }
}

/* Desktop styles (>= 768px) */
@media (min-width: 768px) {
  .mobile-only {
    display: none;
  }

  .navbar-container {
    padding: 0 1rem;
  }

  .navbar-left {
    gap: 0.75rem;
  }

  .navbar-right {
    gap: 0.75rem;
  }

  .navbar-icon-button {
    padding: 0.5rem;
  }

  .navbar-icon-button svg {
    width: 24px;
    height: 24px;
  }
}

/* Page Content Spacing (to account for fixed navbar) */
main {
  padding-top: 80px;
  flex: 1;
  overflow: hidden;
  box-sizing: border-box;
}
