/* css/modules/login.css
 * OAuth Login Screen styles
 * Extracted from index.html inline styles
 */

/* =============================================================================
   OAUTH LOGIN SCREEN
   ============================================================================= */

#oauth-login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 1;
  transition: opacity 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#oauth-login-screen.visible {
  opacity: 1; /* Fade in when content is ready */
}

#oauth-login-screen.hidden {
  display: none; /* Actually remove from layout */
}

/* =============================================================================
   SIGN-IN MODAL
   ============================================================================= */

.sign-in-modal {
  background: #FCFCFF !important;
  border-radius: 12px;
  padding: 40px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  color: #424242 !important;
}

/* Mobile: Full-screen flexbox layout like FamilyAuth */
@media (max-width: 768px) {
  #oauth-login-screen {
    background: #FCFCFF;
  }

  .sign-in-modal {
    border-radius: 0;
    max-width: 500px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: none;
    padding: 40px 20px;
    box-sizing: border-box;
  }

  /* Back button - show on mobile only */
  .oauth-back-btn {
    display: flex !important;
    align-items: center;
    gap: 4px;
    align-self: flex-start;
    background: transparent;
    border: none;
    color: #ff9500;
    font-size: 17px;
    font-weight: 400;
    cursor: pointer;
    padding: 8px 12px;
    margin: -20px -8px 20px -8px;
    transition: opacity 0.2s;
  }

  .oauth-back-btn:active {
    opacity: 0.6;
  }

  .oauth-back-btn svg {
    width: 20px;
    height: 20px;
  }
}

.dashie-logo-signin {
  width: 150px !important;
  height: auto;
  margin: 0 auto 20px auto;
  display: block;
}

.sign-in-header h2 {
  color: #424242 !important;
  margin: 0 0 10px 0;
  font-size: 28px;
  font-weight: bold;
}

.sign-in-header p {
  color: #616161 !important;
  margin: 0 0 30px 0;
  font-size: 16px;
  font-style: italic;
}

.privacy-notice {
  color: #616161 !important;
  margin: 30px 0 5px 0 !important;
  font-size: 16px !important;
  font-style: normal !important;
}

.sign-in-content {
  margin: 30px 0;
}

.sign-in-footer {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #E5E5E5;
}

/* Mobile: Flexbox layout for sign-in state */
@media (max-width: 768px) {
  .sign-in-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
  }

  .sign-in-footer {
    margin-top: auto;
    flex-shrink: 0;
    border-top: 1px solid #E0E0E0;
    padding-top: 20px;
  }

  .sign-in-header {
    margin-bottom: 20px;
  }

  .sign-in-content {
    margin: 20px 0;
  }

  /* Hide site info (dev/prod environment) on mobile */
  .site-info-external {
    display: none !important;
  }

  /* Move privacy notice to footer and style like FamilyAuth */
  .sign-in-content .privacy-notice {
    display: none;
  }

  .sign-in-footer::before {
    content: "Your data stays private and secure";
    display: block;
    color: #757575;
    font-size: 14px;
    text-align: center;
    margin: 0 0 12px 0;
    font-weight: normal;
  }

  /* Update legal links styling to match FamilyAuth exactly */
  .legal-links {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    font-size: 13px;
    color: #9e9e9e;
    text-align: center;
  }

  .legal-links a {
    color: #9e9e9e !important;
    text-decoration: none;
    transition: color 0.2s;
  }

  .legal-links a:hover {
    color: #ffaa00 !important;
  }

  .legal-links .separator {
    margin: 0 8px;
    color: #bdbdbd;
  }

  /* Update button styling to match FamilyAuth */
  .signin-button {
    border-radius: 12px;
    padding: 20px 24px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .signin-button.primary {
    background: linear-gradient(135deg, #ff9500 0%, #ffaa00 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.3);
  }

  .signin-button.primary:hover {
    background: linear-gradient(135deg, #ffaa00 0%, #ffbb22 100%);
    box-shadow: 0 6px 16px rgba(255, 149, 0, 0.4);
  }

  .signin-button.secondary {
    background: transparent;
    color: #999999;
    border: 1px solid #E0E0E0;
  }

  .signin-button.secondary:hover {
    background: #f8f9fa;
    border-color: #666666;
    color: #333333;
  }

  .signin-button.secondary:active {
    transform: scale(0.98);
  }

  /* Hide Exit button on mobile (web only) */
  #exit-app-btn {
    display: none !important;
  }

  /* Simplify login status on mobile - make it more compact */
  .login-status {
    font-size: 13px;
    padding: 12px;
    margin-bottom: 16px;
    background: rgba(189, 193, 198, 0.05);
    border-color: rgba(189, 193, 198, 0.2);
  }

  /* Hide login error (show inline in button area instead) */
  .login-error {
    margin-top: 12px;
  }

  /* Adjust sign-in content spacing to match FamilyAuth */
  .sign-in-content {
    margin: 30px 0;
  }

  .sign-in-header {
    margin-bottom: 30px;
  }

  .sign-in-header h2 {
    font-size: 28px;
    margin: 0 0 10px 0;
  }

  .sign-in-header p {
    font-size: 16px;
    margin: 0;
  }
}

/* =============================================================================
   LOADING DASHBOARD STATE
   ============================================================================= */

.loading-dashboard-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 60px 20px;
}

