/* Global Styles & Animations */
body {
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    overflow-y: auto;
}

.glow-correct {
    box-shadow: 0 0 20px 7px rgba(74, 222, 128, 0.6);
}

.glow-incorrect {
    box-shadow: 0 0 20px 7px rgba(239, 68, 68, 0.6);
}

#question-card {
    transition: box-shadow 0.4s ease-in-out;
}

.hidden {
    display: none;
}

#delete-card-btn {
    transition: opacity 0.2s ease-in-out, transform 0.1s;
}

#delete-card-btn:active {
    transform: scale(0.9);
}

.modal-overlay {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* Custom Scrollbars */
textarea::-webkit-scrollbar,
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

textarea::-webkit-scrollbar-track,
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

textarea::-webkit-scrollbar-thumb,
.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 20px;
}

.dark textarea::-webkit-scrollbar-thumb,
.dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: #4b5563;
}

/* Animations */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid #3b82f6;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-6px);
    }
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0.5rem 0.75rem;
    background: #f3f4f6;
    border-radius: 0.75rem 0.75rem 0.75rem 0;
    width: fit-content;
    align-self: flex-start;
}

.dark .typing-indicator {
    background: #374151;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* AI Chat Layout & Message Styles */
#ai-chat-container {
    right: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 767px) {
    #ai-chat-container {
        transform: translateY(100%);
        height: 70vh;
    }

    #ai-chat-container.open {
        transform: translateY(0);
    }
}

@media (min-width: 768px) {
    #ai-chat-container {
        transform: translateX(100%);
        height: 70vh;
        top: 15vh;
    }

    #ai-chat-container.open {
        transform: translateX(0);
    }
}

.chat-message-ai {
    background: #f3f4f6;
    color: #1f2937;
    padding: 0.75rem;
    border-radius: 0.75rem 0.75rem 0.75rem 0;
    max-width: 85%;
    align-self: flex-start;
    font-size: 0.875rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.dark .chat-message-ai {
    background: #374151;
    color: #f3f4f6;
}

.chat-message-user {
    background: #7c3aed;
    color: white;
    padding: 0.75rem;
    border-radius: 0.75rem 0.75rem 0 0.75rem;
    max-width: 85%;
    align-self: flex-end;
    font-size: 0.875rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Markdown Rendering in AI Chat */
.chat-message-ai p {
    margin-bottom: 0.5rem;
}

.chat-message-ai p:last-child {
    margin-bottom: 0;
}

.chat-message-ai ul,
.chat-message-ai ol {
    margin-left: 1.25rem;
    margin-bottom: 0.5rem;
}

.chat-message-ai ul {
    list-style-type: disc;
}

.chat-message-ai ol {
    list-style-type: decimal;
}

.chat-message-ai code {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 0.25rem;
    font-family: monospace;
}

.dark .chat-message-ai code {
    background: rgba(255, 255, 255, 0.1);
}

.chat-message-ai pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 0.5rem 0;
}

.dark .chat-message-ai pre {
    background: rgba(255, 255, 255, 0.05);
}

.chat-message-ai strong {
    font-weight: 700;
}

/* Dashboard Specific Styles */
.squircle {
    width: 64px;
    height: 64px;
    background-color: #93c5fd;
    color: #1e40af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    border-radius: 18px;
    text-transform: uppercase;
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.2);
    border: 2px solid white;
    transition: transform 0.2s ease;
}

.squircle:hover {
    transform: scale(1.05);
}

@keyframes linearGradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.generating-deck-bg {
    background: linear-gradient(-45deg, #b8c1ff, #e6a1ff, #94b4ff, #c9a1f7, #c1f3f7) !important;
    background-size: 400% 400% !important;
    animation: linearGradientMove 10s ease infinite !important;
}

/* Mobile Header Overlap Fix */
@media (max-width: 767px) {
    #game-container {
        margin-top: 80px;
        margin-bottom: 30px;
    }
    #ai-toggle-btn {
        top: auto;
        bottom: 20px;
        right: 20px;
    }
}

/* AI Chat Separator */
.chat-separator {
    width: 100%;
    margin: 1.5rem 0 1rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.chat-separator img {
    width: 60%;
    max-width: 150px;
    opacity: 0.4;
}

.chat-question-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}

.dark .chat-question-label {
    background: #374151;
    color: #6b7280;
}


