/**
 * Davey GPT Chatbot Styles
 * Cyberpunk Futuristic Theme
 */

/* Main theme style variables */
:root {
    --dgpt-dark-bg: #10151a;
    --dgpt-holoblue: #00eaff;
    --dgpt-cyberpink: #ff2a8a;
    --dgpt-text-light: #ffffff;
    --dgpt-text-dark: #10151a;
    --dgpt-glass-bg: rgba(16, 21, 26, 0.85);
    --dgpt-glass-border: rgba(0, 234, 255, 0.3);
    --dgpt-golden-ratio: 1.2rem;
    --dgpt-holo-glow: 0 0 15px rgba(0, 234, 255, 0.5);
    --dgpt-pink-glow: 0 0 15px rgba(255, 42, 138, 0.5);
    --dgpt-transition-speed: 0.3s; /* Standard transition speed */
}

/* Theme variables for each theme style */
.davey-gpt-chat-window[data-theme="cyberpunk"],
.davey-gpt-floating[data-theme="cyberpunk"] {
    --dgpt-dark-bg: #10151a;
    --dgpt-theme-primary: #C3317D;
    --dgpt-theme-secondary: #8BDFF9;
    --dgpt-text-light: #ffffff;
    --dgpt-text-dark: #10151a;
    --dgpt-glass-bg: rgba(16, 21, 26, 0.85);
    --dgpt-glass-border: rgba(139, 223, 249, 0.3);
    --dgpt-primary-glow: 0 0 15px rgba(195, 49, 125, 0.5);
    --dgpt-secondary-glow: 0 0 15px rgba(139, 223, 249, 0.5);
    --dgpt-background-image: linear-gradient(135deg, #10151a 0%, #1a2432 100%);
}

.davey-gpt-chat-window[data-theme="fathead"],
.davey-gpt-floating[data-theme="fathead"] {
    --dgpt-dark-bg: #f5f5f5;
    --dgpt-theme-primary: #2DC0FF;
    --dgpt-theme-secondary: #FBC305;
    --dgpt-text-light: #ffffff;
    --dgpt-text-dark: #333333;
    --dgpt-glass-bg: rgba(255, 255, 255, 0.9);
    --dgpt-glass-border: rgba(45, 192, 255, 0.3);
    --dgpt-primary-glow: 0 0 10px rgba(45, 192, 255, 0.3);
    --dgpt-secondary-glow: 0 0 10px rgba(251, 195, 5, 0.3);
    --dgpt-background-image: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
}

.davey-gpt-chat-window[data-theme="tavern"],
.davey-gpt-floating[data-theme="tavern"] {
    --dgpt-dark-bg: #2a1a0d;
    --dgpt-theme-primary: #7D4E2A;
    --dgpt-theme-secondary: #D0A85C;
    --dgpt-text-light: #f5e6d3;
    --dgpt-text-dark: #2a1a0d;
    --dgpt-glass-bg: rgba(42, 26, 13, 0.85);
    --dgpt-glass-border: rgba(208, 168, 92, 0.5);
    --dgpt-primary-glow: 0 0 10px rgba(125, 78, 42, 0.5);
    --dgpt-secondary-glow: 0 0 10px rgba(208, 168, 92, 0.5);
    --dgpt-background-image: linear-gradient(135deg, #2a1a0d 0%, #3c2915 100%);
}

.davey-gpt-chat-window[data-theme="kangal"],
.davey-gpt-floating[data-theme="kangal"] {
    --dgpt-dark-bg: #ffffff;
    --dgpt-theme-primary: #FFFFFF;
    --dgpt-theme-secondary: #007BFF;
    --dgpt-text-light: #333333;
    --dgpt-text-dark: #333333;
    --dgpt-glass-bg: rgba(255, 255, 255, 0.95);
    --dgpt-glass-border: rgba(0, 123, 255, 0.3);
    --dgpt-primary-glow: 0 0 10px rgba(0, 123, 255, 0.3);
    --dgpt-secondary-glow: 0 0 10px rgba(51, 51, 51, 0.3);
    --dgpt-background-image: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%);
}

/* Adding the new KinderSync theme */
.davey-gpt-chat-window[data-theme="kindersync"],
.davey-gpt-floating[data-theme="kindersync"] {
    --dgpt-dark-bg: #f8f6ff;
    --dgpt-theme-primary: #6A0DAD;
    --dgpt-theme-secondary: #FFD700;
    --dgpt-text-light: #ffffff;
    --dgpt-text-dark: #333333;
    --dgpt-glass-bg: rgba(248, 246, 255, 0.9);
    --dgpt-glass-border: rgba(106, 13, 173, 0.4);
    --dgpt-primary-glow: 0 0 10px rgba(106, 13, 173, 0.4);
    --dgpt-secondary-glow: 0 0 10px rgba(255, 215, 0, 0.4);
    --dgpt-background-image: linear-gradient(135deg, #f8f6ff 0%, #eeeaff 100%);
}

.davey-gpt-chat-window[data-theme="kindersync"] {
    border: 2px solid var(--dgpt-theme-secondary);
    box-shadow: 0 4px 15px rgba(106, 13, 173, 0.2);
    background: var(--dgpt-background-image);
}

.davey-gpt-chat-window[data-theme="kindersync"] .davey-gpt-assistant {
    background-color: var(--dgpt-glass-bg);
    color: var(--dgpt-text-dark);
    border: 1px solid var(--dgpt-glass-border);
    box-shadow: var(--dgpt-primary-glow);
    border-radius: 20px 20px 20px 4px;
    font-size: 14px;
}

.davey-gpt-chat-window[data-theme="kindersync"] .davey-gpt-user {
    background-color: var(--dgpt-theme-primary);
    box-shadow: var(--dgpt-primary-glow);
    border-radius: 20px 20px 4px 20px;
    color: var(--dgpt-text-light);
}

.davey-gpt-chat-window[data-theme="kindersync"] .davey-gpt-input-area {
    background-color: var(--dgpt-dark-bg);
    border-top: 1px solid var(--dgpt-glass-border);
}

.davey-gpt-chat-window[data-theme="kindersync"] .davey-gpt-input {
    background-color: #fff;
    border: 2px solid var(--dgpt-theme-primary);
    border-radius: 20px;
    color: var(--dgpt-text-dark);
}

.davey-gpt-chat-window[data-theme="kindersync"] .davey-gpt-submit {
    background-color: var(--dgpt-theme-primary);
    box-shadow: var(--dgpt-primary-glow);
}

.davey-gpt-chat-window[data-theme="kindersync"] .davey-gpt-submit:hover {
    background-color: var(--dgpt-theme-secondary);
    box-shadow: var(--dgpt-secondary-glow);
}

.davey-gpt-floating[data-theme="kindersync"] .davey-gpt-floating-button {
    background-color: var(--dgpt-theme-primary);
    box-shadow: var(--dgpt-primary-glow);
    border: 2px solid var(--dgpt-theme-secondary);
}

.davey-gpt-floating[data-theme="kindersync"] .davey-gpt-floating-container {
    background-color: var(--dgpt-dark-bg);
    border: 2px solid var(--dgpt-theme-secondary);
    box-shadow: var(--dgpt-primary-glow);
    border-radius: 20px;
}

.davey-gpt-floating[data-theme="kindersync"] .davey-gpt-floating-header {
    border-bottom: 2px solid var(--dgpt-theme-secondary);
}

.davey-gpt-floating[data-theme="kindersync"] .davey-gpt-floating-title {
    color: var(--dgpt-text-dark);
    font-family: 'Comic Sans MS', 'Chalkboard SE', sans-serif;
}

.davey-gpt-floating[data-theme="kindersync"] .davey-gpt-floating-close {
    color: var(--dgpt-theme-primary);
}

.davey-gpt-chat-window[data-theme="kindersync"] .davey-gpt-continue-btn {
    background-color: rgba(106, 13, 173, 0.15);
    border-color: rgba(106, 13, 173, 0.3);
    color: var(--dgpt-theme-primary);
    border-radius: 20px;
}

/* Floating chat control buttons */
.davey-gpt-floating-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.davey-gpt-floating-minimize,
.davey-gpt-floating-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    transition: all 0.2s ease;
}

.davey-gpt-floating-minimize:hover,
.davey-gpt-floating-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #666;
}

