/* Chalak Mitra AI - Premium Theme Redesign */
:root {
    --cm-primary: #3b82f6;
    --cm-primary-glow: rgba(59, 130, 246, 0.5);
    --cm-bg: #090f5c;
    /* User defined background #090f5c */
    --cm-glass: rgba(255, 255, 255, 0.05);
    --cm-border: rgba(255, 255, 255, 0.2);
    /* Increased border visibility */
    --cm-user-bubble: #3A9AFF;
    /* User defined light blue / hover color */
    --cm-bot-bubble: rgba(255, 255, 255, 0.1);
    --cm-text: #ffffff;
    /* User defined white font */
    --cm-text-soft: rgba(255, 255, 255, 0.7);
    --cm-accent: #FFC50F;
    /* User defined selected/accent color */
}


.chalak-mitra-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 84px);
    background: var(--cm-bg);
    color: var(--cm-text);
    font-family: 'Outfit', 'Poppins', sans-serif;
    position: relative;
    overflow: hidden;
    max-width: 1400px;
    margin: 0 auto;
    border-left: 1px solid var(--cm-border);
    border-right: 1px solid var(--cm-border);
}

.chalak-mitra-container::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08), transparent 70%);
    z-index: 0;
    pointer-events: none;
}

/* Header */
.cm-header {
    padding: 16px 24px;
    background: var(--cm-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--cm-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.cm-logo-container {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--cm-border);
}

.cm-logo-img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
}

.cm-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 0;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cm-subtitle {
    font-size: 11px;
    color: var(--cm-text-soft);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Tabs */
.cm-tabs {
    padding: 12px 24px;
    background: rgba(15, 23, 42, 0.4);
    display: flex;
    gap: 10px;
    overflow-x: auto;
    border-bottom: 1px solid var(--cm-border);
    scrollbar-width: none;
}

.cm-tabs::-webkit-scrollbar {
    display: none;
}

.cm-tab {
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid var(--cm-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--cm-text-soft);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cm-tab:hover,
.cm-tab.active {
    background: var(--cm-accent);
    /* User defined #FFC50F */
    color: #000;
    border-color: #D97706;
    /* Darker yellow border */
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 197, 15, 0.3);
}

/* Chat Area */
.cm-chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: radial-gradient(circle at bottom, rgba(15, 23, 42, 1) 0%, rgba(15, 23, 42, 0.95) 100%);
    scrollbar-width: thin;
    scrollbar-color: var(--cm-border) transparent;
}

.cm-chat-area::-webkit-scrollbar {
    width: 5px;
}

.cm-chat-area::-webkit-scrollbar-thumb {
    background: var(--cm-border);
    border-radius: 10px;
}

/* Message Bubbles */
.cm-message {
    max-width: 80%;
    display: flex;
    gap: 12px;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cm-message-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.cm-message-bot {
    align-self: flex-start;
}

.cm-message-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--cm-glass);
    border: 1px solid var(--cm-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cm-message-content {
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 14.5px;
    line-height: 1.6;
    position: relative;
}

.cm-message-user .cm-message-content {
    background: var(--cm-user-bubble);
    /* #3A9AFF */
    color: white;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cm-message-bot .cm-message-content {
    background: var(--cm-bot-bubble);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--cm-text);
    border: 1px solid var(--cm-border);
    border-top-left-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cm-message-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.cm-message-time {
    font-size: 10px;
    color: var(--cm-text-soft);
    opacity: 0.7;
}

.cm-speak-msg-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--cm-border);
    color: var(--cm-primary);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.cm-speak-msg-btn:hover {
    background: var(--cm-primary);
    color: white;
}

/* Input Area */
.cm-input-area {
    padding: 20px 30px 30px;
    background: var(--cm-bg);
    border-top: 1px solid var(--cm-border);
    position: relative;
}

.cm-input-container {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--cm-glass);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 8px 10px;
    border: 1px solid var(--cm-border);
    max-width: 800px;
    margin: 0 auto;
    transition: border-color 0.3s;
}

.cm-input-container:focus-within {
    border-color: var(--cm-primary);
    box-shadow: 0 0 20px var(--cm-primary-glow);
}

.cm-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 15px;
    outline: none;
    padding: 10px 5px;
}

.cm-mic-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 87, 34, 0.1);
    color: #ff5722;
    border: 1px solid rgba(255, 87, 34, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.cm-mic-btn:hover {
    background: rgba(255, 87, 34, 0.2);
    transform: scale(1.1);
}

.cm-mic-active {
    background: #ff5722 !important;
    color: white !important;
    box-shadow: 0 0 25px rgba(255, 87, 34, 0.5);
    animation: micPulse 2s infinite;
}

@keyframes micPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 87, 34, 0.6);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(255, 87, 34, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 87, 34, 0);
    }
}

.cm-tab.active {
    background: var(--cm-accent) !important;
    /* #FFC50F */
    color: #000000 !important;
    border-color: var(--cm-accent) !important;
    box-shadow: 0 4px 12px rgba(255, 197, 15, 0.4) !important;
}

.cm-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 20px;
    background: var(--cm-accent);
    /* #FFC50F */
    color: #000;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.cm-send-btn:hover {
    background: #eab308;
    transform: translateY(-2px);
}

.cm-input-hint {
    text-align: center;
    font-size: 11px;
    color: var(--cm-text-soft);
    margin-top: 12px;
}

/* Visual Blocks */
.cm-warning-box {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid #ef4444;
    padding: 12px 16px;
    border-radius: 8px;
    color: #fca5a5;
    font-weight: 700;
    margin-bottom: 15px;
    animation: shake 0.5s;
}

.cm-section-header {
    color: #3b82f6;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    margin: 15px 0 8px;
    display: block;
}

.cm-fault-step {
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--cm-border);
    margin-bottom: 8px;
    transition: all 0.2s;
}

.cm-fault-step:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--cm-primary);
    transform: translateX(5px);
}

.cm-bullet-item {
    position: relative;
    padding-left: 20px;
    margin-bottom: 6px;
    list-style: none;
}

.cm-bullet-item::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--cm-primary);
    font-weight: bold;
}

/* Voice Overlay Redesign */
.cm-voice-indicator {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.3s;
}

.cm-voice-waves {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 60px;
    margin-bottom: 30px;
}

.cm-wave {
    width: 4px;
    background: var(--cm-primary);
    border-radius: 4px;
    animation: waveAnimation 1.2s ease-in-out infinite;
}

@keyframes waveAnimation {

    0%,
    100% {
        height: 10px;
    }

    50% {
        height: 50px;
    }
}

/* Mobile Tweaks */
@media (max-width: 768px) {
    .chalak-mitra-container {
        height: 100vh;
        border: none;
    }

    .cm-message {
        max-width: 90%;
    }

    .cm-input-area {
        padding: 15px;
    }

    .cm-title {
        font-size: 16px;
    }
}