@font-face {
    font-family: 'IRANSansXFaNumThin';
    src: url('/wp-content/plugins/wp-smart-dictionary/assets/fonts/IRANSansXFaNum-ThinD4.woff') format('woff'),
         url('/wp-content/plugins/wp-smart-dictionary/assets/fonts/IRANSansXFaNum-ThinD4.ttf') format('truetype');
    font-weight: 300;
    font-display: swap;
}

.uct-chat-wrapper,
.uct-chat-wrapper * {
    font-family: 'IRANSansXFaNumThin', Tahoma, sans-serif;
    box-sizing: border-box;
}

/* Floating button */
#uct-floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #333333;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    cursor: pointer;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    transform: scale(1);
}
#uct-floating-btn:hover {
    transform: scale(1.1);
    background: #555555;
}
#uct-floating-btn svg {
    width: 30px;
    height: 30px;
    fill: #FFCA28;
    transition: all 0.3s ease;
}

/* Shrink on mobile only */
#uct-floating-btn.uct-shrink-mobile {
    right: 0;
    bottom: 20px;
    width: 40px;
    height: 60px;
    border-radius: 5px 0 0 5px;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: -2px 2px 8px rgba(0,0,0,0.2);
    transform: none;
    background: #333333;
}
#uct-floating-btn.uct-shrink-mobile:hover {
    background: #555555;
    transform: none;
}
#uct-floating-btn.uct-shrink-mobile svg {
    width: 24px;
    height: 24px;
}

/* Chat container */
.uct-chat-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    left: auto;
    width: 360px;
    max-height: 500px;
    height: 500px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    direction: rtl;
}

.uct-chat-header {
    background: #1E1E1E;
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #FFCA28;
}
.uct-chat-header h3 {
    margin: 0;
    font-size: 16px;
    color: #FFCA28;
}
.uct-close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}
.uct-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f5f5f5;
}
.uct-message {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 12px;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.6;
}
.uct-message.sent {
    align-self: flex-end;
    background: #E0E0E0;
    color: #1E1E1E;
    border-bottom-right-radius: 4px;
}
.uct-message.received {
    align-self: flex-start;
    background: #FFF8E1;
    color: #1E1E1E;
    border-bottom-left-radius: 4px;
}

/* Input */
.uct-input-area {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ccc;
    background: #fff;
}
.uct-input-area input {
    flex: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 14px;
    outline: none;
}
.uct-send-btn {
    background: #333333;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    margin-right: 8px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.uct-send-btn:hover {
    background: #555555;
}

/* System messages */
.uct-system-message {
    text-align: center;
    font-size: 13px;
    color: #555;
    margin: 8px 0;
}
.uct-removable-notice {
    /* for DOM removal */
}

/* Spinner */
.uct-waiting {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 8px 0;
    font-size: 13px;
    color: #888;
}
.uct-waiting .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top: 2px solid #FFCA28;
    border-radius: 50%;
    animation: uct-spin 1s linear infinite;
}
@keyframes uct-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Offline buttons */
.uct-offline-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 8px 0;
}
.uct-offline-btn {
    padding: 8px 16px;
    border-radius: 20px;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    background: #333;
}
.uct-wait-btn {
    background: #777;
    margin-top: 4px;
}

.hidden {
    display: none !important;
}