/* Dani AI Styles - Gemini Modernized (Blue Theme) */
#quiz-app #dani-ai-toggle {
    padding: 0 18px;
    height: 44px;
    border-radius: 22px;
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 50%, #42a5f5 100%);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 130px;
    position: relative;
    overflow: hidden;
}

#quiz-app #dani-ai-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(21, 101, 192, 0.4);
}

#quiz-app #dani-ai-toggle:active {
    transform: scale(0.98);
}

#quiz-app #dani-ai-toggle .sparkle {
    width: 20px;
    height: 20px;
    fill: white;
}

#quiz-app #dani-ai-sidebar {
    position: fixed;
    top: 20px;
    right: -460px;
    width: 440px;
    height: calc(100% - 40px);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    z-index: 10001;
    transition: right 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    direction: ltr;
    border-radius: 24px 0 0 24px;
    border: 1px solid rgba(21, 101, 192, 0.1);
    overflow: hidden;
}

@media (max-width: 500px) {
    #quiz-app #dani-ai-sidebar {
        width: 100%;
        right: -100%;
        top: 0;
        height: 100%;
        border-radius: 0;
    }
}

#quiz-app #dani-ai-sidebar.open {
    right: 0;
}

#quiz-app .dai-header {
    padding: 24px 20px;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(21, 101, 192, 0.1);
}

#quiz-app .dai-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

#quiz-app .dai-header-title svg {
    width: 24px;
    height: 24px;
}

#quiz-app .dai-header h3 {
    margin: 0;
    font-size: 18px;
    background: linear-gradient(90deg, #1565c0, #1e88e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

#quiz-app .dai-close {
    background: #e3f2fd;
    border: none;
    color: #1565c0;
    font-size: 20px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#quiz-app .dai-close:hover {
    background: #bbdefb !important;
    color: #0d47a1 !important;
}

#quiz-app #dai-chat-feed {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

#quiz-app .dai-msg-cont {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    max-width: 90%;
    animation: dai-msg-slide 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes dai-msg-slide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

#quiz-app .dai-msg-cont.user {
    flex-direction: row-reverse;
    align-self: flex-end;
}

#quiz-app .dai-msg-cont.ai {
    align-self: flex-start;
}

#quiz-app .dai-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

#quiz-app .dai-msg-cont.ai .dai-avatar {
    background: linear-gradient(135deg, #1565c0 0%, #42a5f5 100%);
}

#quiz-app .dai-msg-cont.ai .dai-avatar svg {
    width: 18px;
    height: 18px;
    fill: white;
}

#quiz-app .dai-msg-cont.user .dai-avatar {
    background: #e3f2fd;
    color: #1565c0;
    font-size: 12px;
    font-weight: bold;
}

#quiz-app .dai-msg {
    padding: 12px 16px;
    border-radius: 20px;
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

#quiz-app .dai-msg-cont.user .dai-msg {
    background: #1565c0;
    color: white;
    border-top-right-radius: 4px;
}

#quiz-app .dai-msg-cont.ai .dai-msg {
    background: white;
    color: #0d47a1;
    border: 1px solid rgba(21, 101, 192, 0.1);
    border-top-left-radius: 4px;
}

#quiz-app .dai-input-area-cont {
    padding: 20px;
    background: transparent;
    border-top: 1px solid rgba(21, 101, 192, 0.1);
}

#quiz-app .dai-input-area {
    background: #f1f8ff;
    padding: 8px 8px 8px 16px;
    border-radius: 28px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s, box-shadow 0.2s;
}

#quiz-app .dai-input-area:focus-within {
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    outline: 2px solid #1565c022;
}

#quiz-app .dai-input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 15px;
    color: #1565c0;
    outline: none;
    padding: 8px 0;
}

#quiz-app .dai-send {
    width: 36px;
    height: 36px;
    background: #1565c0;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
}

#quiz-app .dai-send:hover {
    background: #0d47a1;
    transform: scale(1.05);
}

#quiz-app .dai-send svg {
    width: 18px;
    height: 18px;
    fill: white;
}

#quiz-app .dai-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    width: fit-content;
    margin: 0 20px 10px;
    display: none;
}

#quiz-app .dai-dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: dai-typing 1.4s infinite ease-in-out;
}

#quiz-app .dai-dot:nth-child(2) {
    animation-delay: 0.2s;
}

#quiz-app .dai-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dai-typing {

     0%,
     80%,
     100% {
         transform: scale(0.6);
         opacity: 0.4;
     }

     40% {
         transform: scale(1);
         opacity: 1;
     }
 }

#quiz-app .dai-btn-insight {
    width: calc(100% - 40px);
    margin: 0 20px 15px;
    padding: 12px;
    background: linear-gradient(90deg, #f59e0b, #d97706);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s;
}

#quiz-app .dai-btn-insight:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Visual Diagrams for AI */
#quiz-app .bai-diag-cont {
     display: flex;
     flex-direction: column;
     align-items: center;
     gap: 8px;
     margin: 15px 0;
     width: 100%;
     direction: ltr;
 }

#quiz-app .bai-step {
    background: #4285f4;
    color: white;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    min-width: 140px;
    box-shadow: 0 4px 10px rgba(66, 133, 244, 0.2);
}

#quiz-app .bai-step.start {
    background: #e0e7ff;
    color: #4285f4;
    border: 1.5px solid #4285f4;
}

#quiz-app .bai-step.end {
    background: #1e293b;
}

#quiz-app .bai-conn {
    width: 2px;
    height: 20px;
    background: #cbd5e1;
    position: relative;
}

#quiz-app .bai-conn::after {
    content: '▼';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #cbd5e1;
}