/* Theme-specific control button styling */
.davey-gpt-floating[data-theme="cyberpunk"] .davey-gpt-floating-minimize,
.davey-gpt-floating[data-theme="cyberpunk"] .davey-gpt-floating-close {
    color: var(--dgpt-theme-secondary);
}

.davey-gpt-floating[data-theme="cyberpunk"] .davey-gpt-floating-minimize:hover,
.davey-gpt-floating[data-theme="cyberpunk"] .davey-gpt-floating-close:hover {
    background-color: rgba(139, 223, 249, 0.1);
}

.davey-gpt-floating[data-theme="fathead"] .davey-gpt-floating-minimize,
.davey-gpt-floating[data-theme="fathead"] .davey-gpt-floating-close {
    color: var(--dgpt-theme-primary);
}

.davey-gpt-floating[data-theme="fathead"] .davey-gpt-floating-minimize:hover,
.davey-gpt-floating[data-theme="fathead"] .davey-gpt-floating-close:hover {
    background-color: rgba(45, 192, 255, 0.1);
}

.davey-gpt-floating[data-theme="tavern"] .davey-gpt-floating-minimize,
.davey-gpt-floating[data-theme="tavern"] .davey-gpt-floating-close {
    color: var(--dgpt-theme-secondary);
}

.davey-gpt-floating[data-theme="tavern"] .davey-gpt-floating-minimize:hover,
.davey-gpt-floating[data-theme="tavern"] .davey-gpt-floating-close:hover {
    background-color: rgba(208, 168, 92, 0.1);
}

