/**
 * Login Page Styles
 * Terminal-themed login interface with full OpenMUD branding
 */

/* ============================================
   Login Container
   ============================================ */
#login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--theme-bg-primary);
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(76, 175, 80, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(33, 150, 243, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(156, 39, 176, 0.1) 0%, transparent 50%);
}

/* Terminal Container */
.terminal-container {
  width: 90%;
  max-width: 500px;
  background: var(--theme-bg-secondary);
  border: 2px solid var(--theme-border-primary);
  border-radius: 8px;
  padding: 30px;
  box-shadow: 
    0 0 30px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(76, 175, 80, 0.1);
  position: relative;
  overflow: hidden;
}

/* Terminal scanline effect */
.terminal-container::before {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(
    0deg,
    transparent 0%,
    rgba(255, 255, 255, 0.02) 50%,
    transparent 100%
  );
  animation: scanline 8s linear infinite;
  pointer-events: none;
}

@keyframes scanline {
  0% { top: -100%; }
  100% { top: 100%; }
}

/* ============================================
   Terminal Header
   ============================================ */
.terminal-header {
  text-align: center;
  margin-bottom: 30px;
}

.ascii-title {
  color: var(--theme-accent-green);
  font-family: monospace;
  font-weight: bold;
  white-space: pre;
  font-size: 10px;
  line-height: 1.2;
  text-shadow: 
    0 0 10px rgba(76, 175, 80, 0.5),
    0 0 20px rgba(76, 175, 80, 0.3);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 
      0 0 10px rgba(76, 175, 80, 0.5),
      0 0 20px rgba(76, 175, 80, 0.3);
  }
  to {
    text-shadow: 
      0 0 15px rgba(76, 175, 80, 0.7),
      0 0 30px rgba(76, 175, 80, 0.4);
  }
}

.welcome-message {
  color: var(--theme-text-primary);
  margin-top: 15px;
  font-size: 16px;
  letter-spacing: 1px;
}

/* Highlighted text in welcome message */
.text-based {
  color: #ffff00;
  text-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
}

.server-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 11px;
  margin-top: 10px;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 1px;
}

.server-status.online {
  background: var(--theme-success);
  color: white;
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
  animation: pulse 2s infinite;
}

.server-status.offline {
  background: var(--theme-error);
  color: white;
  box-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* ============================================
   Login Form
   ============================================ */
.login-form {
  margin: 30px 0;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  color: var(--theme-text-secondary);
  margin-bottom: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--theme-bg-primary);
  border: 1px solid var(--theme-border-secondary);
  color: var(--theme-text-primary);
  font-size: 14px;
  font-family: inherit;
  border-radius: 4px;
  transition: all var(--theme-transition-speed);
}

.form-input:focus {
  outline: none;
  border-color: var(--theme-accent-green);
  box-shadow: 
    0 0 5px rgba(76, 175, 80, 0.3),
    inset 0 0 5px rgba(76, 175, 80, 0.1);
  background: rgba(76, 175, 80, 0.05);
}

.form-input::placeholder {
  color: var(--theme-text-muted);
  opacity: 0.7;
}

/* Checkbox Group */
.checkbox-group {
  margin-top: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--theme-text-secondary);
  font-size: 13px;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  margin-right: 8px;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.checkbox-label:hover {
  color: var(--theme-text-primary);
}

/* Login Button */
.login-button {
  width: 100%;
  padding: 12px;
  background: var(--theme-accent-green);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all var(--theme-transition-speed);
  position: relative;
  overflow: hidden;
}

.login-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.login-button:hover {
  background: var(--theme-accent-green-hover);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.login-button:hover::before {
  width: 300px;
  height: 300px;
}

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

/* Error Message */
.error-message {
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid var(--theme-error);
  color: var(--theme-error);
  padding: 10px;
  border-radius: 4px;
  font-size: 13px;
  margin-top: 15px;
  animation: shake 0.5s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* ============================================
   OAuth Section
   ============================================ */
.oauth-section {
  margin-top: 30px;
  padding-top: 30px;
  text-align: center;
}

.oauth-divider {
  color: var(--theme-text-muted);
  margin-bottom: 20px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
}

.oauth-divider::before,
.oauth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--theme-border-secondary);
}

.oauth-divider::before {
  left: 0;
}

.oauth-divider::after {
  right: 0;
}

/* Google Sign-In Button Container */
#google-signin-button {
  display: inline-block;
  margin: 0 auto;
}

/* Override Google's button styles to match theme */
#google-signin-button iframe {
  border-radius: 4px !important;
}

/* ============================================
   Terminal Footer
   ============================================ */
.terminal-footer {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--theme-border-secondary);
  text-align: center;
}

.footer-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--theme-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.player-count {
  color: var(--theme-text-secondary);
}

#online-count {
  color: var(--theme-accent-green);
  font-weight: bold;
}

.version {
  color: var(--theme-text-muted);
  opacity: 0.7;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 480px) {
  .terminal-container {
    width: 95%;
    padding: 20px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  .ascii-title {
    font-size: 8px;
  }
  
  .welcome-message {
    font-size: 14px;
  }
  
  .form-input {
    font-size: 16px; /* Prevent zoom on mobile */
  }
}