/* ============================================
   AUTOMORA CHATBOT WIDGET  v2
   Premium dark theme · Orange & Blue neon
   ============================================ */

/* Chatbot zoom telafisi: sayfa %80 zoom'da olsa widget normal boyutta görünsün */
#automora-chat-toggle,
#automora-chat-window {
    zoom: 1.25;
}

/* ---- Floating Toggle Button ---- */
#automora-chat-toggle {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B00 0%, #FF9500 100%);
    box-shadow: 0 8px 32px rgba(255, 107, 0, 0.5), 0 0 0 0 rgba(255, 107, 0, 0.35);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99998;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, background 0.3s ease;
    animation: chatPulse 2.8s ease-in-out infinite;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

#automora-chat-toggle:hover {
    transform: scale(1.13) rotate(-8deg);
    box-shadow: 0 12px 36px rgba(255, 107, 0, 0.75), 0 0 0 8px rgba(255, 107, 0, 0.12);
    animation: none;
}

#automora-chat-toggle.is-open {
    background: linear-gradient(135deg, #1a1f38 0%, #252b45 100%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
    transform: rotate(90deg);
    animation: none;
}

#automora-chat-toggle.is-open:hover {
    transform: rotate(90deg) scale(1.1);
}

#automora-chat-toggle svg {
    width: 26px;
    height: 26px;
    transition: opacity 0.2s ease, transform 0.3s ease;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3));
}

#automora-chat-toggle .icon-chat  { display: block; }
#automora-chat-toggle .icon-close { display: none; }
#automora-chat-toggle.is-open .icon-chat  { display: none; }
#automora-chat-toggle.is-open .icon-close { display: block; }

/* Notification badge */
#automora-chat-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: radial-gradient(circle, #00e676 40%, #00BFFF 100%);
    border-radius: 50%;
    border: 2.5px solid #0A0E27;
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.9);
    animation: dotBlink 2s ease-in-out infinite;
}
#automora-chat-toggle.is-open::after { display: none; }

@keyframes chatPulse {
    0%, 100% { box-shadow: 0 8px 32px rgba(255,107,0,0.5), 0 0 0 0 rgba(255,107,0,0.35); }
    50%       { box-shadow: 0 8px 32px rgba(255,107,0,0.5), 0 0 0 14px rgba(255,107,0,0); }
}

@keyframes dotBlink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(0.85); }
}

/* ---- Chat Window ---- */
#automora-chat-window {
    position: fixed;
    bottom: 106px;
    right: 28px;
    width: 390px;
    max-height: 620px;
    background: linear-gradient(160deg, #0d1128 0%, #080c1e 60%, #0a0d22 100%);
    border: 1px solid rgba(255, 107, 0, 0.22);
    border-radius: 24px;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.75),
        0 0 0 1px rgba(255, 255, 255, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
    display: flex;
    flex-direction: column;
    z-index: 99997;
    overflow: hidden;
    transform: scale(0.88) translateY(24px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

#automora-chat-window.is-visible {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Subtle grid overlay */
#automora-chat-window::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,107,0,0.04) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
    z-index: 0;
    border-radius: inherit;
}

/* ---- Header ---- */
.amc-header {
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, rgba(255,107,0,0.12) 0%, rgba(0,191,255,0.06) 100%);
    border-bottom: 1px solid rgba(255, 107, 0, 0.18);
    padding: 16px 18px 14px;
    display: flex;
    align-items: center;
    gap: 13px;
    flex-shrink: 0;
    backdrop-filter: blur(12px);
}

/* Decorative top accent line */
.amc-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, #FF6B00, #FF9500, #00BFFF, #FF6B00);
    background-size: 200% 100%;
    animation: headerShimmer 4s linear infinite;
}

@keyframes headerShimmer {
    0%   { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.amc-header-avatar {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, #FF6B00 0%, #FF9500 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(255, 107, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
}

.amc-header-avatar svg {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}

.amc-header-info { flex: 1; }

.amc-header-title {
    font-size: 14.5px;
    font-weight: 800;
    color: #FFFFFF;
    line-height: 1.2;
    letter-spacing: -0.2px;
}

.amc-header-subtitle {
    font-size: 11px;
    color: rgba(0, 230, 118, 0.9);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
    font-weight: 500;
}

.amc-header-subtitle::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #00e676;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(0, 230, 118, 1);
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(0,230,118,0.9); }
    50%       { box-shadow: 0 0 14px rgba(0,230,118,0.5); }
}