.davey-gpt-floating[data-theme="kangal"] .davey-gpt-floating-minimize,
.davey-gpt-floating[data-theme="kangal"] .davey-gpt-floating-close {
    color: var(--dgpt-theme-secondary);
}

.davey-gpt-floating[data-theme="kindersync"] .davey-gpt-floating-minimize,
.davey-gpt-floating[data-theme="kindersync"] .davey-gpt-floating-close {
    color: var(--dgpt-theme-primary);
}

.davey-gpt-floating[data-theme="kindersync"] .davey-gpt-floating-minimize:hover,
.davey-gpt-floating[data-theme="kindersync"] .davey-gpt-floating-close:hover {
    background-color: rgba(106, 13, 173, 0.1);
    color: var(--dgpt-theme-secondary);
}

/* Ensure the input area and textarea are properly visible */
.davey-gpt-input-area {
    display: flex;
    padding: 10px;
    border-top: 1px solid #e0e0e0;
    background-color: white;
    z-index: 5;
    position: relative;
}

.davey-gpt-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 18px;
    padding: 8px 14px;
    outline: none;
    resize: none;
    min-height: 40px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: white;
    color: #333;
}

/* Make sure the dashicons in buttons display properly */
.davey-gpt-floating-controls .dashicons {
    width: 20px;
    height: 20px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Davey GPT Chat Styles */
.davey-gpt-container,
.davey-gpt-floating {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px; /* Reduced from default 16px */
}

/* Chat Window */
.davey-gpt-chat-window {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: white;
    display: flex;
    flex-direction: column;
    height: 500px;
    position: relative; /* Required for resize handle positioning */
    min-height: 300px; /* Minimum height when resizing */
    max-height: 80vh; /* Maximum height */
}

/* Resize handle for the chat window */
.davey-gpt-resize-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background-color: transparent;
    cursor: ns-resize;
    z-index: 100;
    transition: background-color 0.2s;
}

.davey-gpt-resize-handle:hover {
    background-color: var(--dgpt-theme-primary);
    opacity: 0.3;
}

/* Floating chat specific resize handle - for side resizing */
.davey-gpt-floating-container .davey-gpt-resize-handle {
    left: -3px;
    top: 0;
    width: 6px;
    height: 100%;
    cursor: ew-resize;
}

.davey-gpt-floating-container {
    min-width: 280px; /* Minimum width when resizing */
    max-width: 95vw;  /* Maximum width */
}

/* Theme-specific chat window styling */
.davey-gpt-chat-window[data-theme="cyberpunk"] {
    border: 1px solid var(--dgpt-theme-secondary);
    box-shadow: 0 0 20px rgba(0, 234, 255, 0.2);
    background: var(--dgpt-background-image);
}

.davey-gpt-chat-window[data-theme="fathead"] {
    border: 1px solid var(--dgpt-theme-primary);
    box-shadow: 0 4px 12px rgba(45, 192, 255, 0.1);
    background: var(--dgpt-background-image);
}

.davey-gpt-chat-window[data-theme="tavern"] {
    border: 2px solid var(--dgpt-theme-secondary);
    box-shadow: 0 4px 20px rgba(125, 78, 42, 0.3);
    background: var(--dgpt-background-image);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><rect width="50" height="50" x="0" y="0" fill="%233c2915" opacity="0.05"/></svg>');
    background-size: 50px 50px;
}

