#dgc-widget-root {
    --dgc-gold: #f2b824;
    --dgc-gold-bright: #fff275;
    --dgc-gold-dark: #c69214;
    --dgc-bg-dark: #09090b;
    --dgc-bg-card: #141416;
    --dgc-bg-card-hover: #1c1c1f;
    --dgc-text-light: #f8fafc;
    --dgc-text-muted: #9ca3af;
    --dgc-border-gold: rgba(242, 184, 36, 0.18);
    --dgc-border-gold-focus: rgba(242, 184, 36, 0.5);
    --dgc-glow-gold: rgba(242, 184, 36, 0.25);
    
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999999;
}

/* Floating Bubble Button */
#dgc-bubble-btn {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 2px solid var(--dgc-gold);
    cursor: pointer;
    background: linear-gradient(135deg, #18181b 0%, #09090b 100%);
    color: var(--dgc-gold);
    font-size: 26px;
    box-shadow: 0 8px 32px var(--dgc-glow-gold), inset 0 0 12px rgba(242, 184, 36, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.25s, visibility 0.25s;
    opacity: 1;
    transform: scale(1);
    visibility: visible;
    pointer-events: auto;
    position: relative;
}

#dgc-bubble-btn::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid var(--dgc-gold);
    border-radius: 50%;
    opacity: 0.4;
    animation: dgc-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

#dgc-bubble-btn:hover {
    transform: scale(1.08);
    color: var(--dgc-gold-bright);
    box-shadow: 0 10px 36px rgba(242, 184, 36, 0.4), inset 0 0 16px rgba(242, 184, 36, 0.2);
}

#dgc-bubble-btn.dgc-hidden {
    display: flex !important;
    opacity: 0;
    transform: scale(0.7);
    visibility: hidden;
    pointer-events: none;
}

/* Chat Panel Container */
#dgc-panel {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 590px;
    max-height: calc(100vh - 48px);
    background: rgba(9, 9, 11, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--dgc-border-gold);
    border-radius: 20px;
    display: flex !important; /* Always display flex, visible state handled via classes */
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), 0 0 32px rgba(242, 184, 36, 0.08);
    transform-origin: bottom right;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
    opacity: 1;
    transform: scale(1) translateY(0);
    visibility: visible;
    pointer-events: auto;
}

#dgc-panel.dgc-hidden {
    opacity: 0;
    transform: scale(0.88) translateY(32px);
    visibility: hidden;
    pointer-events: none;
}

/* Panel Header */
.dgc-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(20, 20, 22, 0.95);
    border-bottom: 1px solid var(--dgc-border-gold);
}

.dgc-panel-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--dgc-text-light);
}

.dgc-avatar-wrapper {
    position: relative;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--dgc-gold) 0%, var(--dgc-gold-dark) 100%);
    border: 1.5px solid var(--dgc-gold);
    box-shadow: 0 0 10px rgba(242, 184, 36, 0.25);
    flex-shrink: 0;
}

.dgc-avatar-icon {
    color: #09090b;
    font-size: 1.15rem;
}

.dgc-online-indicator {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    background: #10b981;
    border: 2px solid #141416;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
    animation: dgc-pulse-green 2s infinite;
}

.dgc-panel-title strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--dgc-text-light);
    letter-spacing: 0.3px;
}

.dgc-panel-title span {
    display: block;
    font-size: 0.72rem;
    color: var(--dgc-text-muted);
}

.dgc-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

#dgc-clear-btn, #dgc-close-btn {
    background: none;
    border: none;
    color: var(--dgc-text-muted);
    cursor: pointer;
    font-size: 1.05rem;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#dgc-clear-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

#dgc-close-btn:hover {
    color: var(--dgc-gold-bright);
    background: rgba(242, 184, 36, 0.1);
}

/* Chat Wrapper area */
.dgc-chat-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: rgba(9, 9, 11, 0.3);
}

/* Custom Scrollbar */
.dgc-chat-wrapper::-webkit-scrollbar {
    width: 5px;
}
.dgc-chat-wrapper::-webkit-scrollbar-track {
    background: transparent;
}
.dgc-chat-wrapper::-webkit-scrollbar-thumb {
    background: rgba(242, 184, 36, 0.15);
    border-radius: 10px;
}
.dgc-chat-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(242, 184, 36, 0.4);
}

/* Welcome Area */
.dgc-welcome {
    animation: dgc-fadeIn 0.4s ease-out;
}

.dgc-welcome p {
    color: var(--dgc-text-light);
    font-size: 0.88rem;
    line-height: 1.55;
    margin-bottom: 16px;
}

