/* Floating Widget Styles */
.idhd-widget-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.idhd-widget-launcher {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.idhd-widget-launcher:hover {
    transform: scale(1.1);
}

.idhd-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    animation: idhd-fade-in 0.3s ease-out;
}

@keyframes idhd-fade-in {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.idhd-chat-header {
    padding: 15px 20px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.idhd-chat-header button {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s;
}

.idhd-chat-header button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.idhd-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.idhd-chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.idhd-msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
}

.ai-msg {
    align-self: flex-start;
    background: #eef2ff;
    color: #1e1b4b;
    border-bottom-left-radius: 2px;
}

.user-msg {
    align-self: flex-end;
    background: var(--idhd-theme-color, #4f46e5);
    color: #fff;
    border-bottom-right-radius: 2px;
}

.idhd-chat-footer {
    padding: 15px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
}

.idhd-chat-footer input {
    flex: 1;
    border: 1px solid #e2e8f0;
    padding: 10px 14px;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}

.idhd-chat-footer input:focus {
    border-color: var(--idhd-theme-color, #4f46e5);
}

.idhd-chat-footer button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

/* AI Typing Indicator */
.idhd-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: #eef2ff;
    width: fit-content;
    border-radius: 14px;
}

.idhd-typing span {
    width: 6px;
    height: 6px;
    background: var(--idhd-theme-color, #4f46e5);
    border-radius: 50%;
    animation: idhd-bounce 1s infinite alternate;
}

.idhd-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.idhd-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes idhd-bounce {
    from {
        opacity: 0.3;
        transform: translateY(0);
    }

    to {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/* Modal Ticket Styles */
.idhd-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000000;
}

.idhd-modal-content {
    background: #fff;
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    overflow: hidden;
    animation: idhd-modal-slide 0.3s ease-out;
}

@keyframes idhd-modal-slide {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.idhd-modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.idhd-modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.idhd-close-modal {
    cursor: pointer;
    font-size: 24px;
    color: #999;
}

.idhd-modal-body {
    padding: 20px;
}

.idhd-handoff-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    background: #fff;
    border: 1px dashed var(--idhd-theme-color, #4f46e5);
    color: var(--idhd-theme-color, #4f46e5);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
}

.idhd-handoff-btn:hover {
    background: #f5f3ff;
}

/* Mobile Responsiveness */
@media screen and (max-width: 480px) {
    .idhd-widget-container {
        bottom: 20px;
        right: 20px;
    }

    .idhd-chat-window {
        width: calc(100vw - 40px);
        height: min(500px, 80vh);
        bottom: 70px;
    }

    .idhd-modal-content {
        width: 95%;
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .idhd-msg {
        max-width: 90%;
    }
}

/* Modal Form Elements */
.idhd-form-group {
    margin-bottom: 20px;
    text-align: left;
}

.idhd-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #334155;
    text-align: left;
}

.idhd-input,
.idhd-select,
.idhd-textarea {
    width: 100% !important;
    padding: 12px 14px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    background: #fff !important;
    box-sizing: border-box !important;
    outline: none !important;
    display: block !important;
    transition: border-color 0.2s;
}

.idhd-input:focus,
.idhd-select:focus,
.idhd-textarea:focus {
    border-color: var(--idhd-theme-color, #4f46e5) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.idhd-submit-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    margin-top: 10px;
}

.idhd-submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.idhd-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.idhd-modal-captcha {
    margin-bottom: 20px;
}