.davey-gpt-chat-window[data-theme="kangal"] {
    border: 1px solid var(--dgpt-theme-secondary);
    box-shadow: 0 4px 15px rgba(112, 66, 20, 0.2);
    background: var(--dgpt-background-image);
}

/* Chat messages container */
.davey-gpt-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 14px; /* Reduced text size */
}

/* Individual message */
.davey-gpt-message {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    line-height: 1.4;
    position: relative;
    font-size: 14px; /* Reduced text size */
    transition: transform 0.2s ease, opacity 0.2s ease;
    animation: fade-slide-in 0.3s forwards;
}

/* Message content */
.davey-gpt-message-content {
    font-size: 13px; /* Further reduced text size for message content */
}

/* AI assistant message */
.davey-gpt-assistant {
    align-self: flex-start;
    background-color: #f0f0f0;
    color: #333;
}

/* Theme-specific assistant message styling */
.davey-gpt-chat-window[data-theme="cyberpunk"] .davey-gpt-assistant {
    background-color: var(--dgpt-glass-bg);
    color: var(--dgpt-text-light);
    border: 1px solid var(--dgpt-glass-border);
    box-shadow: var(--dgpt-secondary-glow);
}

.davey-gpt-chat-window[data-theme="fathead"] .davey-gpt-assistant {
    background-color: #f0f0f0;
    color: var(--dgpt-text-dark);
    border: 1px solid rgba(45, 192, 255, 0.2);
}

.davey-gpt-chat-window[data-theme="tavern"] .davey-gpt-assistant {
    background-color: var(--dgpt-glass-bg);
    color: var(--dgpt-text-light);
    border: 1px solid var(--dgpt-glass-border);
    box-shadow: var(--dgpt-secondary-glow);
}

.davey-gpt-chat-window[data-theme="kangal"] .davey-gpt-assistant {
    background-color: var(--dgpt-glass-bg);
    color: var(--dgpt-text-light);
    border: 1px solid var(--dgpt-glass-border);
}

/* User message */
.davey-gpt-user {
    align-self: flex-end;
    background-color: #6600ff;
    color: white;
}

/* Theme-specific user message styling */
.davey-gpt-chat-window[data-theme="cyberpunk"] .davey-gpt-user {
    background-color: var(--dgpt-theme-primary);
    box-shadow: var(--dgpt-primary-glow);
}

.davey-gpt-chat-window[data-theme="fathead"] .davey-gpt-user {
    background-color: var(--dgpt-theme-primary);
}

.davey-gpt-chat-window[data-theme="tavern"] .davey-gpt-user {
    background-color: var(--dgpt-theme-primary);
    box-shadow: var(--dgpt-primary-glow);
}

.davey-gpt-chat-window[data-theme="kangal"] .davey-gpt-user {
    background-color: var(--dgpt-theme-primary);
}

/* Message with avatar container */
.davey-gpt-message-with-avatar {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
    width: 100%;
}

/* Message avatar styling */
.davey-gpt-message-avatar {
    width: 28px; /* Smaller avatar */
    height: 28px; /* Smaller avatar */
    border-radius: 50%;
    overflow: hidden;
    margin-right: 8px;
    flex-shrink: 0;
    border: 1px solid var(--dgpt-glass-border);
}

.davey-gpt-message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Assistant message with avatar alignment */
.davey-gpt-message-with-avatar .davey-gpt-assistant {
    margin-left: 0;
    margin-right: auto;
}

/* User message with avatar alignment */
.davey-gpt-message-with-avatar .davey-gpt-user {
    margin-left: auto;
    margin-right: 0;
    order: 1;
}

.davey-gpt-message-with-avatar .davey-gpt-message-avatar {
    order: 0;
}

/* Fix ordering for user messages with avatar */
.davey-gpt-message-with-avatar.user-message {
    flex-direction: row-reverse;
}

.davey-gpt-message-with-avatar.user-message .davey-gpt-message-avatar {
    margin-right: 0;
    margin-left: 8px;
}

/* Reverse order for user messages with avatar */
.davey-gpt-message-with-avatar:has(.davey-gpt-user) {
    flex-direction: row-reverse;
}

.davey-gpt-message-with-avatar:has(.davey-gpt-user) .davey-gpt-message-avatar {
    margin-right: 0;
    margin-left: 8px;
}

