/* Blackboard Styles - Existing */
/* Note: .bb-toggle positioning is handled in presentation.html for menu bar integration */
.bb-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-alt, #f8fafc);
    border: 2px solid var(--border, #e2e8f0);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.bb-toggle:hover {
    transform: scale(1.1) rotate(-15deg);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
    border-color: var(--accent);
}

.bb-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #0d1117;
    /* Darker background for contrast */
    background-image: radial-gradient(circle, #333 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.bb-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Hide presentation nav when blackboard is active */
.bb-overlay.visible~nav,
body:has(.bb-overlay.visible) nav {
    display: none !important;
}

#bbCanvas {
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.bb-controls {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 41, 59, 0.9);
    padding: 10px 25px;
    border-radius: 50px;
    display: flex;
    gap: 15px;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.bb-zoom-controls {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: rgba(30, 41, 59, 0.9);
    padding: 8px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 10002;
}

.bb-zoom-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.bb-zoom-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.bb-color-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s;
}

.bb-color-btn:hover {
    transform: scale(1.2);
}

.bb-color-btn.active {
    transform: scale(1.2);
    border-color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.bb-control-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.bb-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.bb-control-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}


/* Save/Load Controls */
.bb-save-load {
    position: absolute;
    top: 80px;
    /* Below the main controls */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 41, 59, 0.9);
    padding: 8px 16px;
    border-radius: 50px;
    display: flex;
    gap: 10px;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    z-index: 10001;
    /* Above canvas, below zoom? check layering */
}

.bb-select {
    background: rgba(15, 23, 42, 0.6);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 5px 10px;
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
}

.bb-select:hover {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(255, 255, 255, 0.3);
}

.bb-select:focus {
    border-color: #3b82f6;
    background: rgba(15, 23, 42, 0.9);
}

.bb-select option {
    background: #1e293b;
    color: white;
}

/* Chatbot Interface */
.bb-chat-container {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    max-width: 90vw;
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    z-index: 10001;
    transition: transform 0.3s ease;
}

.bb-chat-container:focus-within {
    transform: translateX(-50%) translateY(-5px);
    border-color: #3b82f6;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(59, 130, 246, 0.2);
}

.bb-chat-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

.bb-chat-input:focus {
    background: rgba(15, 23, 42, 0.8);
    border-color: #3b82f6;
}

.bb-chat-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.bb-send-btn {
    background: #3b82f6;
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.bb-send-btn:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.bb-send-btn:active {
    transform: scale(0.95);
}

.bb-send-btn:disabled {
    background: #475569;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Loading Spinner for Chat */
.bb-loading {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}