/**
 * Steppy AI Chatbot - Complete Styles
 */

:root {
    --steppy-primary: #667eea;
    --steppy-secondary: #764ba2;
    --steppy-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Main Widget Container */
#steppy-chat-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Position variants */
#steppy-chat-widget.bottom-right {
    bottom: 20px;
    right: 20px;
}

#steppy-chat-widget.bottom-left {
    bottom: 20px;
    left: 20px;
}

#steppy-chat-widget.top-right {
    top: 20px;
    right: 20px;
}

#steppy-chat-widget.top-left {
    top: 20px;
    left: 20px;
}

/* Chat Button */
.steppy-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--steppy-primary) 0%, var(--steppy-secondary) 100%);
    border: none;
    cursor: pointer;
    box-shadow: var(--steppy-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
}

.steppy-chat-button:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.4);
}

.steppy-chat-button:active {
    transform: scale(0.95);
}

.steppy-chat-button.active {
    background: linear-gradient(135deg, var(--steppy-secondary) 0%, var(--steppy-primary) 100%);
}

.chat-icon {
    font-size: 28px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Chat Window */
.steppy-chat-window {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Adjust position for different layouts */
.bottom-left .steppy-chat-window {
    left: 20px;
    right: auto;
}

.top-right .steppy-chat-window {
    top: 90px;
    bottom: auto;
}

.top-left .steppy-chat-window {
    top: 90px;
    bottom: auto;
    left: 20px;
    right: auto;
}

/* Header */
.steppy-chat-header {
    background: linear-gradient(135deg, var(--steppy-primary) 0%, var(--steppy-secondary) 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.steppy-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.steppy-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    backdrop-filter: blur(10px);
}

.steppy-header-text h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.steppy-header-text p {
    margin: 2px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.steppy-status {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.steppy-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    line-height: 1;
}

.steppy-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Messages Area */
.steppy-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    scroll-behavior: smooth;
}

.steppy-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.steppy-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.steppy-chat-messages::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 3px;
}

.steppy-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

/* Message Bubbles */
.steppy-message {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.steppy-message.user {
    flex-direction: row-reverse;
}

.steppy-message-avatar {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, var(--steppy-primary), var(--steppy-secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.steppy-message-content {
    max-width: 75%;
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
}

.steppy-message.user .steppy-message-content {
    background: linear-gradient(135deg, var(--steppy-primary), var(--steppy-secondary));
    color: white;
}

.steppy-message-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
}

.steppy-message-time {
    display: block;
    font-size: 11px;
    opacity: 0.6;
    margin-top: 6px;
}

.steppy-message.error-message .steppy-message-content {
    background: #fee;
    color: #c00;
    border-left: 4px solid #c00;
}

/* Guest & User Info Boxes */
.steppy-guest-info,
.steppy-user-info,
.steppy-admin-badge,
.steppy-system-warning {
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    font-size: 13px;
}

.steppy-guest-info {
    background: linear-gradient(135deg, #fff9e6, #ffe4a3);
    color: #856404;
    text-align: center;
}

.steppy-user-info {
    background: rgba(102, 126, 234, 0.1);
}

.steppy-admin-badge {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.steppy-system-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.steppy-system-warning strong {
    display: block;
    margin-bottom: 5px;
}

.steppy-system-warning a {
    color: var(--steppy-primary);
    text-decoration: underline;
    font-weight: 600;
}

/* Typing Indicator */
.steppy-typing-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.steppy-typing-dots {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    gap: 4px;
}

.steppy-typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--steppy-primary);
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.steppy-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.steppy-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Quick Actions */
.steppy-quick-actions {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.steppy-quick-btn {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 2px solid transparent;
    color: var(--steppy-primary);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.steppy-quick-btn:hover {
    background: linear-gradient(135deg, var(--steppy-primary), var(--steppy-secondary));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Input Area */
.steppy-chat-input {
    background: white;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.steppy-input-container {
    padding: 15px 20px;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.steppy-input {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    padding: 12px 18px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
    font-family: inherit;
}

.steppy-input:focus {
    border-color: var(--steppy-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.steppy-send-btn {
    background: linear-gradient(135deg, var(--steppy-primary), var(--steppy-secondary));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.steppy-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.steppy-send-btn:active {
    transform: translateY(0);
}

.steppy-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    #steppy-chat-widget.bottom-right,
    #steppy-chat-widget.bottom-left {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .steppy-chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 80px;
        right: 10px;
        left: 10px;
    }
    
    .steppy-message-content {
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    .steppy-chat-button {
        width: 55px;
        height: 55px;
    }
    
    .chat-icon {
        font-size: 24px;
    }
    
    .steppy-chat-header {
        padding: 15px;
    }
    
    .steppy-header-text h3 {
        font-size: 16px;
    }
    
    .steppy-chat-messages {
        padding: 15px;
    }
    
    .steppy-input-container {
        padding: 12px 15px;
    }
    
    .steppy-quick-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}