﻿
/* Landing dark header auth */

.landing-page .ui-loading-line {
  display: inline-flex;
  align-items: baseline;
}

.landing-page .ui-loading-dots {
  display: inline-flex;
  margin-left: 1px;
}

.landing-page .ui-loading-dots span {
  display: inline-block;
  width: 0.45em;
  text-align: center;
  opacity: 0.2;
  animation: landing-ui-loading-dot-wave 1.05s ease-in-out infinite;
}

.landing-page .ui-loading-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.landing-page .ui-loading-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes landing-ui-loading-dot-wave {
  0%,
  100% {
    opacity: 0.15;
  }
  35% {
    opacity: 1;
  }
}

.landing-page #landing-header .auth-links-container {
  gap: 8px;
}
.landing-page #landing-header .auth-link,
.landing-page #landing-header .auth-link.text-muted,
.landing-page #landing-header .landing-pro-tools-cta {
  color: rgba(255, 255, 255, 0.72) !important;
  font-size: var(--landing-nav-size, 14px);
  font-weight: 500;
  text-decoration: none;
}
.landing-page #landing-header .auth-link:hover,
.landing-page #landing-header .landing-pro-tools-cta:hover {
  color: #fff !important;
}
.landing-page #landing-header .auth-divider {
  background: rgba(255, 255, 255, 0.28);
}
.landing-page #landing-header .user-avatar {
  width: 40px;
  height: 40px;
  border-color: rgba(255, 255, 255, 0.22);
  background: #1a1a1a;
}
.landing-page #landing-header .avatar-initials {
  color: #fff;
}
.landing-page #landing-header #auth-status {
  display: inline-flex !important;
  align-items: center;
  min-height: 40px;
  visibility: visible !important;
}
.landing-page #landing-header .header__actions {
  display: flex !important;
  align-items: center;
  gap: 12px;
}
.landing-page #landing-header .user-dropdown {
  z-index: 10050;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
}

/*
 * Landing sets --text-primary: #fff for the dark page. site-auth dropdown uses
 * that var → white-on-white invisible Sign out / Buy credits. Force light-panel tokens.
 */
.landing-page .user-dropdown {
  --text-primary: #1d1d1f;
  --text-tertiary: #86868b;
  --bg-secondary: #f5f5f7;
  color: #1d1d1f;
  background: #fff;
}
.landing-page .user-dropdown-name,
.landing-page .user-dropdown-item {
  color: #1d1d1f !important;
}
.landing-page .user-dropdown-email,
.landing-page .user-dropdown-credits {
  color: #86868b !important;
}
.landing-page .user-dropdown-item:hover {
  background: #f5f5f7 !important;
}
.landing-page .auth-modal-content {
  --text-primary: #1d1d1f;
  --muted: #6b7280;
  --black: #111;
  color: #1d1d1f;
  background: #fff;
}
.landing-page .auth-modal-header h2 {
  color: #111 !important;
}
.landing-page .auth-modal-header p {
  color: #6b7280 !important;
}

/*
 * Old SPA was light — dark bubble (#111827) was obvious.
 * Dark landing #0a0a0a makes that same bubble invisible. Force lime CTA contrast.
 */
.landing-page #support-widget {
  position: relative;
  z-index: 10040 !important;
}
.landing-page .support-bubble {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  z-index: 10040 !important;
  width: 56px !important;
  height: 56px !important;
  border-radius: 50% !important;
  background: #e0f782 !important;
  color: #111 !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  box-shadow: none !important;
  filter: none !important;
}
.landing-page .support-bubble:hover {
  transform: scale(1.06);
  box-shadow: none !important;
  filter: none !important;
}
.landing-page .support-bubble-icon {
  width: 24px !important;
  height: 24px !important;
  stroke: #111 !important;
  color: #111 !important;
}

/* Force classic white chat card — nesting break left panel unstyled on dark landing */
.landing-page .support-panel {
  position: fixed !important;
  bottom: 96px !important;
  right: 24px !important;
  left: auto !important;
  width: 380px !important;
  max-width: calc(100vw - 32px) !important;
  max-height: 560px !important;
  z-index: 10040 !important;
  background: #fff !important;
  color: #111 !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35) !important;
  display: flex !important;
  flex-direction: column !important;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  overflow: hidden !important;
  pointer-events: none;
}
.landing-page .support-panel.active {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) scale(1) !important;
  pointer-events: auto !important;
}
.landing-page .support-header-title,
.landing-page .support-message-content,
.landing-page .support-input {
  color: #111 !important;
}
.landing-page .support-header-status {
  color: #10b981 !important;
}
.landing-page .support-message-user .support-message-content {
  background: #111827 !important;
  color: #fff !important;
}
.landing-page .support-message-ai .support-message-content {
  background: #f3f4f6 !important;
  color: #111 !important;
}
.landing-page .support-input-area {
  background: #fff !important;
  border-top: 1px solid #e5e7eb !important;
}
.landing-page .support-input {
  background: #f3f4f6 !important;
  border: 1px solid #e5e7eb !important;
}
.landing-page .support-input:focus {
  border-color: #111827 !important;
  outline: none !important;
  box-shadow: none !important;
}