/* Input area */
.davey-gpt-input-area {
    display: flex;
    padding: 10px;
    border-top: 1px solid #e0e0e0;
    background-color: white;
    z-index: 5;
    position: relative;
}

/* Theme-specific input area styling */
.davey-gpt-chat-window[data-theme="cyberpunk"] .davey-gpt-input-area {
    background-color: var(--dgpt-dark-bg);
    border-top: 1px solid var(--dgpt-glass-border);
}

.davey-gpt-chat-window[data-theme="fathead"] .davey-gpt-input-area {
    background-color: white;
    border-top: 1px solid rgba(45, 192, 255, 0.2);
}

.davey-gpt-chat-window[data-theme="tavern"] .davey-gpt-input-area {
    background-color: var(--dgpt-dark-bg);
    border-top: 1px solid var(--dgpt-glass-border);
}

.davey-gpt-chat-window[data-theme="kangal"] .davey-gpt-input-area {
    background-color: var(--dgpt-dark-bg);
    border-top: 1px solid var(--dgpt-glass-border);
}

/* Input field */
.davey-gpt-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 18px;
    padding: 8px 14px;
    outline: none;
    resize: none;
    min-height: 40px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: white;
    color: #333;
}

.davey-gpt-input:focus {
    border-color: #6600ff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Input area text size reduction */
.davey-gpt-input-container textarea.davey-gpt-input {
    font-size: 14px;
}

/* Theme-specific input field styling */
.davey-gpt-chat-window[data-theme="cyberpunk"] .davey-gpt-input {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--dgpt-glass-border);
    color: var(--dgpt-text-light);
}

.davey-gpt-chat-window[data-theme="fathead"] .davey-gpt-input {
    border: 1px solid rgba(45, 192, 255, 0.3);
}

.davey-gpt-chat-window[data-theme="tavern"] .davey-gpt-input {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--dgpt-glass-border);
    color: var(--dgpt-text-light);
}

.davey-gpt-chat-window[data-theme="kangal"] .davey-gpt-input {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--dgpt-glass-border);
    color: var(--dgpt-text-light);
}

/* Send button */
.davey-gpt-submit {
    margin-left: 8px;
    background-color: #6600ff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 13px; /* Reduced text size */
}

.davey-gpt-submit:hover {
    background-color: #5500cc;
}

/* Theme-specific submit button styling */
.davey-gpt-chat-window[data-theme="cyberpunk"] .davey-gpt-submit {
    background-color: var(--dgpt-theme-primary);
    box-shadow: var(--dgpt-primary-glow);
}

.davey-gpt-chat-window[data-theme="cyberpunk"] .davey-gpt-submit:hover {
    background-color: var(--dgpt-theme-secondary);
    box-shadow: var(--dgpt-secondary-glow);
}

.davey-gpt-chat-window[data-theme="fathead"] .davey-gpt-submit {
    background-color: var(--dgpt-theme-primary);
}

.davey-gpt-chat-window[data-theme="fathead"] .davey-gpt-submit:hover {
    background-color: var(--dgpt-theme-secondary);
}

.davey-gpt-chat-window[data-theme="tavern"] .davey-gpt-submit {
    background-color: var(--dgpt-theme-primary);
}

.davey-gpt-chat-window[data-theme="tavern"] .davey-gpt-submit:hover {
    background-color: var(--dgpt-theme-secondary);
}

.davey-gpt-chat-window[data-theme="kangal"] .davey-gpt-submit {
    background-color: var(--dgpt-theme-primary);
}

.davey-gpt-chat-window[data-theme="kangal"] .davey-gpt-submit:hover {
    background-color: var(--dgpt-theme-secondary);
}

/* Loading indicator */
.davey-gpt-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: davey-gpt-spin 1s ease-in-out infinite;
    margin-left: 8px;
}

@keyframes davey-gpt-spin {
    to { transform: rotate(360deg); }
}

/* Floating chat styles */
.davey-gpt-floating {
    position: fixed;
    z-index: 9999;
}

.davey-gpt-floating.bottom-right {
    right: 20px;
    bottom: 20px;
}

.davey-gpt-floating.bottom-left {
    left: 20px;
    bottom: 20px;
}

.davey-gpt-floating.top-right {
    right: 20px;
    top: 20px;
}

.davey-gpt-floating.top-left {
    left: 20px;
    top: 20px;
}

/* Floating button */
.davey-gpt-floating-button {
    width: auto;
    height: 48px;
    border-radius: 24px;
    background-color: #6600ff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    padding: 0 16px;
}

