/**
 * Agent Chat Widget Styles - Talk to my Agent
 * Theme variables are set dynamically in the template
 */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
}

/* =============================================================================
   BACKGROUND ANIMATION
   ============================================================================= */

.bg-animation {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px; height: 600px;
    background: var(--accent-violet);
    top: -200px; right: -200px;
}

.orb-2 {
    width: 400px; height: 400px;
    background: var(--accent-cyan);
    bottom: -100px; left: -100px;
    animation-delay: -7s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 30px) scale(1.02); }
}

/* =============================================================================
   LAYOUT
   ============================================================================= */

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 800px;
    height: 100vh;
    height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding: 16px;
}

.header {
    text-align: center;
    padding: 20px 0;
    flex-shrink: 0;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header .headline {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* =============================================================================
   QUICK ACTIONS
   ============================================================================= */

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
}

.quick-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-btn:hover {
    background: var(--user-bubble);
    border-color: var(--accent-violet);
}

/* =============================================================================
   CHAT AREA
   ============================================================================= */

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    margin-top: 16px;
}

#messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.user {
    background: var(--user-bubble);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message.agent {
    background: var(--agent-bubble);
    border: 1px solid var(--glass-border);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message a {
    color: var(--accent-violet);
}

.message .action-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    margin: 4px 4px 4px 0;
    background: var(--accent-gradient);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.message .action-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.message .action-link:active {
    transform: translateY(0);
}

/* =============================================================================
   TYPING INDICATOR
   ============================================================================= */

.typing-indicator {
    display: none;
}

.message.typing-bubble {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 16px 20px;
    min-height: auto;
}

.message.typing-bubble span {
    width: 8px; height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.message.typing-bubble span:nth-child(1) { animation-delay: -0.32s; }
.message.typing-bubble span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* =============================================================================
   INPUT AREA
   ============================================================================= */

.input-area {
    padding: 16px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 12px;
}

#messageInput {
    flex: 1;
    padding: 14px 18px;
    background: var(--bg-dark);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
}

#messageInput:focus {
    outline: none;
    border-color: var(--accent-violet);
}

#sendBtn {
    width: 50px; height: 50px;
    border-radius: 12px;
    background: var(--accent-gradient);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

#sendBtn:hover { transform: scale(1.05); }
#sendBtn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* =============================================================================
   LEAD FORM
   ============================================================================= */

.lead-form-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 100;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.lead-form-overlay.active { display: flex; }

.lead-form {
    background: var(--bg-dark);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
}

.lead-form h3 {
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.lead-form .close-btn {
    float: right;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.lf-group {
    margin-bottom: 14px;
}

.lf-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.lf-group input,
.lf-group select,
.lf-group textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
}

.lf-group textarea { min-height: 80px; resize: vertical; }

.lf-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.lf-consent input { width: auto; margin-top: 2px; }

#lf-submit {
    width: 100%;
    padding: 14px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

#lf-submit:disabled { opacity: 0.6; cursor: not-allowed; }

#lf-status {
    margin-top: 12px;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: center;
    display: none;
}

#lf-status.success {
    display: block;
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

#lf-status.error {
    display: block;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* =============================================================================
   SHARE MENU
   ============================================================================= */

.share-menu-container { position: relative; }

.share-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}

.share-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-dark);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    min-width: 200px;
    z-index: 50;
}

.share-dropdown.active { display: block; }

.share-dropdown button {
    width: 100%;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    margin-bottom: 10px;
}

.share-dropdown .qr-code {
    background: white;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.share-dropdown .qr-code img { max-width: 120px; }

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 600px) {
    .container { padding: 10px; }
    .header h1 { font-size: 1.2rem; }
    .quick-btn { padding: 6px 10px; font-size: 0.8rem; }
    .message { max-width: 90%; }
}
