/**
 * SES Service - AI Chatbot Styles
 * Responzivní styly pro chatbot widget
 */

/* ===== CHATBOT CONTAINER ===== */
.ses-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== TOGGLE BUTTON ===== */
.ses-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0066CC 0%, #004C99 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 102, 204, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    color: white;
}

.ses-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 102, 204, 0.5);
}

.ses-chat-toggle:active {
    transform: scale(0.95);
}

.ses-chat-toggle-icon,
.ses-chat-toggle-close {
    position: absolute;
    transition: all 0.3s ease;
}

.ses-chat-toggle-icon {
    opacity: 1;
    transform: scale(1);
}

.ses-chat-toggle-close {
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
}

.ses-chat-toggle-active .ses-chat-toggle-icon {
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
}

.ses-chat-toggle-active .ses-chat-toggle-close {
    opacity: 1;
    transform: scale(1) rotate(0);
}

/* Badge */
.ses-chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    background: #FFD700;
    color: #0066CC;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ===== CHAT WINDOW ===== */
.ses-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ses-chatbot-open .ses-chat-window {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* ===== CHAT HEADER ===== */
.ses-chat-header {
    background: linear-gradient(135deg, #0066CC 0%, #004C99 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.ses-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ses-chat-avatar {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ses-chat-avatar svg {
    color: white;
}

.ses-chat-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.ses-chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.ses-chat-status-dot {
    width: 8px;
    height: 8px;
    background: #4ADE80;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ses-chat-header-actions {
    display: flex;
    gap: 8px;
}

.ses-chat-minimize,
.ses-chat-close {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s ease;
}

.ses-chat-minimize:hover,
.ses-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== CHAT MESSAGES ===== */
.ses-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f8f9fc;
}

.ses-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ses-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ses-chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.ses-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ===== MESSAGE BUBBLES ===== */
.ses-chat-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: message-in 0.3s ease;
}

@keyframes message-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ses-chat-message-user {
    align-self: flex-end;
}

.ses-chat-message-assistant {
    align-self: flex-start;
}

.ses-chat-message-content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.ses-chat-message-user .ses-chat-message-content {
    background: linear-gradient(135deg, #0066CC 0%, #004C99 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.ses-chat-message-assistant .ses-chat-message-content {
    background: white;
    color: #374151;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ses-chat-message-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.ses-chat-message-content li {
    margin: 4px 0;
}

.ses-chat-message-content a {
    color: #0066CC;
    text-decoration: underline;
}

.ses-chat-message-user .ses-chat-message-content a {
    color: #FFD700;
}

.ses-chat-message-content strong {
    font-weight: 600;
}

.ses-chat-message-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
    padding: 0 4px;
}

.ses-chat-message-user .ses-chat-message-time {
    text-align: right;
}

/* ===== TYPING INDICATOR ===== */
.ses-chat-typing {
    display: none;
    align-self: flex-start;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ses-chat-typing-visible {
    display: block;
}

.ses-chat-typing-dots {
    display: flex;
    gap: 4px;
}

.ses-chat-typing-dots span {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.ses-chat-typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.ses-chat-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.ses-chat-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        background: #9ca3af;
    }
    30% {
        transform: translateY(-8px);
        background: #0066CC;
    }
}

/* ===== QUICK ACTIONS ===== */
.ses-chat-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px;
    background: #f8f9fc;
    border-top: 1px solid #e5e7eb;
}