.davey-gpt-floating-button.dgpt-btn-size-small {
    height: 36px;
    min-width: 36px;
    font-size: 13px;
    border-radius: 18px;
    padding: 0 10px;
}

.davey-gpt-floating-button.dgpt-btn-size-medium {
    height: 48px;
    min-width: 48px;
    font-size: 15px;
    border-radius: 24px;
    padding: 0 16px;
}

.davey-gpt-floating-button.dgpt-btn-size-large {
    height: 64px;
    min-width: 64px;
    font-size: 18px;
    border-radius: 32px;
    padding: 0 24px;
}

/* Custom size handled inline */

/* Theme-specific floating button floating/glow effects */
.davey-gpt-floating[data-theme="cyberpunk"] .davey-gpt-floating-button {
    box-shadow: 0 0 16px 4px var(--dgpt-theme-secondary), 0 0 32px 8px var(--dgpt-theme-primary), 0 2px 16px 0 rgba(0,0,0,0.25);
    animation: dgpt-float-cyberpunk 2.5s ease-in-out infinite alternate;
}

@keyframes dgpt-float-cyberpunk {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-6px) scale(1.04); }
}

.davey-gpt-floating[data-theme="tavern"] .davey-gpt-floating-button {
    box-shadow: 0 0 12px 2px var(--dgpt-theme-secondary), 0 2px 16px 0 rgba(42,26,13,0.25);
    animation: dgpt-float-tavern 2.2s ease-in-out infinite alternate;
}

@keyframes dgpt-float-tavern {
    0% { transform: translateY(0) rotate(-2deg); }
    100% { transform: translateY(-4px) rotate(2deg); }
}

.davey-gpt-floating[data-theme="kangal"] .davey-gpt-floating-button {
    box-shadow: 0 0 10px 2px var(--dgpt-theme-secondary), 0 2px 12px 0 rgba(0,123,255,0.15);
    animation: dgpt-float-kangal 2.8s ease-in-out infinite alternate;
}

@keyframes dgpt-float-kangal {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-3px) scale(1.03); }
}

.davey-gpt-floating[data-theme="fathead"] .davey-gpt-floating-button {
    box-shadow: 0 0 10px 2px var(--dgpt-theme-primary), 0 2px 10px 0 rgba(45,192,255,0.18);
    animation: dgpt-float-fathead 2.1s ease-in-out infinite alternate;
}

@keyframes dgpt-float-fathead {
    0% { transform: translateY(0); }
    100% { transform: translateY(-2px); }
}

.davey-gpt-floating[data-theme="kindersync"] .davey-gpt-floating-button {
    box-shadow: 0 0 18px 4px var(--dgpt-theme-secondary), 0 0 32px 8px var(--dgpt-theme-primary), 0 2px 16px 0 rgba(106,13,173,0.15);
    animation: dgpt-float-kindersync 2.7s ease-in-out infinite alternate;
}

@keyframes dgpt-float-kindersync {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-8px) scale(1.06); }
}

.davey-gpt-floating-button .dashicons,
.davey-gpt-floating-button .davey-gpt-floating-avatar {
    margin-right: 8px;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.davey-gpt-button-label {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
}

/* Theme-specific floating button styling */
.davey-gpt-floating[data-theme="cyberpunk"] .davey-gpt-floating-button {
    background-color: var(--dgpt-theme-primary);
    box-shadow: var(--dgpt-primary-glow);
}

.davey-gpt-floating[data-theme="fathead"] .davey-gpt-floating-button {
    background-color: var(--dgpt-theme-primary);
    box-shadow: 0 2px 10px rgba(45, 192, 255, 0.4);
}

.davey-gpt-floating[data-theme="tavern"] .davey-gpt-floating-button {
    background-color: var(--dgpt-theme-primary);
    box-shadow: var(--dgpt-primary-glow);
}

.davey-gpt-floating[data-theme="kangal"] .davey-gpt-floating-button {
    background-color: var(--dgpt-theme-primary);
    box-shadow: var(--dgpt-primary-glow);
}

.davey-gpt-floating-button:hover {
    transform: scale(1.05);
}

.davey-gpt-floating-button .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

/* Floating avatar in button */
.davey-gpt-floating-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Floating container (hidden by default) */
.davey-gpt-floating-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    min-width: 280px;
    max-width: 600px;
    height: 450px;
    min-height: 300px;
    max-height: 80vh;
    border-radius: 10px;
    background-color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    resize: both;
}

