/**
 * Shotlog AI Chat Widget Styles
 */

/* Chat Button */
#shotlog-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #308da3;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(48, 141, 163, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#shotlog-chat-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(48, 141, 163, 0.5);
}

#shotlog-chat-button svg {
    width: 28px;
    height: 28px;
    fill: white;
}

#shotlog-chat-button.active svg.chat-icon {
    display: none;
}

#shotlog-chat-button svg.close-icon {
    display: none;
}

#shotlog-chat-button.active svg.close-icon {
    display: block;
}

/* Chat Panel */
#shotlog-chat-panel {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 520px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 9998;
    overflow: hidden;
}

#shotlog-chat-panel.open {
    display: flex;
}

/* Chat Header */
.shotlog-chat-header {
    background: #308da3;
    color: white !important;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.shotlog-chat-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.shotbot-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    padding: 2px;
    object-fit: contain;
}

.shotlog-chat-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff !important;
}

#shotlog-chat-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
}

#shotlog-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

#shotlog-chat-close svg {
    width: 20px;
    height: 20px;
}

/* AI Disclaimer */
.shotlog-chat-disclaimer {
    background: #fef3c7;
    border-bottom: 1px solid #f59e0b;
    padding: 8px 16px;
    font-size: 11px;
    line-height: 1.4;
    color: #92400e;
    text-align: center;
}

/* Chat Messages */
.shotlog-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
}

.shotlog-chat-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.shotlog-chat-message.user {
    align-self: flex-end;
    background: #308da3;
    color: white;
    border-bottom-right-radius: 4px;
}

.shotlog-chat-message.assistant {
    align-self: flex-start;
    background: white;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.shotlog-chat-message.assistant a {
    color: #308da3;
    text-decoration: underline;
}

/* Markdown styles in assistant messages */
.shotlog-chat-message.assistant strong {
    font-weight: 600;
    color: #0f172a;
}

.shotlog-chat-message.assistant em {
    font-style: italic;
}

.shotlog-chat-message.assistant ul,
.shotlog-chat-message.assistant ol {
    margin: 8px 0;
    padding-left: 20px;
}

.shotlog-chat-message.assistant li {
    margin: 4px 0;
    line-height: 1.4;
}

.shotlog-chat-message.assistant ul li {
    list-style-type: disc;
}

.shotlog-chat-message.assistant ol li {
    list-style-type: decimal;
}

/* Welcome Animation */
.shotlog-welcome-animation {
    display: none;
    align-self: center;
    justify-content: center;
    margin: 20px 0;
}

.shotlog-welcome-animation.visible {
    display: flex;
}

.shotlog-welcome-animation .shotbot-wave {
    width: 120px;
    height: auto;
    border-radius: 8px;
}

/* Typing Indicator with Mascot */
.shotlog-typing-indicator {
    display: none;
    align-self: flex-start;
    padding: 10px 14px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    align-items: center;
    gap: 10px;
}

.shotlog-typing-indicator.visible {
    display: flex;
}

.shotlog-typing-indicator .shotbot-thinking {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 4px;
}

.shotlog-typing-indicator .thinking-text {
    font-size: 13px;
    color: #64748b;
    font-style: italic;
}

/* Bot Message with Avatar */
.shotlog-chat-message.assistant {
    align-self: flex-start;
    background: white;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    display: flex;
    flex-direction: column;
}

.shotlog-message-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    align-self: flex-start;
    max-width: 85%;
}

.shotlog-message-wrapper .shotbot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: contain;
    flex-shrink: 0;
    background: #e0f2f7;
    padding: 2px;
}

.shotlog-message-wrapper .shotlog-chat-message.assistant {
    max-width: none;
    flex: 1;
}

/* Chat Input */
.shotlog-chat-input-container {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
}

#shotlog-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

#shotlog-chat-input:focus {
    border-color: #308da3;
}

#shotlog-chat-input::placeholder {
    color: #94a3b8;
}

#shotlog-chat-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #308da3;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

#shotlog-chat-send:hover {
    background: #267080;
}

#shotlog-chat-send:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

#shotlog-chat-send svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #shotlog-chat-panel {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    #shotlog-chat-button {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }

    .shotbot-header-avatar {
        width: 32px;
        height: 32px;
    }

    .shotlog-welcome-animation .shotbot-wave {
        width: 100px;
    }

    .shotlog-message-wrapper .shotbot-avatar {
        width: 28px;
        height: 28px;
    }
}

/* Scrollbar Styling */
.shotlog-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.shotlog-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.shotlog-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.shotlog-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Ticket Form */
.shotlog-ticket-form {
    background: white !important;
    border: 2px solid #308da3 !important;
    border-radius: 12px !important;
    overflow: visible !important;
    margin: 8px 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    display: block !important;
}

