/* DartsStar - Authentication UI Styles */

/* ============================================
   Auth Modal Overlay
   ============================================ */

.auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
  padding: 20px;
}

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

/* ============================================
   Auth Modal
   ============================================ */

.auth-modal {
  background: var(--panel);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 450px;
  position: relative;
  animation: slideUp 0.3s ease;
  border: 1px solid var(--border);
}

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

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

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

/* ============================================
   Auth Modal Header
   ============================================ */

.auth-modal-header {
  padding: 32px 32px 24px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.auth-modal-header h2 {
  margin: 0 0 8px;
  font-size: 28px;
  color: var(--text);
}

.auth-modal-header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* ============================================
   Auth Form
   ============================================ */

.auth-form {
  padding: 32px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.form-group input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.form-error {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

/* ============================================
   Auth Buttons
   ============================================ */

.auth-btn {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}

.auth-btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 12px rgba(46, 160, 67, 0.3);
}

.auth-btn-primary:hover:not(:disabled) {
  background: #28a745;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46, 160, 67, 0.4);
}

.auth-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-spinner {
  animation: spin 1s linear infinite;
}

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

/* ============================================
   Auth Modal Footer
   ============================================ */

.auth-modal-footer {
  padding: 20px 32px 32px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.auth-modal-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.auth-modal-footer a {
  color: var(--accent2);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.auth-modal-footer a:hover {
  color: var(--accent);
}

/* ============================================
   Account Menu
   ============================================ */

.account-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-dropdown {
  position: relative;
}

.account-btn {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}

.account-btn:hover {
  background: var(--hover);
  border-color: var(--accent2);
}

.account-icon {
  font-size: 18px;
}

.account-username {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-arrow {
  font-size: 10px;
  opacity: 0.6;
  transition: transform 0.2s ease;
}

.account-dropdown.active .account-arrow {
  transform: rotate(180deg);
}

/* ============================================
   Account Dropdown Menu
   ============================================ */

.account-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  min-width: 200px;
  z-index: 9999;
  animation: slideDown 0.2s ease;
}

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

.account-dropdown-user {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.account-dropdown-user strong {
  color: var(--text);
  font-size: 14px;
}

.account-dropdown-user small {
  color: var(--muted);
  font-size: 12px;
}

.account-dropdown-menu hr {
  margin: 0;
  border: none;
  border-top: 1px solid var(--border);
}

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

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

.account-dropdown-item:first-of-type {
  border-radius: 0 0 8px 8px;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .auth-modal {
    max-width: 100%;
    margin: 0 16px;
  }
  
  .auth-modal-header {
    padding: 24px 24px 20px;
  }
  
  .auth-modal-header h2 {
    font-size: 24px;
  }
  
  .auth-form {
    padding: 24px;
  }
  
  /* Account Button auf Mobile: Verkleinern aber sichtbar lassen */
  .account-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .account-username {
    max-width: 70px;
  }
  
  .account-icon {
    font-size: 18px;
  }
  
  .account-arrow {
    font-size: 9px;
  }
  
  /* Dropdown-Menü auf Mobile besser positionieren */
  .account-dropdown-menu {
    right: 0;
    min-width: 180px;
  }
}

@media (max-width: 480px) {
  .auth-modal-overlay {
    padding: 0;
  }
  
  .auth-modal {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  /* Account Button auf sehr kleinen Screens */
  .account-username {
    max-width: 60px;
    font-size: 12px;
  }
  
  .account-btn {
    padding: 8px 12px;
  }
  
  /* Dropdown-Menü kompakter */
  .account-dropdown-menu {
    min-width: 160px;
  }
  
  .account-dropdown-user {
    padding: 12px;
  }
  
  .account-dropdown-item {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* ============================================
   Light Theme Support
   ============================================ */

body.light-theme .auth-modal-overlay {
  background: rgba(255, 255, 255, 0.95);
}

body.light-theme .auth-modal {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

body.light-theme .form-group input {
  background: #f8f9fa;
}

body.light-theme .form-error {
  background: rgba(200, 35, 51, 0.1);
}

/* ============================================
   Settings Modal Styles
   ============================================ */

.settings-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.settings-section h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-group {
  margin-bottom: 16px;
}

.settings-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.settings-input {
  width: 100%;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  transition: all 0.2s ease;
}

.settings-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.settings-btn {
  padding: 12px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  margin-top: 8px;
}

.settings-btn:hover {
  background: var(--accent2);
  transform: translateY(-1px);
}

.settings-status {
  margin-top: 12px;
  padding: 10px;
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
}

.settings-status .success {
  color: #29b35b;
  display: block;
}

.settings-status .error {
  color: #ff6b6b;
  display: block;
}

.settings-status .loading {
  color: var(--accent);
  display: block;
}

/* Theme Selector */
.theme-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.theme-option {
  padding: 16px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
}

.theme-option:hover {
  border-color: var(--accent);
  background: var(--hover);
}

.theme-option.active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.theme-icon {
  font-size: 32px;
}

/* Theme Change Feedback Animation */
@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================
   Light Theme
   ============================================ */

body.light-theme .account-btn {
  background: #ffffff;
}

body.light-theme .account-btn:hover {
  background: #f8f9fa;
}

body.light-theme .account-dropdown-menu {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

body.light-theme .settings-input {
  background: #ffffff;
  border-color: #dee2e6;
}

body.light-theme .theme-option {
  background: #ffffff;
  border-color: #dee2e6;
  color: #212529;
}

body.light-theme .theme-option.active {
  background: #58a6ff;
  border-color: #58a6ff;
  color: #ffffff;
}

body.light-theme .theme-option:hover {
  background: #e9ecef;
  border-color: #adb5bd;
  color: #212529;
}