/* Make the floating container visible when active */
.davey-gpt-floating.active .davey-gpt-floating-container {
    display: block;
    opacity: 1;
    transform: translateY(0);
    transition: all var(--dgpt-transition-speed) cubic-bezier(0.19, 1, 0.22, 1);
}

/* Resize handle styles */
.davey-gpt-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, 0.1) 50%);
    z-index: 10;
}

/* Chat window inside floating container should take full height */
.davey-gpt-floating-container .davey-gpt-chat-window {
    height: calc(100% - 60px); /* subtract header height to prevent overlap */
    border-radius: 0;
    box-shadow: none;
    border: none;
}

/* Position adjustments for other corners */
.davey-gpt-floating.bottom-left .davey-gpt-floating-container {
    right: auto;
    left: 0;
}

.davey-gpt-floating.top-right .davey-gpt-floating-container {
    bottom: auto;
    top: 80px;
    right: 0;
}

.davey-gpt-floating.top-left .davey-gpt-floating-container {
    bottom: auto;
    top: 80px;
    right: auto;
    left: 0;
}

/* Theme-specific floating container styling */
.davey-gpt-floating[data-theme="cyberpunk"] .davey-gpt-floating-container {
    background-color: var(--dgpt-dark-bg);
    border: 1px solid var(--dgpt-glass-border);
    box-shadow: var(--dgpt-secondary-glow);
}

.davey-gpt-floating[data-theme="fathead"] .davey-gpt-floating-container {
    background-color: white;
    border: 1px solid rgba(45, 192, 255, 0.3);
}

.davey-gpt-floating[data-theme="tavern"] .davey-gpt-floating-container {
    background-color: var(--dgpt-dark-bg);
    border: 2px solid var(--dgpt-glass-border);
    box-shadow: var(--dgpt-secondary-glow);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><rect width="50" height="50" x="0" y="0" fill="%233c2915" opacity="0.05"/></svg>');
    background-size: 50px 50px;
}

.davey-gpt-floating[data-theme="kangal"] .davey-gpt-floating-container {
    background-color: var(--dgpt-dark-bg);
    border: 1px solid var(--dgpt-glass-border);
}

/* Header for floating chat */
.davey-gpt-floating-header {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* More compact header */
.davey-gpt-header {
    padding: 8px 12px;
}

.davey-gpt-header-title {
    font-size: 15px;
}

/* Theme-specific floating header styling */
.davey-gpt-floating[data-theme="cyberpunk"] .davey-gpt-floating-header {
    border-bottom: 1px solid var(--dgpt-glass-border);
}

.davey-gpt-floating[data-theme="fathead"] .davey-gpt-floating-header {
    border-bottom: 1px solid rgba(45, 192, 255, 0.2);
}

.davey-gpt-floating[data-theme="tavern"] .davey-gpt-floating-header {
    border-bottom: 1px solid var(--dgpt-glass-border);
}

.davey-gpt-floating[data-theme="kangal"] .davey-gpt-floating-header {
    border-bottom: 1px solid var(--dgpt-glass-border);
}

.davey-gpt-floating-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* Theme-specific title styling */
.davey-gpt-floating[data-theme="cyberpunk"] .davey-gpt-floating-title {
    color: var(--dgpt-text-light);
}

.davey-gpt-floating[data-theme="tavern"] .davey-gpt-floating-title {
    color: var(--dgpt-text-light);
    font-family: 'Cinzel', serif;
}

.davey-gpt-floating[data-theme="kangal"] .davey-gpt-floating-title {
    color: var(--dgpt-text-light);
}

/* Close button */
.davey-gpt-floating-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px; /* Reduced text size */
}

/* Theme-specific close button styling */
.davey-gpt-floating[data-theme="cyberpunk"] .davey-gpt-floating-close {
    color: var(--dgpt-theme-secondary);
}

.davey-gpt-floating[data-theme="fathead"] .davey-gpt-floating-close {
    color: var(--dgpt-theme-primary);
}

.davey-gpt-floating[data-theme="tavern"] .davey-gpt-floating-close {
    color: var(--dgpt-theme-secondary);
}

.davey-gpt-floating[data-theme="kangal"] .davey-gpt-floating-close {
    color: var(--dgpt-theme-secondary);
}

.davey-gpt-floating-close:hover {
    color: #666;
}

