:root {
    --emc-primary: #009DFF;
    --emc-secondary: #0076c0;
    --emc-bg: rgba(255, 255, 255, 0.95);
    --emc-text: #111827;
    --emc-text-muted: #4b5563;
    --emc-radius: 24px;
    --emc-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.emc-wrapper {
    position: fixed;
    bottom: 30px;
    right: 80px; /* Moved slightly to the left to avoid overlapping back-to-top which is usually at right: 20-30px */
    z-index: 999999;
    font-family: 'Outfit', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Menu */
.emc-menu {
    width: 340px; /* Wider design as requested */
    background: var(--emc-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--emc-radius);
    box-shadow: var(--emc-shadow);
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin-bottom: 15px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.emc-menu.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.emc-menu-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(0, 157, 255, 0.05), rgba(0, 157, 255, 0.02));
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 15px;
}

.emc-header-text {
    display: flex;
    flex-direction: column;
}

.emc-header-text h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: var(--emc-text);
}

.emc-header-text p {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--emc-text-muted);
}

/* Bot View */
.emc-bot-body {
    display: flex;
    flex-direction: column;
    height: 380px;
}

.emc-chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8fafc;
}

.emc-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.4;
}

.emc-msg.bot {
    align-self: flex-start;
    background: #fff;
    color: var(--emc-text);
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.emc-msg.user {
    align-self: flex-end;
    background: var(--emc-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.emc-msg.typing {
    font-style: italic;
    opacity: 0.7;
}

.emc-bot-suggestions {
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-top: 1px solid #f1f5f9;
}

.emc-suggest-btn {
    background: #fff;
    border: 1px solid var(--emc-primary);
    color: var(--emc-primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.emc-suggest-btn:hover {
    background: var(--emc-primary);
    color: #fff;
}

.emc-bot-input-area {
    padding: 12px;
    display: flex;
    gap: 8px;
    border-top: 1px solid #f1f5f9;
    background: #fff;
}

.emc-bot-input-area input {
    flex: 1;
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    outline: none;
}

.emc-bot-input-area button {
    background: var(--emc-primary);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emc-items {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.emc-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #fff;
    border-radius: 18px;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f3f4f6;
    position: relative;
    overflow: hidden;
}

.emc-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0;
    background: var(--accent-color);
    transition: width 0.3s ease;
    opacity: 0.1;
}

.emc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

.emc-card:hover::before {
    width: 100%;
}

.emc-card-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 1;
}

.emc-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--emc-text);
}

.emc-desc {
    font-size: 12px;
    color: var(--emc-text-muted);
    line-height: 1.4;
}

.emc-card-arrow {
    color: var(--accent-color);
    opacity: 0.6;
    transition: transform 0.3s ease;
}

.emc-card:hover .emc-card-arrow {
    transform: translateX(4px);
    opacity: 1;
}

.emc-card.is-closed {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f9fafb;
}

.emc-badge {
    font-size: 10px;
    background: #fee2e2;
    color: #ef4444;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 8px;
    font-weight: 700;
}

/* Inline Form */
.emc-form-body {
    padding: 24px;
}

.emc-form-group {
    margin-bottom: 16px;
}

.emc-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.emc-form-group input,
.emc-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.emc-form-group input:focus,
.emc-form-group textarea:focus {
    outline: none;
    border-color: var(--emc-primary);
    ring: 3px rgba(0, 157, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(0, 157, 255, 0.1);
}

.emc-form-submit {
    width: 100%;
    padding: 14px;
    background: var(--emc-primary);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(0, 157, 255, 0.3);
    transition: all 0.3s ease;
}

.emc-form-submit:hover {
    background: var(--emc-secondary);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 157, 255, 0.4);
}

/* Main Button */
.emc-main-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 28px 10px 10px;
    background: linear-gradient(135deg, var(--btn-bg), rgba(0,0,0,0.1));
    background-color: var(--btn-bg);
    border: none;
    border-radius: 50px;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255,255,255,0.2);
    min-width: 240px;
}

.emc-main-btn:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.3);
}

.emc-btn-icon {
    width: 44px;
    height: 44px;
    background: #fff;
    color: var(--btn-bg); /* Use dynamic color for the icon too */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.emc-btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.emc-btn-title {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.emc-btn-sub {
    font-size: 10px;
    opacity: 0.9;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.5); }
    70% { box-shadow: 0 0 0 10px rgba(255,255,255,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

.emc-btn-icon {
    animation: pulse-border 2s infinite;
}

@media (max-width: 600px) {
    .emc-wrapper {
        bottom: 20px;
        right: 20px;
    }
    .emc-menu {
        width: calc(100vw - 40px);
        max-width: 320px;
    }
    .emc-main-btn {
        min-width: 200px;
        padding: 8px 20px 8px 8px;
    }
}