.loading-dashboard-welcome {
  color: #424242;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: -10px;
  white-space: pre-line;
  text-align: center;
}

.loading-dashboard-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 149, 0, 0.1);
  border-top-color: #ff9500;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-dashboard-text {
  color: #616161;
  font-size: 18px;
  font-weight: 500;
}

.loading-dashboard-error {
  background: #ffebee;
  padding: 16px 20px;
  border-radius: 8px;
  border-left: 4px solid #d32f2f;
  color: #d32f2f;
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.5;
  max-width: 320px;
  text-align: center;
}

.loading-dashboard-message {
  color: #757575;
  font-size: 15px;
  font-weight: 400;
  font-style: italic;
  margin-top: 8px;
  opacity: 0.8;
  transition: opacity 0.5s ease-in-out;
}

.login-status {
  background: rgba(189, 193, 198, 0.1);
  border: 1px solid rgba(189, 193, 198, 0.3);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 10px;
  font-size: 14px;
  color: #616161;
}

.login-error {
  background: #ffebee;
  padding: 10px;
  border-radius: 4px;
  border-left: 4px solid #d32f2f;
  color: #d32f2f;
  margin-top: 16px;
  font-size: 14px;
}

/* External site info styling - inside the modal box */
.site-info-external {
  text-align: center;
  margin-top: 20px;
}

.site-info-external p {
  color: #9e9e9e !important;
  font-size: 14px;
  margin: 5px 0;
}

.prod-site-link {
  color: #1a73e8 !important;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
  outline: none;
  display: inline-block;
  padding: 2px 4px;
  border-radius: 3px;
}

.prod-site-link:hover {
  border-bottom-color: #1a73e8;
  background: rgba(26, 115, 232, 0.1);
}

/* TV/Fire TV focus styling for link */
.prod-site-link:focus {
  outline: 3px solid #ffaa00 !important;
  outline-offset: 2px;
  transform: scale(1.02) !important;
  box-shadow: 0 0 15px rgba(255, 170, 0, 0.5) !important;
}

/* =============================================================================
   REDIRECT MODAL
   ============================================================================= */

.redirect-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.redirect-modal {
  background: #FCFCFF;
  border-radius: 12px;
  padding: 30px;
  max-width: 450px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  color: #424242;
}

.redirect-modal h3 {
  color: #424242;
  margin: 0 0 15px 0;
  font-size: 24px;
  font-weight: bold;
}

.redirect-modal p {
  color: #616161;
  margin: 0 0 15px 0;
  font-size: 16px;
  line-height: 1.4;
}

.redirect-modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 25px;
}

.redirect-modal-divider {
  margin: 20px 0;
  height: 1px;
  background: #e0e0e0;
}

.redirect-modal-always-section {
  margin-top: 15px;
}

/* =============================================================================
   LEGAL LINKS (Privacy & Terms)
   ============================================================================= */

.legal-links {
  margin-top: 30px;
  padding-top: 15px;
  text-align: center;
  font-size: 14px;
  color: #9e9e9e;
}

.legal-links a {
  color: #1a73e8;
  text-decoration: none;
  transition: all 0.2s ease;
  padding: 2px 4px;
  border-radius: 3px;
}

.legal-links a:hover {
  color: #0d47a1;
  background: rgba(26, 115, 232, 0.1);
}

.legal-links a:focus {
  outline: 2px solid #ffaa00;
  outline-offset: 2px;
}

.legal-links .separator {
  margin: 0 8px;
  color: #bdbdbd;
}

/* =============================================================================
   VERSION DISPLAY (Login & Loading screens)
   ============================================================================= */

/* Version text for sign-in screen */
.sign-in-version {
  margin-top: 16px;
  font-size: 12px;
  color: #9e9e9e;
  text-align: center;
}

/* Version text for loading dashboard screen */
.loading-dashboard-version {
  margin-top: 20px;
  font-size: 12px;
  color: #9e9e9e;
  text-align: center;
}

/* Version text for mobile loading screen */
.mobile-version {
  margin-top: 24px;
  font-size: 12px;
  color: #9e9e9e;
  text-align: center;
}
