/* Mobile styles for auth components */
@media (max-width: 768px) {
  .mobile-telegram-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--primary-blue);
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
  }
  
  .mobile-telegram-btn:hover {
    background: var(--primary-blue-dark);
  }
  
  .mobile-user-name {
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.9rem;
  }
  
  /* Hide desktop auth container on mobile */
  #auth-container {
    display: none !important;
  }
}

/* Desktop styles */
@media (min-width: 769px) {
  /* Hide mobile auth container on desktop */
  #auth-container-mobile {
    display: none !important;
  }
}

/* Auth Container */
#auth-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: flex-end;
  min-height: 44px; /* Ensure consistent height */
  flex-shrink: 0;
}

/* Anonymous User Info */
.anonymous-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.anonymous-limits {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 0.9rem;
  color: #fff;
  white-space: nowrap; /* Prevent text wrapping */
}

.anonymous-limits i {
  color: #ffd700;
}

.limit-count {
  font-weight: bold;
  color: #ffd700;
}

.limit-label {
  opacity: 0.8;
}

.limit-label-full {
  display: inline;
}

.limit-label-short {
  display: none;
}

/* Telegram Login Widget */
#telegram-login-widget {
  display: flex;
  align-items: center;
  justify-content: center;
}

.telegram-login-placeholder {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #0088cc;
  color: white;
  border: none;
  border-radius: 25px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.telegram-login-placeholder:hover {
  background: #006699;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
}

.telegram-login-placeholder i {
  font-size: 1.1rem;
}

.telegram-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #ff6b6b;
  font-size: 0.85rem;
  padding: 8px 16px;
  border: 1px solid #ff6b6b;
  border-radius: 6px;
  background: rgba(255, 107, 107, 0.1);
  text-align: center;
}

.telegram-error small {
  font-size: 0.75rem;
  opacity: 0.8;
}

.telegram-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.telegram-fallback-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #0088cc;
  color: white;
  border: none;
  border-radius: 25px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.telegram-fallback-btn:hover {
  background: #006699;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
  color: white;
}

.telegram-fallback-btn i {
  font-size: 1.1rem;
}

.telegram-fallback small {
  font-size: 0.75rem;
  opacity: 0.8;
  color: #fff;
}

.telegram-login-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #0088cc;
  color: white;
  border: none;
  border-radius: 25px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  white-space: nowrap;
  flex-wrap: nowrap;
  min-width: fit-content;
}

.telegram-login-btn:hover {
  background: #006699;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
  color: white;
  text-decoration: none;
}

.telegram-login-btn i {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Ensure single line layout on all screen sizes */
@media (min-width: 769px) {
  .telegram-login-btn {
    min-width: 140px;
  }
}

@media (max-width: 1199px) and (min-width: 769px) {
  .telegram-login-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
}

/* Legacy Twitter Login Button (kept for compatibility) */
.btn-twitter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #1d9bf0;
  color: white;
  border: none;
  border-radius: 25px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-text-full {
  display: inline;
}

.btn-text-short {
  display: none;
}

.btn-twitter:hover {
  background: #1a8cd8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(29, 155, 240, 0.3);
}

.btn-twitter i {
  font-size: 1.1rem;
}

/* Authenticated User Info */
.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Credits Display */
.credits-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #ffd700, #ffed4a);
  color: #333;
  border-radius: 20px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.credits-display i {
  color: #f59e0b;
  animation: coin-spin 2s ease-in-out infinite;
}

.credits-count {
  font-size: 1.1rem;
  font-weight: bold;
}

.credits-label {
  font-size: 0.9rem;
  opacity: 0.8;
}

@keyframes coin-spin {
  0%, 100% { transform: rotateY(0deg); }
  50% { transform: rotateY(180deg); }
}

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

.user-avatar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #fff;
}

.user-avatar:hover {
  background: rgba(255, 255, 255, 0.2);
}

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

.user-avatar i.fa-user {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #6b7280;
  border-radius: 50%;
  font-size: 1rem;
}

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

.user-avatar .fa-chevron-down {
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

.user-menu.active .fa-chevron-down {
  transform: rotate(180deg);
}

/* User Dropdown */
.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  min-width: 200px;
}

.user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: #374151;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-weight: 500;
}