.amc-header-badge {
    flex-shrink: 0;
    padding: 4px 9px;
    background: rgba(0, 191, 255, 0.12);
    border: 1px solid rgba(0, 191, 255, 0.25);
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    color: #00BFFF;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ---- Registration Panel ---- */
#amc-register-panel {
    position: relative;
    z-index: 1;
    flex: 1;
    padding: 22px 20px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#amc-register-panel::-webkit-scrollbar { width: 3px; }
#amc-register-panel::-webkit-scrollbar-track { background: transparent; }
#amc-register-panel::-webkit-scrollbar-thumb { background: rgba(255,107,0,0.3); border-radius: 2px; }

.amc-register-header {
    text-align: center;
    margin-bottom: 20px;
}

.amc-register-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, rgba(255,107,0,0.15), rgba(0,191,255,0.1));
    border: 1px solid rgba(255,107,0,0.25);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 22px;
}

.amc-register-title {
    font-size: 17px;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 5px;
    letter-spacing: -0.3px;
}

.amc-register-desc {
    font-size: 12px;
    color: #6B7A99;
    line-height: 1.6;
}

/* Row layout for name + surname */
.amc-field-row {
    display: flex;
    gap: 10px;
}

.amc-field-row .amc-field {
    flex: 1;
}

.amc-field {
    margin-bottom: 11px;
}

.amc-field label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    font-weight: 700;
    color: #8A98B8;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.amc-field label span.amc-lbl-icon {
    font-size: 12px;
    opacity: 0.8;
}

.amc-field input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px 13px;
    font-size: 13px;
    color: #FFFFFF;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    font-family: inherit;
    -webkit-appearance: none;
}

.amc-field input::placeholder { color: #3a4a65; }

.amc-field input:focus {
    border-color: rgba(255, 107, 0, 0.6);
    background: rgba(255,107,0,0.04);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.08), inset 0 1px 0 rgba(255,255,255,0.04);
}

.amc-field input.error {
    border-color: rgba(255, 69, 58, 0.6);
    box-shadow: 0 0 0 3px rgba(255, 69, 58, 0.08);
}

.amc-field-error {
    font-size: 10.5px;
    color: #FF6B6B;
    margin-top: 4px;
    display: none;
    padding-left: 2px;
}
.amc-field-error.visible { display: block; }

/* Phone row */
.amc-phone-row {
    display: flex;
    align-items: stretch;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.amc-phone-row:focus-within {
    border-color: rgba(255, 107, 0, 0.6);
    background: rgba(255,107,0,0.04);
    box-shadow: 0 0 0 3px rgba(255,107,0,0.08);
}

.amc-phone-row.error {
    border-color: rgba(255, 69, 58, 0.6);
    box-shadow: 0 0 0 3px rgba(255,69,58,0.08);
}

.amc-phone-prefix {
    flex-shrink: 0;
    padding: 10px 12px;
    background: rgba(255,107,0,0.1);
    color: #FF8C00;
    font-weight: 800;
    font-size: 13px;
    display: flex;
    align-items: center;
    border-right: 1px solid rgba(255,107,0,0.18);
    user-select: none;
    letter-spacing: 0.3px;
}

.amc-phone-row input[type="tel"] {
    flex: 1;
    min-width: 0;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.amc-phone-row input[type="tel"]:focus,
.amc-phone-row input[type="tel"].error {
    border: none !important;
    box-shadow: none !important;
}

.amc-submit-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #FF6B00 0%, #FF9500 100%);
    border: none;
    border-radius: 12px;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    margin-top: 8px;
    letter-spacing: 0.3px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.amc-submit-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 60%);
    pointer-events: none;
}

.amc-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 107, 0, 0.55);
    filter: brightness(1.08);
}

.amc-submit-btn:active  { transform: translateY(0); }
.amc-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

.amc-privacy-note {
    font-size: 10px;
    color: #3a4a65;
    text-align: center;
    margin-top: 11px;
    line-height: 1.6;
}
.amc-privacy-note a {
    color: rgba(0,191,255,0.7);
    text-decoration: none;
    transition: color 0.2s;
}
.amc-privacy-note a:hover { color: #00BFFF; }

/* ---- Chat Panel ---- */
#amc-chat-panel {
    position: relative;
    z-index: 1;
    flex: 1;
    display: none;
    flex-direction: column;
    overflow: hidden;
}
#amc-chat-panel.is-active { display: flex; }

/* Messages Area */
.amc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}

.amc-messages::-webkit-scrollbar { width: 3px; }
.amc-messages::-webkit-scrollbar-track { background: transparent; }
.amc-messages::-webkit-scrollbar-thumb { background: rgba(255,107,0,0.25); border-radius: 2px; }