.ses-quick-btn {
    padding: 8px 14px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ses-quick-btn:hover {
    background: #0066CC;
    color: white;
    border-color: #0066CC;
    transform: translateY(-1px);
}

/* ===== CHAT FORM ===== */
.ses-chat-form {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.ses-chat-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f3f4f6;
    border-radius: 24px;
    padding: 4px 4px 4px 16px;
    transition: all 0.2s ease;
}

.ses-chat-input-wrapper:focus-within {
    background: #e5e7eb;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.ses-chat-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #374151;
    outline: none;
    padding: 8px 0;
}

.ses-chat-input::placeholder {
    color: #9ca3af;
}

.ses-chat-send {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #0066CC 0%, #004C99 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ses-chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.ses-chat-send:active {
    transform: scale(0.95);
}

.ses-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== CHAT FOOTER ===== */
.ses-chat-footer {
    text-align: center;
    margin-top: 12px;
    font-size: 11px;
    color: #9ca3af;
}

/* ===== RESPONSIVE - TABLET ===== */
@media (max-width: 768px) {
    .ses-chatbot {
        bottom: 15px;
        right: 15px;
    }

    .ses-chat-toggle {
        width: 56px;
        height: 56px;
    }

    .ses-chat-window {
        width: 340px;
        height: 500px;
        bottom: 75px;
    }

    .ses-chat-header {
        padding: 14px 16px;
    }

    .ses-chat-messages {
        padding: 16px;
    }

    .ses-chat-quick-actions {
        padding: 10px 16px;
    }

    .ses-chat-form {
        padding: 14px 16px;
    }
}

/* ===== RESPONSIVE - MOBILE ===== */
@media (max-width: 480px) {
    .ses-chatbot {
        bottom: 0;
        right: 0;
        left: 0;
    }

    .ses-chat-toggle {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 54px;
        height: 54px;
    }

    .ses-chat-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: 100vh;
        max-height: 100dvh;
    }

    .ses-chatbot-open .ses-chat-toggle {
        display: none;
    }

    .ses-chat-header {
        padding: 16px;
        border-radius: 0;
    }

    .ses-chat-avatar {
        width: 40px;
        height: 40px;
    }

    .ses-chat-messages {
        padding: 16px;
        gap: 12px;
    }

    .ses-chat-message {
        max-width: 90%;
    }

    .ses-chat-message-content {
        padding: 10px 14px;
        font-size: 15px;
    }

    .ses-chat-quick-actions {
        padding: 12px 16px;
        gap: 6px;
    }

    .ses-quick-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .ses-chat-form {
        padding: 12px 16px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .ses-chat-input-wrapper {
        padding: 4px 4px 4px 14px;
    }

    .ses-chat-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .ses-chat-send {
        width: 38px;
        height: 38px;
    }

    .ses-chat-footer {
        margin-top: 8px;
    }
}

/* ===== DARK MODE SUPPORT (optional) ===== */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode
    .ses-chat-window {
        background: #1f2937;
    }

    .ses-chat-messages {
        background: #111827;
    }

    .ses-chat-message-assistant .ses-chat-message-content {
        background: #374151;
        color: #f3f4f6;
    }

    .ses-chat-quick-actions {
        background: #111827;
        border-color: #374151;
    }

    .ses-quick-btn {
        background: #374151;
        border-color: #4b5563;
        color: #f3f4f6;
    }

    .ses-chat-form {
        background: #1f2937;
        border-color: #374151;
    }

    .ses-chat-input-wrapper {
        background: #374151;
    }

    .ses-chat-input {
        color: #f3f4f6;
    }

    .ses-chat-input::placeholder {
        color: #9ca3af;
    }
    */
}

/* ===== PRINT STYLES ===== */
@media print {
    .ses-chatbot {
        display: none !important;
    }
}

/* ===== CTA BUTTON IN CHAT ===== */
.ses-chat-cta-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #FFD700 0%, #FFC000 100%);
    color: #0a1628;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.ses-chat-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, #FFE033 0%, #FFD700 100%);
}

.ses-chat-cta-btn:active {
    transform: translateY(0);
}

/* ===== ACCESSIBILITY ===== */
.ses-chat-toggle:focus,
.ses-chat-minimize:focus,
.ses-chat-close:focus,
.ses-quick-btn:focus,
.ses-chat-send:focus,
.ses-chat-cta-btn:focus {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}

.ses-chat-input:focus {
    outline: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ses-chat-toggle,
    .ses-chat-window,
    .ses-chat-message,
    .ses-chat-typing-dots span,
    .ses-chat-badge {
        animation: none;
        transition: none;
    }
}
