/* theme/assets/css/app.css  */

body {
    background-color: var(--backgroundColor);
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

body > header {
  font-family: none;
  pointer-events: auto;
}

main {
  margin: 0 auto;
}

h1:first-child {
  margin-top: 15vh;
}

h1 {
    color: var(--mainTextColor);
    margin-top: 1rem;
}

h1, p, .app-nav {
  user-select: none;
}

.app-nav {
    color: white;
    padding: 1rem;
    text-align: right;
    cursor: pointer;
}

body > nav ul > li:nth-last-of-type(5),
body > nav ul > li:nth-last-of-type(4),
body > nav ul > li:nth-last-of-type(3),
body > nav ul > li:nth-last-of-type(2) {
    display: none;
}

body > nav ul > li:nth-last-of-type(3) {
  display: block !important;
}

/* Profile dropdown visibility for app - only show when authenticated */
body.page-app #profile-dropdown-container {
  visibility: hidden !important;
  opacity: 0;
  transition: opacity 0.2s ease;
}
body.page-app #profile-dropdown-container.authenticated {
  visibility: visible !important;
  opacity: 1;
}

#app-page-html {
  margin-bottom: 2rem;
}

#app-page-html,
.login-container {
  display: grid;
  justify-content: center;
}

/* PWA-specific adjustments to nav */
.offline-indicator {
    background-color: #ff4d4d;
    color: white;
    text-align: center;
    padding: 8px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: none;
    z-index: 1000;
}

body.is-offline .offline-indicator {
    display: block;
}

/* Make sure URLs in the menu work properly in the PWA context */
body > nav a {
    text-decoration: none;
}

/* Ensure the site name is correct */
#site-name {
    color: white;
    font-weight: bold;
}

/* The card-like form */
.login-form {
  background: #ffffff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 320px;
  box-sizing: border-box;
  text-align: center;
}

#login-error-msg {
  color: rgb(143, 21, 21);
}

/* Form title */
.form-title {
  margin-bottom: 1.5rem;
  color: #333333;
  font-size: 1.5rem;
  font-weight: 600;
}

/* Input groups */
.input-group {
  margin-bottom: 1rem;
  text-align: left;
}
.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: #555555;
}
.input-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid #cccccc;
  border-radius: 4px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.input-group input:focus {
  border-color: #007bff;
  outline: none;
}

/* Common button styles */
.btn {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn:hover {
  opacity: 0.9;
}

/* Primary login button */
.login-btn {
  background-color: #007bff;
  color: #ffffff;
  margin-bottom: 1rem;
}

/* Divider with “OR” text */
.divider {
  position: relative;
  text-align: center;
  margin: 1rem 0;
  font-size: 0.875rem;
  color: #888888;
}
.divider::before,
.divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: #dddddd;
}
.divider::before { left: 0; }
.divider::after { right: 0; }

/* Google sign-in button */
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #dddddd;
}
.google-btn img {
  width: 20px;
  height: 20px;
  margin-right: 0.5rem;
}

#start-signup {
  color: white;
  background-color: rgb(58, 128, 58);
}

body.app-shell footer {
  width: 100vw;
  height: 20vh;
  display: grid;
  background: #1a1a1a;
  color: white;
  place-content: center;
}

#loader {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 75px;
}

.offline-indicator {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #333;
  color: white;
  padding: 8px;
  text-align: center;
  font-size: 14px;
  z-index: 9999;
  display: none;
  pointer-events: none;
}

body.is-offline .offline-indicator {
  display: block;
}

[aria-hidden="true"] {
  display: none;
}

/* PWA-specific overrides for nav.css */
@media (max-width: 800px) {
    main {
        margin-top: 10vh;
    }
    
    #logo-name {
        font-size: 1.2rem;
    }
}

/* If the menu uses WordPress admin URLs, transform them to app paths */
body > nav a[href*="/wp-admin/"] {
    display: none; /* Hide admin links in the PWA */
}