/**
 * TTUK Practice Manager — AI Assistant Styles
 * Brand: Black #000, Cream #E9E0D3, Orange #EB5F00, Magenta #C43771, Yellow #FAC805
 */

/* ─── Toggle button ─────────────────────────────────────────────── */
.ttuk-pm-ai-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #EB5F00;
    color: #fff;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 9990;
    transition: transform 0.2s, background 0.2s;
}
.ttuk-pm-ai-toggle:hover {
    transform: scale(1.1);
    background: #C43771;
}

/* ─── Panel ──────────────────────────────────────────────────────── */
.ttuk-pm-ai-panel {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 420px;
    max-height: 70vh;
    background: #fff;
    border: 2px solid #EB5F00;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    z-index: 9989;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ttuk-pm-ai-header {
    background: #000;
    color: #E9E0D3;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ttuk-pm-ai-title {
    font-weight: 600;
    font-size: 14px;
}
.ttuk-pm-ai-close {
    background: none;
    border: none;
    color: #E9E0D3;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
}
.ttuk-pm-ai-close:hover {
    color: #EB5F00;
}

.ttuk-pm-ai-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

/* ─── Action buttons ─────────────────────────────────────────────── */
.ttuk-pm-ai-action-btn {
    display: block;
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 8px;
    background: #E9E0D3;
    border: 1px solid #ccc;
    border-radius: 8px;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.ttuk-pm-ai-action-btn:hover {
    background: #EB5F00;
    color: #fff;
    border-color: #EB5F00;
}

/* ─── Input area ─────────────────────────────────────────────────── */
.ttuk-pm-ai-input-area label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}
#ttuk-pm-ai-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
}
#ttuk-pm-ai-input:focus {
    border-color: #EB5F00;
    outline: none;
    box-shadow: 0 0 0 2px rgba(235,95,0,0.2);
}

.ttuk-pm-ai-submit-row {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

/* ─── Buttons ────────────────────────────────────────────────────── */
.ttuk-pm-ai-btn-primary {
    background: #EB5F00;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
}
.ttuk-pm-ai-btn-primary:hover {
    background: #d45500;
}
.ttuk-pm-ai-btn-secondary {
    background: #E9E0D3;
    color: #333;
    border: 1px solid #ccc;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}
.ttuk-pm-ai-btn-secondary:hover {
    background: #ddd;
}
.ttuk-pm-ai-btn-danger {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}
.ttuk-pm-ai-btn-danger:hover {
    background: #c82333;
}

/* ─── Loading ────────────────────────────────────────────────────── */
.ttuk-pm-ai-loading {
    text-align: center;
    padding: 30px 0;
}
.ttuk-pm-ai-spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #E9E0D3;
    border-top-color: #EB5F00;
    border-radius: 50%;
    animation: ttuk-pm-spin 0.8s linear infinite;
    margin: 0 auto 12px;
}
@keyframes ttuk-pm-spin {
    to { transform: rotate(360deg); }
}
.ttuk-pm-ai-loading p {
    font-size: 13px;
    color: #666;
}

/* ─── Result ─────────────────────────────────────────────────────── */
.ttuk-pm-ai-result label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}
.ttuk-pm-ai-output {
    background: #f8f9fa;
    border: 1px solid #e2e2e2;
    border-radius: 6px;
    padding: 12px;
    font-size: 13px;
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    margin-bottom: 12px;
}
.ttuk-pm-ai-result-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.ttuk-pm-ai-meta {
    color: #999;
    font-size: 11px;
}

/* ─── Inline textarea button ─────────────────────────────────────── */
.ttuk-pm-ai-inline-btn {
    display: inline-block;
    background: #EB5F00;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 6px;
    vertical-align: top;
    transition: background 0.15s;
}
.ttuk-pm-ai-inline-btn:hover {
    background: #C43771;
}

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 500px) {
    .ttuk-pm-ai-panel {
        width: calc(100vw - 40px);
        right: 20px;
        bottom: 80px;
    }
}
