/* Enhanced GuideBOT CSS - Orange Theme */

#enhanced-guide-bot {
    position: fixed;
    bottom: 15px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* Chat Toggle Button */
.chat-toggle-btn {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f4881a 0%, #e07312 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(244, 136, 26, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.chat-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(244, 136, 26, 0.6);
}

.chat-toggle-btn:active {
    transform: translateY(0);
}

.chat-toggle-btn svg {
    width: 24px;
    height: 24px;
    color: white;
    transition: all 0.3s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.chat-toggle-btn .close-icon {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(90deg);
}

.chat-toggle-btn.active .chat-icon {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-90deg);
}

.chat-toggle-btn.active .close-icon {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg);
}

/* Chat Bubble */
.chat-bubble {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    max-height: 500px;
    display: flex;
    flex-direction: column;
    overflow-y:auto;
}

.chat-bubble.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Bot Steps */
.bot-step {
    display: none;
    padding: 24px;
    animation: slideIn 0.4s ease-out;
}

.bot-step.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bot Header */
.bot-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.bot-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f4881a 0%, #e07312 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.bot-avatar.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.bot-avatar svg {
    width: 20px;
    height: 20px;
    color: white;
}

.bot-message h3 {
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.bot-message p {
    color: #718096;
    font-size: 14px;
    line-height: 1.6;
}

/* Form Styles */
.chat-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: #4a5568;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #f4881a;
    box-shadow: 0 0 0 3px rgba(244, 136, 26, 0.1);
}

.form-group input::placeholder {
    color: #a0aec0;
}

/* GDPR Consent */
.gdpr-consent {
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    color: #718096;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #f4881a;
    border-color: #f4881a;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark:after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label a {
    color: #f4881a;
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-direction: column;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    flex: 1;
}

.btn-primary {
    background: linear-gradient(135deg, #f4881a 0%, #e07312 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(244, 136, 26, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(244, 136, 26, 0.4);
}

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.btn-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    margin-bottom: 8px;
    width: 100%;
}

.btn-option:hover {
    border-color: #f4881a;
    background: #fff8f1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(244, 136, 26, 0.15);
}

.btn-option:last-child {
    margin-bottom: 0;
}

.option-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.option-content {
    flex: 1;
}

.option-content strong {
    display: block;
    color: #2d3748;
    font-size: 15px;
    margin-bottom: 2px;
}

.option-content span {
    color: #718096;
    font-size: 13px;
}

/* Loading Indicator */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 24px;
    gap: 16px;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #f4881a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: #718096;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 480px) {
    #enhanced-guide-bot {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }

    .chat-toggle-btn {
        width: 50px;
        height: 50px;
        margin-left: auto;
        margin-right: 0;
    }

    .chat-toggle-btn svg {
        width: 20px;
        height: 20px;
    }

    .chat-bubble {
        width: 100%;
        max-width: none;
        right: 0;
        left: 0;
        bottom: 70px;
    }

    .bot-step {
        padding: 20px;
    }

    .bot-message h3 {
        font-size: 16px;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* Accessibility */
.btn:focus,
.form-group input:focus,
.checkbox-label:focus-within {
    outline: 2px solid #f4881a;
    outline-offset: 2px;
}

/* Animation for step transitions */
.bot-step {
    transition: all 0.3s ease;
}

/* Smooth scrolling for overflow */
.chat-bubble {
    scroll-behavior: smooth;
}

/* Custom scrollbar for webkit browsers */
.chat-bubble::-webkit-scrollbar {
    width: 6px;
}

.chat-bubble::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chat-bubble::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.chat-bubble::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Error states */
.form-group input.error {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.error-message {
    color: #e53e3e;
    font-size: 12px;
    margin-top: 4px;
}

/* Success states */
.form-group input.success {
    border-color: #38a169;
    box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.1);
}

/* Pulse animation for chat button */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 20px rgba(244, 136, 26, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(244, 136, 26, 0.6);
    }
    100% {
        box-shadow: 0 4px 20px rgba(244, 136, 26, 0.4);
    }
}

.chat-toggle-btn.pulse {
    animation: pulse 2s infinite;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    color: #718096;
    font-size: 12px;
}

.typing-indicator span {
    display: inline-block;
    width: 4px;
    height: 4px;
    background: #cbd5e0;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        background: #cbd5e0;
    }
    30% {
        transform: translateY(-8px);
        background: #f4881a;
    }
}
