/**
 * Authentication and user interface styles for Trail Intel
 */

/* User Navigation */
.user-info {
  display: flex;
  align-items: center;
}

.user-info span {
  margin-right: 10px;
  font-weight: 500;
}

.user-dropdown {
  position: relative;
}

.dropdown-toggle {
  background: none;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  color: #333;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.dropdown-toggle:hover {
  background-color: rgba(0, 0, 0, 0.08);
}

.dropdown-toggle svg {
  flex-shrink: 0;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 160px;
  width: max-content;
  max-width: 250px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
  padding: 8px 0;
  z-index: 1000;
  display: none;
  white-space: nowrap;
}

.user-dropdown.show .dropdown-menu {
  display: block;
  animation: fadeIn 0.2s ease;
}

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

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  color: #333;
  text-decoration: none;
  transition: background-color 0.2s ease;
  white-space: nowrap;
  font-size: 14px;
  min-height: 40px;
}

.dropdown-item:hover {
  background-color: rgba(59, 130, 246, 0.08);
  color: #1d4ed8;
}

.dropdown-item:hover svg {
  color: #1d4ed8;
}

.dropdown-item svg {
  margin-right: 12px;
  color: #666;
  flex-shrink: 0;
}

/* Special styling for God Mode Reporting item */
.dropdown-item#nav-god-mode-reporting {
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 4px;
  font-weight: 500;
}

.dropdown-item#nav-god-mode-reporting:hover {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.1), rgba(168, 85, 247, 0.1));
  color: #be185d;
}

.dropdown-item#nav-god-mode-reporting:hover svg {
  color: #be185d;
}

/* Subscription Badge */
.subscription-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 15px;
}

.subscription-badge.free {
  background-color: #f0f0f0;
  color: #666;
}

.subscription-badge.loading {
  background-color: #e3f2fd;
  color: #1976d2;
  animation: pulse 1.5s ease-in-out infinite alternate;
}

.subscription-badge.basic {
  background-color: #4CAF50;
  color: #fff;
}

.subscription-badge.pro {
  background-color: #2196F3;
  color: #fff;
}

.subscription-badge.elite {
  background-color: #9C27B0;
  color: #fff;
}

.subscription-badge.platform {
  background-color: #ffd700;
  color: #333;
}

.subscription-badge.god-mode {
  background: linear-gradient(45deg, #ff6b35, #f7931e, #ffd700, #ff6b35);
  background-size: 400% 400%;
  animation: godModeGlow 2s ease-in-out infinite alternate;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 15px rgba(255, 107, 53, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.3);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.subscription-badge.limit-reached {
  background-color: #ff9500;
  color: #fff;
  animation: pulse 2s ease-in-out infinite;
}

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

@keyframes godModeGlow {
  0% {
    background-position: 0% 50%;
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.5);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.7);
  }
  100% {
    background-position: 0% 50%;
    box-shadow: 0 0 15px rgba(247, 147, 30, 0.6);
  }
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }
  100% {
    opacity: 1;
  }
}

/* Authentication Required Screen */
.auth-required {
  padding: 40px 20px;
  text-align: center;
  animation: fadeIn 0.5s ease;
}

.auth-message-container {
  max-width: 600px;
  margin: 0 auto;
}

.auth-required h2 {
  margin-bottom: 10px;
  color: #2a7d8c;
  font-weight: 700;
}

.auth-required p {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 30px;
}

.auth-actions {
  margin-bottom: 40px;
}

.auth-actions button {
  margin: 0 10px;
  min-width: 120px;
}

.auth-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 40px;
  gap: 20px;
}

.feature-item {
  flex: 0 0 calc(33% - 20px);
  min-width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px;
  border-radius: 8px;
  background-color: #f5f7fa;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.feature-item svg {
  color: #2a7d8c;
  margin-bottom: 10px;
  width: 40px;
  height: 40px;
}

.feature-item p {
  margin: 0;
  font-weight: 500;
  color: #444;
}

/* Spinner inside buttons */
.spinner-inline {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

/* Notification Messages */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 4px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  max-width: 350px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.notification.success {
  background-color: #eefaf3;
  color: #2ecc71;
  border-left: 4px solid #2ecc71;
}

.notification.error {
  background-color: #fef2f2;
  color: #e74c3c;
  border-left: 4px solid #e74c3c;
}

.notification.warning {
  background-color: #fef9e7;
  color: #f39c12;
  border-left: 4px solid #f39c12;
}

.notification.info {
  background-color: #f0f7fa;
  color: #3498db;
  border-left: 4px solid #3498db;
}

/* Debug Tools */
.debug-toggle {
  padding: 10px;
  background-color: rgba(0,0,0,0.1);
  border-radius: 4px;
  margin-top: 10px;
  transition: background-color 0.3s ease;
}

.debug-toggle:hover {
  background-color: rgba(0,0,0,0.15);
}

.debug-panel {
  margin-top: 10px;
  padding: 10px;
  background-color: rgba(255,255,255,0.9);
  border-radius: 4px;
  border: 1px solid #ccc;
  font-family: monospace;
  font-size: 0.8rem;
  max-height: 200px;
  overflow-y: auto;
}

.debug-actions {
  display: flex;
  gap: 5px;
  margin-top: 5px;
}

.debug-actions button {
  font-size: 0.7rem;
  padding: 3px 6px;
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 3px;
  cursor: pointer;
}

.debug-actions button:hover {
  background-color: #eee;
}

/* Dark Theme Support */
body.dark-theme .dropdown-toggle {
  color: #ffffff !important;
}

body.dark-theme .dropdown-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-theme .dropdown-menu {
  background-color: #2c2c2c !important;
  border: 1px solid #404040 !important;
}

body.dark-theme .dropdown-item {
  color: #ffffff !important;
}

body.dark-theme .dropdown-item:hover {
  background-color: #404040 !important;
  color: #ffffff !important;
}

body.dark-theme .user-info {
  color: #ffffff !important;
}

body.dark-theme .subscription-badge {
  color: #ffffff !important;
  border: 1px solid #404040 !important;
}