/* ===== Auth Modal ===== */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.auth-modal.active {
    opacity: 1;
    visibility: visible;
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.auth-modal-content {
    position: relative;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 24px 48px rgba(2, 6, 23, .2);
    max-width: 400px;
    width: calc(100% - 32px);
    padding: 2rem;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.25s ease;
}

.auth-modal.active .auth-modal-content {
    transform: translateY(0) scale(1);
}

.auth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s;
    color: #6b7280;
    font-size: 24px;
    line-height: 1;
}

.auth-modal-close:hover {
    background: #f3f4f6;
    color: #111;
}

.auth-modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111;
    margin-bottom: 0.5rem;
}

.auth-modal-header p {
    font-size: 0.875rem;
    color: #6b7280;
}

.auth-modal-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.auth-modal-google-fallback {
    padding: 0.75rem 1.5rem;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 4px;
    color: #3c4043;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.auth-modal-google-fallback:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.auth-modal.is-busy .auth-modal-close,
.auth-modal.is-busy .auth-modal-actions {
    pointer-events: none;
}

.auth-modal-busy {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(6px);
}

.auth-modal-busy__spinner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid rgba(17, 17, 17, 0.12);
    border-top-color: #d8f266;
    border-right-color: #d8f266;
    animation: auth-modal-spin 0.7s linear infinite;
}

.auth-modal-busy__label {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111;
    letter-spacing: -0.01em;
}

@keyframes auth-modal-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== SUPPORT CHAT WIDGET ===== */

/* Bubble button */
.support-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10002;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #111827;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.support-bubble:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.25);
}

.support-bubble.active {
    transform: scale(0.95);
}

.support-bubble-icon {
    width: 24px;
    height: 24px;
}

.support-bubble-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* Chat Panel */
.support-panel {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    max-height: 560px;
    z-index: 10002;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.support-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header */
.support-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.support-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.support-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #111827 0%, #374151 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.support-header-avatar svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

.support-header-text {
    display: flex;
    flex-direction: column;
}

.support-header-title {
    font-size: 15px;
    font-weight: 600;
    color: #111;
}

.support-header-status {
    font-size: 12px;
    color: #10b981;
}

.support-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.support-close:hover {
    background: #f3f4f6;
    color: #111;
}

.support-close svg {
    width: 18px;
    height: 18px;
}

/* Messages container */
.support-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 380px;
}

/* Message bubble */
.support-message {
    display: flex;
    max-width: 85%;
}

.support-message-user {
    align-self: flex-end;
}

.support-message-ai {
    align-self: flex-start;
}

.support-message-content {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    white-space: normal;
    word-wrap: break-word;
}

.support-message-content strong {
    font-weight: 600;
}

.support-message-content ul {
    margin: 6px 0;
    padding-left: 18px;
    list-style: disc;
}

.support-message-content ul li {
    margin: 3px 0;
    line-height: 1.45;
}

.support-message-user .support-message-content {
    background: #111827;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.support-message-ai .support-message-content {
    background: #f3f4f6;
    color: #111;
    border-bottom-left-radius: 4px;
}

.support-error-retry-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.support-error-retry-line {
    margin: 0;
}

.support-retry-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #111;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.support-retry-btn:hover:not(:disabled) {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.support-retry-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Typing indicator */
.support-typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.support-typing-dots span {
    width: 8px;
    height: 8px;
    background: #6b7280;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.support-typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.support-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.support-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-6px);
    }
}

/* Quick replies */
.support-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.support-quick-reply {
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 13px;
    color: #111;
    cursor: pointer;
    transition: all 0.15s ease;
}

.support-quick-reply:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* Input area */
.support-input-area {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.support-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.support-input:focus {
    border-color: #111;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.support-input::placeholder {
    color: #9ca3af;
}

.support-send {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #111827;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
    flex-shrink: 0;
}

.support-send:hover {
    transform: scale(1.05);
    background: #1f2937;
}

.support-send svg {
    width: 18px;
    height: 18px;
}

/* Escalation options */
.support-escalation {
    background: #f3f4f6;
    border-radius: 16px;
    padding: 16px;
    margin-top: 8px;
}

.support-escalation-text {
    font-size: 14px;
    color: #111;
    margin-bottom: 12px;
}

.support-escalation-buttons {
    display: flex;
    gap: 8px;
}

.support-escalation-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #111;
    cursor: pointer;
    transition: all 0.15s ease;
}

.support-escalation-btn:hover {
    background: #111;
    color: #fff;
    border-color: #111;
}

.support-escalation-btn svg {
    width: 18px;
    height: 18px;
}

/* Contact input */
.support-contact-input {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.support-contact-field {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
}

.support-contact-field:focus {
    border-color: #111;
}

.support-contact-submit {
    padding: 12px 20px;
    background: #111827;
    color: #fff;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
}

.support-contact-submit:hover {
    background: #1f2937;
}

/* Mobile responsive */
@media (max-width: 767px) {
    .support-bubble {
        bottom: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
    }

    .support-panel {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 85vh;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
        overflow-x: hidden;
    }

    .support-panel.active {
        transform: translateY(0);
    }

    .support-messages {
        max-height: calc(85vh - 160px);
        overflow-x: hidden;
    }

    .support-escalation-buttons {
        flex-wrap: wrap;
    }

    .support-input {
        font-size: 16px;
        /* Prevents iOS auto-zoom on focus */
    }
}

