/* Auth Styles - Header, Modal, Auth Prompts */

/* ==================== APP HEADER ==================== */

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--header-bg, rgba(255, 255, 255, 0.95));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px var(--shadow);
  z-index: 1000;
  padding: 10px 20px;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-logo {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.header-logo:hover {
  transform: scale(1.02);
}

.header-logo-img {
  height: 40px;
  width: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* ==================== THEME SELECTOR ==================== */

.theme-selector {
  position: relative;
}

.theme-selector-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  box-shadow: none;
}

.theme-selector-trigger:hover {
  border-color: var(--primary);
  background: var(--bg);
  transform: none;
}

.theme-icon {
  font-size: 1.1rem;
}

.theme-name {
  color: var(--text);
  font-weight: 500;
}

.theme-dropdown-arrow {
  color: var(--text-light);
  transition: transform 0.2s ease;
}

.theme-dropdown-arrow.open {
  transform: rotate(180deg);
}

.theme-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 10px 40px var(--shadow-lg);
  min-width: 180px;
  overflow: hidden;
  animation: dropdownFade 0.2s ease;
  z-index: 1001;
  border: 1px solid var(--border);
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.2s ease;
  box-shadow: none;
}

.theme-option:hover {
  background: var(--bg);
  transform: none;
}

.theme-option.active {
  background: var(--bg);
  color: var(--primary);
}

.theme-option-icon {
  font-size: 1.2rem;
}

.theme-option-name {
  flex: 1;
}

.theme-check {
  color: var(--primary);
}

/* Auth Button in Header */
.auth-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--primary);
  border: none;
  border-radius: 25px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}

.auth-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

/* User Menu */
.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text);
  box-shadow: none;
}

.user-menu-trigger:hover {
  border-color: var(--primary);
  background: var(--bg);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.user-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.user-name {
  font-weight: 500;
  color: var(--text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-arrow {
  color: var(--text-light);
  transition: transform 0.2s ease;
}

.user-menu-trigger:hover .dropdown-arrow {
  color: var(--primary);
}

/* User Dropdown */
.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 10px 40px var(--shadow-lg);
  min-width: 180px;
  overflow: hidden;
  animation: dropdownFade 0.2s ease;
  border: 1px solid var(--border);
}

@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  transition: background 0.2s ease;
}

.dropdown-item:hover {
  background: var(--bg);
}

.dropdown-item.sign-out {
  color: #FF6B6B;
  border-top: 1px solid var(--border);
}

.dropdown-item.sign-out:hover {
  background: rgba(255, 107, 107, 0.1);
}

/* Dark theme dropdown adjustments */
body.theme-neonNights .dropdown-item,
body.theme-midnight .dropdown-item {
  color: var(--text);
}

body.theme-neonNights .dropdown-item:hover,
body.theme-midnight .dropdown-item:hover {
  background: var(--bg);
}

body.theme-neonNights .dropdown-item.sign-out,
body.theme-midnight .dropdown-item.sign-out {
  color: #FF8A8A;
}

body.theme-neonNights .dropdown-item.sign-out:hover,
body.theme-midnight .dropdown-item.sign-out:hover {
  background: rgba(255, 107, 107, 0.15);
}

/* Theme option buttons need proper text colors */
body.theme-neonNights .theme-option,
body.theme-midnight .theme-option {
  color: var(--text);
}

body.theme-neonNights .theme-option:hover,
body.theme-midnight .theme-option:hover {
  background: var(--bg);
  color: var(--text);
}

body.theme-neonNights .theme-option.active,
body.theme-midnight .theme-option.active {
  color: var(--primary);
}

/* Minimal theme dropdown adjustments */
body.theme-minimal .dropdown-item,
body.theme-minimal .theme-option {
  color: var(--text);
}

body.theme-minimal .dropdown-item:hover,
body.theme-minimal .theme-option:hover {
  background: var(--bg);
  color: var(--text);
}

body.theme-minimal .theme-option.active {
  color: var(--primary);
}

/* Remove box-shadow for My Profile button only */
.dropdown-item:first-child {
  box-shadow: none !important;
}

.dropdown-item:first-child:hover {
  box-shadow: none !important;
}

.dropdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
}

/* ==================== AUTH MODAL ==================== */

.auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--modal-overlay, rgba(45, 27, 30, 0.5));
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.auth-modal {
  background: var(--card-bg);
  border-radius: 24px 0 0 24px;
  padding: 30px;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s ease;
  box-shadow: 0 20px 60px var(--shadow-lg);
}

/* Custom Scrollbar for Auth Modal */
.auth-modal::-webkit-scrollbar {
  width: 8px;
}

.auth-modal::-webkit-scrollbar-track {
  background: rgba(255, 107, 157, 0.08);
  border-radius: 24px;
  margin: 10px 0;
}

.auth-modal::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb, var(--primary));
  border-radius: 24px;
  transition: background 0.2s ease;
}

