/**
 * Islamic Dawah Chatbot - Default CSS Theme
 * This file contains all default styling for the chatbot
 */

/* ========================================
   CHAT WIDGET CONTAINER
   ======================================== */
#idc-chat-widget, #idc-chat-widget-fallback {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#idc-chat-widget.idc-position-bottom-right,
#idc-chat-widget-fallback.idc-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

/* ========================================
   TOGGLE BUTTON
   ======================================== */
.idc-chat-toggle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #2D5948 0%, #3A6B55 100%);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(45, 89, 72, 0.4);
    transition: all 0.3s ease;
}

.idc-chat-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(45, 89, 72, 0.5);
}

.idc-toggle-icon {
    color: #ffffff;
}

.idc-toggle-icon svg {
    fill: #ffffff;
}

/* ========================================
   CHAT WINDOW
   ======================================== */
.idc-chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 999998;
}

/* ========================================
   CHAT HEADER
   ======================================== */
.idc-chat-header {
    background: linear-gradient(135deg, #2D5948 0%, #3A6B55 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.idc-header-info {
    display: flex;
    align-items: center;
}

.idc-bot-avatar {
    width: 35px;
    height: 35px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.idc-bot-name {
    font-weight: bold;
    font-size: 16px;
}

.idc-bot-status {
    font-size: 12px;
    opacity: 0.8;
}

.idc-header-actions {
    display: flex;
    gap: 5px;
}

.idc-header-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
}

.idc-header-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* ========================================
   CHAT MESSAGES
   ======================================== */
.idc-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: linear-gradient(to bottom, #FDF9F3 0%, #ffffff 100%);
}

.idc-message {
    margin-bottom: 15px;
}

.idc-message-content {
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 85%;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
}

.idc-bot-message .idc-message-content {
    background: #ffffff;
    border-bottom-left-radius: 5px;
    margin-left: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #f0f0f0;
}

.idc-user-message .idc-message-content {
    background: #2D5948;
    color: white;
    border-bottom-right-radius: 5px;
    margin-left: auto;
}

.idc-system-message .idc-message-content {
    background: #fee;
    color: #c33;
    text-align: center;
    font-size: 14px;
}

.idc-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    text-align: right;
}

.idc-bot-message .idc-message-time {
    text-align: left;
}

/* ========================================
   TYPING INDICATOR
   ======================================== */
.idc-typing-indicator {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    min-height: 40px;
}

.idc-typing-dots {
    display: flex;
    gap: 3px;
}

.idc-typing-dots span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.idc-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.idc-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

.idc-typing-text {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* ========================================
   CHAT INPUT
   ======================================== */
.idc-chat-input {
    /* Layout */
    padding: 15px;
    
    /* Appearance */
    border-top: 1px solid #eee;
    background: white;
}

.idc-input-wrapper {
    /* Layout */
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    
    /* Appearance */
    background: #f8f9fa;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 12px 18px;
    
    /* Behavior */
    transition: all 0.2s ease;
}

.idc-input-wrapper:focus-within {
    border-color: #ffffff;
    background: #f0f2f5;
}

#idc-message-input {
    /* Layout */
    flex: 1;
    align-self: center;
    
    /* Dimensions */
    min-height: 20px;
    max-height: 120px;
    padding: 8px 12px;
    margin: 0;
    
    /* Appearance */
    border: 1px solid #d3d3d3;
    border-radius: 12px;
    background: none;
    
    /* Typography */
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    
    /* Behavior */
    resize: none;
    outline: none;
    box-sizing: border-box;
}

#idc-message-input::placeholder {
    color: #999;
    font-style: italic;
}

/* ========================================
   SEND BUTTON
   ======================================== */
.idc-send-btn {
    background: #2D5948;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(45, 89, 72, 0.3);
}

.idc-send-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.idc-send-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.idc-send-btn:hover:not(:disabled) {
    background: #3A6B55;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(45, 89, 72, 0.4);
}

.idc-send-btn:active:not(:disabled) {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* ========================================
   NOTIFICATION BADGE
   ======================================== */
.idc-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 480px) {
    .idc-chat-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
}