.dgc-suggestions {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.dgc-suggestion {
    text-align: left;
    background: rgba(20, 20, 22, 0.7);
    border: 1px solid var(--dgc-border-gold);
    color: var(--dgc-text-light);
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dgc-suggestion:hover {
    border-color: var(--dgc-gold);
    background: rgba(242, 184, 36, 0.08);
    color: var(--dgc-gold-bright);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(242, 184, 36, 0.08);
}

/* Chat Rows & Bubbles */
.dgc-row {
    display: flex;
    width: 100%;
}

.dgc-row.dgc-user {
    justify-content: flex-end;
}

.dgc-row.dgc-bot {
    justify-content: flex-start;
}

.dgc-bubble {
    max-width: 82%;
    padding: 11px 15px;
    font-size: 0.86rem;
    line-height: 1.55;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.dgc-row.dgc-user .dgc-bubble {
    background: linear-gradient(135deg, var(--dgc-gold) 0%, var(--dgc-gold-dark) 100%);
    color: #09090b;
    border-radius: 16px 16px 4px 16px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(242, 184, 36, 0.15);
}

.dgc-row.dgc-bot .dgc-bubble {
    background: var(--dgc-bg-card);
    border: 1px solid var(--dgc-border-gold);
    border-left: 3.5px solid var(--dgc-gold);
    color: var(--dgc-text-light);
    border-radius: 16px 16px 16px 4px;
}

.dgc-bubble p {
    margin: 0 0 10px 0;
}

.dgc-bubble p:last-child {
    margin-bottom: 0;
}

.dgc-bubble pre {
    background: #060608;
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 12px;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 0.78rem;
    margin: 8px 0;
}

.dgc-bubble ul, .dgc-bubble ol {
    margin: 8px 0 8px 18px;
    padding-left: 0;
}

.dgc-bubble li {
    margin-bottom: 4px;
}

.dgc-bubble a {
    color: var(--dgc-gold-bright);
    text-decoration: underline;
    font-weight: 500;
}

.dgc-bubble a:hover {
    color: var(--dgc-gold);
}

/* Typing Indicator */
.dgc-typing {
    display: flex;
    gap: 4px;
    padding: 11px 15px;
    align-items: center;
}

.dgc-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--dgc-gold);
    animation: dgc-bounce 1.2s infinite ease-in-out;
}

.dgc-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.dgc-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

/* Input Section */
.dgc-input-section {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--dgc-border-gold);
    background: rgba(20, 20, 22, 0.98);
}

#dgc-message-input {
    flex: 1;
    resize: none;
    max-height: 100px;
    background: #09090b;
    border: 1px solid var(--dgc-border-gold);
    border-radius: 12px;
    color: var(--dgc-text-light);
    padding: 12px 14px;
    font-family: inherit;
    font-size: 0.85rem;
    line-height: 1.4;
    outline: none;
    transition: all 0.25s ease;
}

#dgc-message-input::placeholder {
    color: #6b7280;
}

#dgc-message-input:focus {
    border-color: var(--dgc-border-gold-focus);
    box-shadow: 0 0 10px rgba(242, 184, 36, 0.1);
}

#dgc-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--dgc-gold) 0%, var(--dgc-gold-dark) 100%);
    color: #09090b;
    font-size: 0.95rem;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    box-shadow: 0 3px 10px rgba(242, 184, 36, 0.15);
}

#dgc-send-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(242, 184, 36, 0.3);
    background: linear-gradient(135deg, var(--dgc-gold-bright) 0%, var(--dgc-gold) 100%);
}

#dgc-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #27272a;
    color: var(--dgc-text-muted);
    box-shadow: none;
}

#dgc-mic-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--dgc-border-gold);
    background: #09090b;
    color: var(--dgc-text-muted);
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

#dgc-mic-btn:hover {
    color: var(--dgc-gold-bright);
    border-color: var(--dgc-gold);
    background: rgba(242, 184, 36, 0.05);
}

#dgc-mic-btn.dgc-recording {
    background: var(--dgc-gold);
    color: #09090b;
    border-color: var(--dgc-gold);
    animation: dgc-mic-pulse 1.4s infinite ease-in-out;
}

/* Animations */
@keyframes dgc-ping {
    0% { transform: scale(1); opacity: 0.5; }
    70%, 100% { transform: scale(1.25); opacity: 0; }
}

@keyframes dgc-pulse-green {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    50% { transform: scale(1.1); box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
}

@keyframes dgc-mic-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(242, 184, 36, 0.6); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(242, 184, 36, 0); }
}

@keyframes dgc-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-5px); opacity: 1; }
}

@keyframes dgc-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsiveness */
@media (max-width: 480px) {
    #dgc-panel {
        right: 16px;
        left: 16px;
        width: auto;
        bottom: 16px;
        height: calc(85vh - 20px);
        max-height: none;
    }
    #dgc-widget-root {
        right: 16px;
        bottom: 16px;
    }
}