.dropdown-item:hover {
  background: #f3f4f6;
}

.dropdown-item i {
  width: 16px;
  text-align: center;
  opacity: 0.7;
}

.dropdown-item.daily-bonus {
  color: #059669;
  font-weight: 600;
}

.dropdown-item.daily-bonus:hover {
  background: #ecfdf5;
}

.dropdown-item.logout {
  color: #dc2626;
}

.dropdown-item.logout:hover {
  background: #fef2f2;
}

.dropdown-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 0.5rem 0;
}

/* Notifications */
#notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.notification {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-width: 400px;
  animation: slideIn 0.3s ease-out;
}

.notification-success {
  border-left: 4px solid #10b981;
}

.notification-error {
  border-left: 4px solid #ef4444;
}

.notification-info {
  border-left: 4px solid #3b82f6;
}

.notification i {
  font-size: 1.2rem;
}

.notification-success i {
  color: #10b981;
}

.notification-error i {
  color: #ef4444;
}

.notification-info i {
  color: #3b82f6;
}

.notification span {
  flex: 1;
  color: #374151;
  font-weight: 500;
}

.notification-close {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
}

.notification-close:hover {
  color: #6b7280;
}

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

/* Button States */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.btn:disabled:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* Generation Button States */
#generate-btn {
  transition: all 0.3s ease;
}

#generate-btn:disabled {
  background: #9ca3af;
  color: #fff;
}

#generate-btn.insufficient-credits {
  background: #ef4444;
  color: #fff;
}

#generate-btn.rate-limited {
  background: #f59e0b;
  color: #fff;
}

/* Remix Button States */
.remix-btn:disabled {
  background: #9ca3af;
  color: #fff;
}

.remix-btn.insufficient-credits {
  background: #ef4444;
  color: #fff;
}

.remix-btn.auth-required {
  background: #3b82f6;
  color: #fff;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  #auth-container {
    gap: 0.5rem;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    min-height: 44px;
  }
  
  .anonymous-info {
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
  }
  
  .anonymous-limits {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 16px;
    white-space: nowrap;
    flex: 0 0 auto;
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }
  
  .limit-count {
    font-size: 0.8rem;
    font-weight: bold;
  }
  
  .limit-label {
    font-size: 0.65rem;
  }
  
  .limit-label-full {
    display: none;
  }
  
  .limit-label-short {
    display: inline;
  }
  
  .btn-twitter {
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
    border-radius: 12px;
    gap: 0.3rem;
    white-space: nowrap;
    flex: 0 0 auto;
    min-width: 0;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .btn-twitter i {
    font-size: 1rem;
    flex-shrink: 0;
  }
  
  .btn-text-full {
    display: none;
  }
  
  .btn-text-short {
    display: inline;
  }
  
  .user-info {
    gap: 0.5rem;
    flex-direction: column;
    align-items: stretch;
  }
  
  .credits-display {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 18px;
  }
  
  .credits-count {
    font-size: 1rem;
  }
  
  .credits-label {
    font-size: 0.8rem;
  }
  
  .user-avatar {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
  }
  
  .user-avatar img,
  .user-avatar i.fa-user {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }
  
  .username {
    max-width: 100px;
    font-size: 0.8rem;
  }
  
  .user-dropdown {
    right: -10px;
    min-width: 180px;
  }
  
  .dropdown-item {
    padding: 0.6rem 0.9rem;
    font-size: 0.85rem;
  }
  
  #notification-container {
    top: 10px;
    right: 10px;
    left: 10px;
  }
  
  .notification {
    max-width: none;
    padding: 0.9rem 1.1rem;
    font-size: 0.9rem;
  }
  
  /* Mobile coins display */
  .mobile-coins {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, #ffd700, #ffed4a);
    color: #333;
    border-radius: 18px;
    font-weight: 600;
    font-size: 0.85rem;
    min-height: 36px;
  }
  
  .mobile-coins i {
    color: #f59e0b;
    font-size: 1rem;
  }
  
  /* Mobile user menu */
  .mobile-user-menu {
    position: relative;
  }
  
  .mobile-user-avatar {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    cursor: pointer;
    color: #fff;
    font-size: 0.8rem;
  }
  
  .mobile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.3rem;
    z-index: 1001;
  }
}