/* Chat window inside floating container */
.davey-gpt-floating-container .davey-gpt-chat-window {
    height: calc(100% - 60px); /* subtract header height to prevent overlap */
    border-radius: 0;
    box-shadow: none;
    border: none;
}

/* Avatar on messages */
.davey-gpt-message-avatar {
    width: 28px; /* Smaller avatar */
    height: 28px; /* Smaller avatar */
    border-radius: 50%;
    margin-right: 10px;
    overflow: hidden;
    border: 1px solid var(--dgpt-glass-border);
}

.davey-gpt-message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.davey-gpt-message-with-avatar {
    display: flex;
    align-items: flex-start;
}

/* Continue button - new style */
.davey-gpt-continue-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    margin-top: 5px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background-color: rgba(var(--dgpt-theme-primary-rgb, 0, 234, 255), 0.15);
    color: var(--dgpt-theme-primary);
    border: 1px solid rgba(var(--dgpt-theme-primary-rgb, 0, 234, 255), 0.3);
    transition: all var(--dgpt-transition-speed) ease;
    text-align: center;
    max-width: fit-content;
    opacity: 0;
    transform: translateY(10px);
    animation: fade-slide-in 0.3s forwards 0.2s;
}

.davey-gpt-continue-btn:hover {
    background-color: rgba(var(--dgpt-theme-primary-rgb, 0, 234, 255), 0.25);
    box-shadow: 0 2px 8px rgba(var(--dgpt-theme-primary-rgb, 0, 234, 255), 0.2);
}

.davey-gpt-continue-btn:active {
    transform: translateY(1px);
}

.davey-gpt-continue-btn .dgpt-icon {
    margin-left: 6px;
    font-size: 14px;
}

/* Theme-specific continue button styling */
.davey-gpt-chat-window[data-theme="cyberpunk"] .davey-gpt-continue-btn {
    background-color: rgba(69, 229, 255, 0.15);
    border-color: rgba(69, 229, 255, 0.3);
    color: var(--dgpt-theme-secondary);
}

.davey-gpt-chat-window[data-theme="fathead"] .davey-gpt-continue-btn {
    background-color: rgba(45, 192, 255, 0.15);
    border-color: rgba(45, 192, 255, 0.3);
    color: var(--dgpt-theme-primary);
}

.davey-gpt-chat-window[data-theme="tavern"] .davey-gpt-continue-btn {
    background-color: rgba(208, 168, 92, 0.15);
    border-color: rgba(208, 168, 92, 0.3);
    color: var(--dgpt-theme-secondary);
}

.davey-gpt-chat-window[data-theme="kangal"] .davey-gpt-continue-btn {
    background-color: rgba(184, 115, 51, 0.15);
    border-color: rgba(184, 115, 51, 0.3);
    color: var(--dgpt-theme-secondary);
}

/* Continue button loading state */
.davey-gpt-continue-btn.loading {
    pointer-events: none;
    position: relative;
}

.davey-gpt-continue-btn.loading .dgpt-continue-text {
    visibility: hidden;
}

.davey-gpt-continue-btn.loading:after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: continue-loading-spin 0.8s linear infinite;
}

@keyframes continue-loading-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fade and slide-in animation for elements */
@keyframes fade-slide-in {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Improve loading animation */
.davey-gpt-loading-dots {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.davey-gpt-loading-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    opacity: 0.7;
    animation: dot-pulse 1.4s ease-in-out infinite;
}

.davey-gpt-loading-dot:nth-child(1) {
    animation-delay: 0s;
}

.davey-gpt-loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.davey-gpt-loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dot-pulse {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    30% {
        transform: scale(1.5);
        opacity: 1;
    }
}

/* Improved mobile responsiveness */
@media (max-width: 576px) {
    .davey-gpt-chat-window {
        height: 400px; /* Slightly smaller on mobile */
        border-radius: 12px;
    }
    
    .davey-gpt-message {
        max-width: 85%; /* Wider messages on mobile */
        padding: 8px 12px; /* Smaller padding */
        font-size: 13px; /* Smaller font */
    }
    
    .davey-gpt-message-content {
        font-size: 13px;
    }
    
    .davey-gpt-input {
        min-height: 36px;
        padding: 7px 12px;
    }
    
    .davey-gpt-floating-container {
        width: 300px;
        right: 10px;
        bottom: 10px;
    }
    
    .davey-gpt-message-avatar {
        width: 24px;
        height: 24px;
    }
}