/* Message Bubbles */
.amc-msg {
    display: flex;
    gap: 9px;
    max-width: 88%;
    animation: msgSlideIn 0.32s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

@keyframes msgSlideIn {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.amc-msg.bot  { align-self: flex-start; }
.amc-msg.user { align-self: flex-end; flex-direction: row-reverse; }

.amc-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: linear-gradient(135deg, #FF6B00, #FF9500);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 800;
    color: white;
    box-shadow: 0 3px 10px rgba(255,107,0,0.35);
    letter-spacing: -0.5px;
}

.amc-msg.user .amc-msg-avatar {
    background: linear-gradient(135deg, #0080CC, #00BFFF);
    box-shadow: 0 3px 10px rgba(0,191,255,0.3);
}

.amc-msg-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.amc-msg-bubble {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    border-top-left-radius: 4px;
    padding: 11px 15px;
    font-size: 13px;
    color: #C8D4EE;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.amc-msg.user .amc-msg-bubble {
    background: linear-gradient(135deg, rgba(255,107,0,0.22), rgba(255,150,0,0.15));
    border-color: rgba(255,107,0,0.3);
    border-radius: 16px;
    border-top-right-radius: 4px;
    color: #FFFFFF;
    box-shadow: 0 2px 12px rgba(255,107,0,0.12), inset 0 1px 0 rgba(255,255,255,0.1);
}

.amc-msg-bubble strong,
.amc-msg-bubble b {
    color: #FF9500;
    font-weight: 700;
}

.amc-msg-bubble a {
    color: #00BFFF;
    text-decoration: none;
}

.amc-msg-bubble code {
    background: rgba(0,191,255,0.1);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 11.5px;
    color: #7DD3FC;
}

.amc-msg-time {
    font-size: 10px;
    color: #3a4a65;
    padding: 0 5px;
}
.amc-msg.user .amc-msg-time { text-align: right; }

/* Typing Indicator */
.amc-typing {
    display: flex;
    gap: 9px;
    align-self: flex-start;
    animation: msgSlideIn 0.3s ease;
}

.amc-typing-dots {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    border-top-left-radius: 4px;
    padding: 13px 18px;
    display: flex;
    gap: 5px;
    align-items: center;
}

.amc-typing-dots span {
    width: 7px;
    height: 7px;
    background: rgba(255, 107, 0, 0.8);
    border-radius: 50%;
    animation: typingBounce 1.2s ease-in-out infinite;
}

.amc-typing-dots span:nth-child(1) { animation-delay: 0s; }
.amc-typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.amc-typing-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30%            { transform: translateY(-6px); opacity: 1; }
}

/* ---- Quick Suggestions ---- */
.amc-suggestions {
    padding: 4px 14px 12px;
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.amc-suggestion-chip {
    padding: 6px 13px;
    background: rgba(255,107,0,0.07);
    border: 1px solid rgba(255,107,0,0.22);
    border-radius: 20px;
    font-size: 11.5px;
    color: #FF9500;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    font-family: inherit;
    font-weight: 600;
    outline: none;
}

.amc-suggestion-chip:hover {
    background: rgba(255,107,0,0.17);
    border-color: rgba(255,107,0,0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,107,0,0.2);
}

.amc-suggestion-chip:active { transform: translateY(0); }

/* ---- Error Banner ---- */
.amc-error-banner {
    padding: 9px 16px;
    background: rgba(255, 69, 58, 0.12);
    border-top: 1px solid rgba(255, 69, 58, 0.25);
    font-size: 11.5px;
    color: #FF6B6B;
    text-align: center;
    display: none;
}
.amc-error-banner.visible { display: block; }

/* ---- Input Area ---- */
.amc-input-area {
    padding: 12px 14px 14px;
    background: rgba(255,255,255,0.025);
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    gap: 9px;
    align-items: flex-end;
    flex-shrink: 0;
}

.amc-input-wrap {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.amc-input-wrap:focus-within {
    border-color: rgba(255, 107, 0, 0.5);
    background: rgba(255,107,0,0.03);
    box-shadow: 0 0 0 3px rgba(255,107,0,0.07);
}

.amc-input-wrap textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 11px 13px;
    font-size: 13px;
    color: #FFFFFF;
    font-family: inherit;
    resize: none;
    min-height: 42px;
    max-height: 110px;
    line-height: 1.45;
    scrollbar-width: thin;
}

.amc-input-wrap textarea::placeholder { color: #3a4a65; }

.amc-send-btn {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #FF6B00, #FF9500);
    border: none;
    border-radius: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    outline: none;
    position: relative;
    overflow: hidden;
}

.amc-send-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, transparent 60%);
    pointer-events: none;
}

.amc-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 18px rgba(255,107,0,0.55);
    filter: brightness(1.1);
}

.amc-send-btn:active { transform: scale(0.95); }

.amc-send-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    filter: none;
    box-shadow: none;
}

.amc-send-btn svg {
    width: 17px;
    height: 17px;
    position: relative;
    z-index: 1;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    #automora-chat-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 88vh;
        border-radius: 22px 22px 0 0;
    }

    #automora-chat-toggle {
        bottom: 20px;
        right: 20px;
    }

    .amc-field-row {
        flex-direction: column;
        gap: 0;
    }
}
