/* Skating Help Chatbot */
.ysa-chat-root {
    --ysa-chat-primary: #667eea;
    --ysa-chat-primary-dark: #5568d3;
    --ysa-chat-bg: #ffffff;
    --ysa-chat-text: #333333;
    --ysa-chat-muted: #666666;
    --ysa-chat-bot-bg: #f0f3ff;
    --ysa-chat-user-bg: #667eea;
    --ysa-chat-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    font-family: Arial, Helvetica, sans-serif;
    z-index: 99999;
}

.ysa-chat-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--ysa-chat-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ysa-chat-fab:hover {
    transform: scale(1.06);
    box-shadow: 0 14px 44px rgba(102, 126, 234, 0.45);
}

.ysa-chat-fab[aria-expanded="true"] {
    background: #495057;
}

.ysa-chat-panel {
    position: fixed;
    right: 20px;
    bottom: 90px;
    width: min(380px, calc(100vw - 24px));
    height: min(560px, calc(100vh - 120px));
    background: var(--ysa-chat-bg);
    border-radius: 16px;
    box-shadow: var(--ysa-chat-shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e6e8f0;
}

.ysa-chat-panel.is-open {
    display: flex;
}

.ysa-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ysa-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.ysa-chat-header p {
    margin: 2px 0 0;
    font-size: 12px;
    opacity: 0.9;
}

.ysa-chat-close {
    background: rgba(255, 255, 255, 0.18);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.ysa-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #f7f8fc;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ysa-chat-bubble {
    max-width: 88%;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.ysa-chat-bubble.bot {
    align-self: flex-start;
    background: var(--ysa-chat-bot-bg);
    color: var(--ysa-chat-text);
    border-bottom-left-radius: 4px;
}

.ysa-chat-bubble.user {
    align-self: flex-end;
    background: var(--ysa-chat-user-bg);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ysa-chat-bubble a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
}

.ysa-tech-form {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.ysa-tech-form label {
    display: grid;
    gap: 4px;
    color: #3f4657;
    font-size: 12px;
    font-weight: 700;
}

.ysa-tech-form input,
.ysa-tech-form select,
.ysa-tech-form textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cfd5ea;
    border-radius: 7px;
    background: #fff;
    color: #333;
    padding: 8px;
    font: inherit;
    font-size: 13px;
    font-weight: 400;
}

.ysa-tech-form textarea {
    resize: vertical;
    min-height: 78px;
}

.ysa-tech-form input:focus,
.ysa-tech-form select:focus,
.ysa-tech-form textarea:focus {
    border-color: #667eea;
    outline: 2px solid rgba(102, 126, 234, 0.15);
}

.ysa-tech-form small {
    color: #626a7b;
    font-size: 11px;
    line-height: 1.4;
}

.ysa-tech-form button {
    border: none;
    border-radius: 8px;
    background: #25d366;
    color: #fff;
    padding: 10px 12px;
    font-weight: 700;
    cursor: pointer;
}

.ysa-tech-form button:hover {
    background: #1faa52;
}

.ysa-tech-form button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.ysa-tech-error {
    color: #b42318;
    font-size: 12px;
    font-weight: 700;
}

.ysa-chat-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
    border-top: 1px solid #eceef5;
    background: #fff;
    max-height: 140px;
    overflow-y: auto;
    flex-shrink: 0;
    transition: max-height 0.2s ease, padding 0.2s ease;
}

.ysa-chat-topics.is-collapsed {
    max-height: none;
    padding: 8px 12px;
    flex-wrap: nowrap;
    align-items: center;
}

.ysa-chat-topics.is-collapsed .ysa-chat-topic {
    display: none;
}

.ysa-chat-topics-toggle {
    display: none;
    width: 100%;
    border: 1px dashed #b8c0e8;
    background: #f5f7ff;
    color: #4450a8;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

.ysa-chat-topics.is-collapsed .ysa-chat-topics-toggle {
    display: block;
}

.ysa-chat-topic {
    border: 1px solid #d5daf0;
    background: #fff;
    color: #4450a8;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ysa-chat-topic:hover {
    background: #eef1ff;
    border-color: #667eea;
}

.ysa-chat-form {
    display: flex;
    gap: 8px;
    padding: 10px 12px 12px;
    border-top: 1px solid #eceef5;
    background: #fff;
}

.ysa-chat-form input {
    flex: 1;
    border: 1px solid #d0d5e8;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
}

.ysa-chat-form input:focus {
    border-color: #667eea;
}

.ysa-chat-form button {
    border: none;
    background: var(--ysa-chat-primary);
    color: #fff;
    border-radius: 10px;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.ysa-chat-form button:hover {
    background: var(--ysa-chat-primary-dark);
}

@media (max-width: 480px) {
    .ysa-chat-fab {
        right: 14px;
        bottom: 14px;
    }

    .ysa-chat-panel {
        right: 12px;
        bottom: 80px;
        width: calc(100vw - 24px);
        height: min(70vh, 520px);
    }
}