.auth-modal::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Firefox Scrollbar */
.auth-modal {
  scrollbar-width: thin;
  scrollbar-color: #ff6b9d rgba(255, 107, 157, 0.08);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: none;
  font-size: 20px;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: none;
}

.auth-modal-close:hover {
  background: var(--border);
  color: var(--text);
  transform: none;
}

.auth-modal-header {
  text-align: center;
  margin-bottom: 25px;
}

.auth-logo {
  height: 60px;
  margin-bottom: 15px;
}

.auth-modal-header h2 {
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 5px;
}

.auth-message {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Auth Form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.form-group input {
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.2s ease;
  background: var(--card-bg);
  color: var(--text);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.15);
}

.form-group input::placeholder {
  color: var(--text-light);
}

.forgot-password-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.875rem;
  cursor: pointer;
  text-align: left;
  padding: 0;
  margin-top: -10px;
  box-shadow: none;
}

.forgot-password-link:hover {
  text-decoration: underline;
  transform: none;
  background: none;
  box-shadow: none;
}

.auth-submit-btn {
  padding: 14px;
  background: var(--primary);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 5px;
}

.auth-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

.auth-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Auth Error/Success Messages */
.auth-error {
  background: #FFE5E5;
  color: #CC4A4A;
  padding: 12px 15px;
  border-radius: 12px;
  font-size: 0.875rem;
  border-left: 4px solid #FF6B6B;
}

.auth-success {
  background: #E5FFF5;
  color: #2D7A5F;
  padding: 12px 15px;
  border-radius: 12px;
  font-size: 0.875rem;
  border-left: 4px solid var(--success);
}

/* Dark theme adjustments for auth messages */
body.theme-neonNights .auth-error,
body.theme-midnight .auth-error {
  background: rgba(255, 107, 107, 0.15);
  color: #FF8A8A;
}

body.theme-neonNights .auth-success,
body.theme-midnight .auth-success {
  background: rgba(0, 255, 136, 0.1);
  color: #00FF88;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  padding: 0 15px;
  color: var(--text-light);
  font-size: 0.875rem;
}

/* Google Auth Button */
.google-auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: none;
}

.google-auth-btn:hover:not(:disabled) {
  border-color: #4285F4;
  background: var(--bg);
  transform: translateY(-2px);
}

.google-auth-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Auth Switch */
.auth-switch {
  text-align: center;
  margin-top: 20px;
  color: var(--text-light);
  font-size: 0.9rem;
}

.auth-switch button {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  box-shadow: none;
}

.auth-switch button:hover {
  text-decoration: underline;
  transform: none;
  background: none;
}

/* Auth Benefits */
.auth-benefits {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.auth-benefits h4 {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 12px;
  text-align: center;
}

.auth-benefits ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 8px;
}

.auth-benefits li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text);
}

/* ==================== AUTH PROMPTS IN MODALS ==================== */

.auth-prompt {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 2px dashed var(--border);
}

.auth-prompt-divider {
  text-align: center;
  margin-bottom: 15px;
}

.auth-prompt-divider span {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.auth-prompt-content {
  text-align: center;
}

.auth-prompt-content p {
  color: var(--text-light);
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.auth-prompt-benefits {
  list-style: none;
  padding: 0;
  margin-bottom: 15px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.auth-prompt-benefits li {
  font-size: 0.85rem;
  color: var(--text);
  background: var(--bg);
  padding: 5px 12px;
  border-radius: 20px;
}

.auth-prompt-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  border: none;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 10px;
}

.auth-prompt-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

.auth-prompt-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0;
  box-shadow: none;
}

.auth-prompt-link:hover {
  text-decoration: underline;
  transform: none;
  background: none;
}

/* Completion Auth Prompt */
.completion-auth-prompt {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.completion-auth-prompt p {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.completion-auth-prompt .auth-prompt-divider {
  color: var(--text);
}

.completion-auth-prompt .auth-prompt-link {
  color: var(--primary);
}

/* Solve Time */
.solve-time {
  font-size: 1.2rem;
  color: var(--primary);
  font-weight: 600;
  margin: 10px 0;
}

/* ==================== APP LAYOUT ==================== */

.app-container {
  min-height: 100vh;
  padding-top: 70px; /* Space for fixed header */
}

.app-main {
  padding: 20px;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
  .app-header {
    padding: 8px 15px;
  }
  
  .header-logo-img {
    height: 32px;
  }
  
  .user-name {
    display: none;
  }
  
  .theme-name {
    display: none;
  }
  
  .theme-selector-trigger {
    padding: 8px 10px;
  }
  
  .user-menu-trigger {
    padding: 6px;
  }
  
  .auth-button {
    padding: 8px 15px;
    font-size: 0.875rem;
  }
  
  .auth-button svg {
    width: 14px;
    height: 14px;
  }
  
  .auth-modal {
    padding: 20px;
    margin: 10px;
    max-height: 95vh;
  }
  
  .app-container {
    padding-top: 60px;
  }
  
  .app-main {
    padding: 10px;
  }
  
  .header-nav {
    gap: 10px;
  }
}