.shotlog-ticket-form .ticket-form-header {
    background: #308da3 !important;
    color: white !important;
    padding: 12px 16px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    display: block !important;
}

.shotlog-ticket-form .ticket-form-body {
    padding: 16px !important;
    display: block !important;
    background: white !important;
}

.shotlog-ticket-form .ticket-instructions {
    background: #f0f9ff !important;
    border: 1px solid #bae6fd !important;
    border-radius: 8px !important;
    padding: 10px 12px !important;
    font-size: 13px !important;
    color: #0369a1 !important;
    margin-bottom: 12px !important;
    line-height: 1.4 !important;
}

.shotlog-ticket-form .ticket-field {
    margin-bottom: 12px !important;
    display: block !important;
}

.shotlog-ticket-form .ticket-field label {
    display: block !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #475569 !important;
    margin-bottom: 4px !important;
}

.shotlog-ticket-form .ticket-field input,
.shotlog-ticket-form .ticket-field textarea {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    box-sizing: border-box !important;
    transition: border-color 0.2s ease !important;
    display: block !important;
    background: white !important;
    color: #1e293b !important;
}

.shotlog-ticket-form .ticket-field input:focus,
.shotlog-ticket-form .ticket-field textarea:focus {
    outline: none;
    border-color: #308da3;
}

.shotlog-ticket-form .ticket-field textarea {
    resize: vertical;
    min-height: 60px;
}

.shotlog-ticket-form .ticket-actions {
    display: flex !important;
    gap: 8px !important;
    justify-content: flex-end !important;
    margin-top: 16px !important;
}

.shotlog-ticket-form .ticket-btn {
    padding: 10px 20px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    border: none !important;
    display: inline-block !important;
    line-height: 1.4 !important;
}

.shotlog-ticket-form .ticket-btn-primary {
    background: #308da3 !important;
    color: white !important;
}

.shotlog-ticket-form .ticket-btn-primary:hover {
    background: #267080 !important;
}

.shotlog-ticket-form .ticket-btn-primary:disabled {
    background: #94a3b8 !important;
    cursor: not-allowed !important;
}

.shotlog-ticket-form .ticket-btn-secondary {
    background: #f1f5f9 !important;
    color: #475569 !important;
}

.shotlog-ticket-form .ticket-btn-secondary:hover {
    background: #e2e8f0 !important;
}

/* Chat Action Buttons */
.shotlog-chat-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.shotlog-chat-actions button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
    opacity: 0.8;
}

.shotlog-chat-actions button:hover {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

.shotlog-chat-actions button svg {
    width: 18px;
    height: 18px;
}

#shotlog-chat-download svg,
#shotlog-chat-email svg {
    width: 16px;
    height: 16px;
}

/* Email Form */
.shotlog-email-form {
    background: white !important;
    border: 2px solid #308da3 !important;
    border-radius: 12px !important;
    overflow: visible !important;
    margin: 8px 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    display: block !important;
}

.shotlog-email-form .email-form-header {
    background: #308da3 !important;
    color: white !important;
    padding: 12px 16px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    display: block !important;
}

.shotlog-email-form .email-form-body {
    padding: 16px !important;
    display: block !important;
    background: white !important;
}

.shotlog-email-form .email-field {
    margin-bottom: 12px !important;
    display: block !important;
}

.shotlog-email-form .email-field label {
    display: block !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #475569 !important;
    margin-bottom: 4px !important;
}

.shotlog-email-form .email-field input {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    box-sizing: border-box !important;
    transition: border-color 0.2s ease !important;
    display: block !important;
    background: white !important;
    color: #1e293b !important;
}

.shotlog-email-form .email-field input:focus {
    outline: none;
    border-color: #308da3;
}

.shotlog-email-form .email-actions {
    display: flex !important;
    gap: 8px !important;
    justify-content: flex-end !important;
    margin-top: 16px !important;
}

.shotlog-email-form .email-btn {
    padding: 10px 20px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    border: none !important;
    display: inline-block !important;
    line-height: 1.4 !important;
}

.shotlog-email-form .email-btn-primary {
    background: #308da3 !important;
    color: white !important;
}

.shotlog-email-form .email-btn-primary:hover {
    background: #267080 !important;
}

.shotlog-email-form .email-btn-primary:disabled {
    background: #94a3b8 !important;
    cursor: not-allowed !important;
}

.shotlog-email-form .email-btn-secondary {
    background: #f1f5f9 !important;
    color: #475569 !important;
}

.shotlog-email-form .email-btn-secondary:hover {
    background: #e2e8f0 !important;
}
