/**
 * IBC Chatbot - Styles
 * Version 2.5
 */

/* Toggle Button */
#ibc-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--ibc-primary, #1a365d);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 99998;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#ibc-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0,0,0,0.4);
}

#ibc-toggle-btn img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Chat Box */
#ibc-chat-box {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 550px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#ibc-chat-box.active {
    display: flex;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
#ibc-header {
    background: var(--ibc-primary, #1a365d);
    color: #fff;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ibc-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ibc-header-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ibc-header-logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.ibc-header-text h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.ibc-header-text span {
    font-size: 12px;
    opacity: 0.8;
}

#ibc-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0.8;
}

#ibc-close-btn:hover {
    opacity: 1;
}

/* Messages */
#ibc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f5f7fa;
}

.ibc-message {
    margin-bottom: 12px;
    display: flex;
}

.ibc-message.ibc-bot {
    justify-content: flex-start;
}

.ibc-message.ibc-user {
    justify-content: flex-end;
}

.ibc-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.ibc-bot .ibc-bubble {
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.ibc-user .ibc-bubble {
    background: var(--ibc-primary, #1a365d);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ibc-bubble a {
    color: var(--ibc-primary, #1a365d);
    text-decoration: underline;
}

.ibc-bot .ibc-bubble a {
    color: #2563eb;
}

.ibc-user .ibc-bubble a {
    color: #93c5fd;
}

/* Input Area */
#ibc-input-area {
    padding: 12px 15px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
}

#ibc-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#ibc-input:focus {
    border-color: var(--ibc-primary, #1a365d);
}

#ibc-input:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
}

#ibc-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--ibc-primary, #1a365d);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

#ibc-send-btn:hover {
    transform: scale(1.05);
}

#ibc-send-btn svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

/* Footer */
#ibc-footer {
    padding: 8px;
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
    background: #f9fafb;
}

#ibc-footer a {
    color: var(--ibc-primary, #1a365d);
    text-decoration: none;
}

/* Options Buttons */
.ibc-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.ibc-option-btn {
    padding: 10px 20px;
    background: var(--ibc-primary, #1a365d);
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.ibc-option-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Dropdown List */
.ibc-dropdown {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 8px;
}

.ibc-dropdown-search {
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    outline: none;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.ibc-dropdown-list {
    max-height: 220px;
    overflow-y: auto;
}

.ibc-dropdown-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    transition: background 0.2s;
}

.ibc-dropdown-item:last-child {
    border-bottom: none;
}

.ibc-dropdown-item:hover {
    background: var(--ibc-primary, #1a365d);
    color: #fff;
}

/* Roadmap Steps */
.ibc-roadmap-step {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    margin-top: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.ibc-step-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--ibc-primary, #1a365d);
}

.ibc-step-content {
    font-size: 13px;
    line-height: 1.6;
    color: #4b5563;
}

.ibc-step-content a {
    color: #2563eb;
    text-decoration: underline;
}

.ibc-step-content strong {
    color: #1f2937;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #ibc-chat-box {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    #ibc-toggle-btn {
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
    }
}

/* RTL Support for Farsi */
[dir="rtl"] .ibc-bubble,
.ibc-rtl .ibc-bubble {
    text-align: right;
}

[dir="rtl"] .ibc-dropdown-item,
.ibc-rtl .ibc-dropdown-item {
    text-align: right;
}

/* Scrollbar */
#ibc-messages::-webkit-scrollbar,
.ibc-dropdown-list::-webkit-scrollbar {
    width: 6px;
}

#ibc-messages::-webkit-scrollbar-track,
.ibc-dropdown-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#ibc-messages::-webkit-scrollbar-thumb,
.ibc-dropdown-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#ibc-messages::-webkit-scrollbar-thumb:hover,
.ibc-dropdown-list::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}
