/**
 * The Wizard Chatbot Styles
 * Post-quantum cryptography AI assistant widget
 */

.wizard-hidden {
    display: none !important;
}

.wizard-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 8888;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.wizard-toggle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00CFFF 0%, #00AEEF 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(0, 207, 255, 0.6);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    animation: wizard-float 3s ease-in-out infinite;
}

@keyframes wizard-float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.wizard-toggle:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 207, 255, 0.9);
}

.wizard-toggle::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00CFFF 0%, #00AEEF 100%);
    z-index: -1;
    opacity: 0.4;
    filter: blur(15px);
    animation: wizard-glow 2s ease-in-out infinite;
}

@keyframes wizard-glow {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

.wizard-emoji {
    font-size: 40px;
    line-height: 1;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.wizard-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
}

.wizard-badge:not(.wizard-hidden) {
    display: flex;
}

.wizard-window {
    position: fixed;
    bottom: 110px;
    right: 20px;
    width: 420px;
    height: 600px;
    max-height: calc(100vh - 140px);
    background: linear-gradient(135deg, rgba(0, 10, 30, 0.98) 0%, rgba(0, 0, 15, 0.98) 100%);
    border-radius: 16px;
    box-shadow:
        0 20px 60px rgba(0, 207, 255, 0.5),
        0 0 100px rgba(0, 174, 239, 0.3),
        inset 0 0 80px rgba(0, 207, 255, 0.1);
    flex-direction: column;
    overflow: hidden;
    animation: wizard-slide-up 0.3s ease, wizard-window-pulse 6s ease-in-out infinite;
    border: 2px solid rgba(0, 207, 255, 0.5);
    backdrop-filter: blur(20px);
}

.wizard-window:not(.wizard-hidden) {
    display: flex;
}

@keyframes wizard-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wizard-header {
    background: linear-gradient(135deg, #00CFFF 0%, #00AEEF 100%);
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(0, 207, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 207, 255, 0.4);
}

.wizard-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.wizard-header-emoji {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.wizard-title div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wizard-title span:first-child {
    font-size: 18px;
    font-weight: 600;
}

.wizard-subtitle {
    font-size: 12px;
    opacity: 0.9;
}

.wizard-actions {
    display: flex;
    gap: 8px;
}

.wizard-action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: background 0.2s;
}

.wizard-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.wizard-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: linear-gradient(180deg, rgba(0, 10, 30, 0.95) 0%, rgba(0, 5, 20, 0.98) 100%);
}

.wizard-message {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    animation: wizard-fade-in 0.3s ease;
}

@keyframes wizard-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wizard-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wizard-message-user .wizard-message-avatar {
    background: linear-gradient(135deg, #00CFFF 0%, #00AEEF 100%);
    color: white;
    box-shadow: 0 0 20px rgba(0, 207, 255, 0.6);
}

.wizard-message-assistant .wizard-message-avatar {
    background: transparent;
}

.wizard-avatar-emoji {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.wizard-message-content {
    flex: 1;
    min-width: 0;
}

.wizard-message-text {
    background: #1f2937;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    line-height: 1.5;
    color: #e5e7eb;
    border: 1px solid #374151;
    font-size: 11px;
}

.wizard-message-user .wizard-message-text {
    background: linear-gradient(135deg, rgba(0, 207, 255, 0.9) 0%, rgba(0, 174, 239, 0.9) 100%);
    color: white;
    border-color: rgba(0, 207, 255, 0.6);
    box-shadow: 0 4px 15px rgba(0, 207, 255, 0.3);
}

.wizard-message-text code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 9px;
    color: #fbbf24;
}

.wizard-message-text pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.wizard-message-text pre code {
    background: none;
    padding: 0;
    color: #a5f3fc;
}

/* Clickable links in messages */
.wizard-message-text .wizard-link {
    color: #00CFFF;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid rgba(0, 207, 255, 0.3);
    transition: all 0.2s ease;
    padding-bottom: 1px;
}

.wizard-message-text .wizard-link:hover {
    color: #E6F7FF;
    border-bottom-color: #E6F7FF;
    background: rgba(0, 207, 255, 0.1);
    border-radius: 2px;
    padding: 1px 3px;
    text-shadow: 0 0 10px rgba(0, 207, 255, 0.8);
}

/* User message links (lighter color for contrast) */
.wizard-message-user .wizard-message-text .wizard-link {
    color: #dbeafe;
    border-bottom-color: rgba(219, 234, 254, 0.4);
}

.wizard-message-user .wizard-message-text .wizard-link:hover {
    color: white;
    border-bottom-color: white;
    background: rgba(255, 255, 255, 0.15);
}

.wizard-sources {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wizard-source {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 8px;
    color: #9ca3af;
    padding: 6px 10px;
    background: #1f2937;
    border-radius: 8px;
    border: 1px solid #374151;
}

.wizard-source a {
    color: #00CFFF;
    text-decoration: none;
}

.wizard-source a:hover {
    text-decoration: underline;
    text-shadow: 0 0 10px rgba(0, 207, 255, 0.8);
}

.wizard-web-badge {
    display: inline-block;
    margin-top: 6px;
    font-size: 8px;
    padding: 4px 8px;
    background: #10b981;
    color: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.wizard-input-container {
    padding: 16px;
    background: linear-gradient(180deg, rgba(0, 10, 30, 0.98) 0%, rgba(0, 5, 20, 0.98) 100%);
    border-top: 2px solid rgba(0, 207, 255, 0.3);
    box-shadow: 0 -4px 20px rgba(0, 207, 255, 0.2);
}

.wizard-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wizard-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #374151;
    border-radius: 8px;
    font-size: 10px;
    resize: none;
    font-family: inherit;
    line-height: 1.5;
    background: #1f2937;
    color: #e5e7eb;
    min-height: 40px;
    max-height: 120px;
    overflow-y: auto;
}

.wizard-input::placeholder {
    color: #6b7280;
}

.wizard-input:focus {
    outline: none;
    border-color: #00CFFF;
    box-shadow: 0 0 0 3px rgba(0, 207, 255, 0.3), 0 0 20px rgba(0, 207, 255, 0.2);
}

.wizard-input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Mode and search select - identical styling */
.wizard-mode-select,
.wizard-search-select {
    background: #1f2937;
    color: #e5e7eb;
    border: 1px solid #374151;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 9px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.wizard-mode-select:hover,
.wizard-search-select:hover {
    border-color: #00CFFF;
    background: rgba(0, 207, 255, 0.05);
}

.wizard-mode-select:focus,
.wizard-search-select:focus {
    border-color: #00CFFF;
    box-shadow: 0 0 0 2px rgba(0, 207, 255, 0.3), 0 0 15px rgba(0, 207, 255, 0.2);
}

.wizard-mode-select option,
.wizard-search-select option {
    background: #1f2937;
    color: #e5e7eb;
    padding: 8px;
}

.wizard-send-btn {
    background: linear-gradient(135deg, #00CFFF 0%, #00AEEF 100%);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(0, 207, 255, 0.5);
}

.wizard-send-btn:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 207, 255, 0.7), 0 0 30px rgba(0, 207, 255, 0.4);
}

.wizard-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wizard-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: wizard-spin 0.6s linear infinite;
}

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

@keyframes wizard-window-pulse {
    0%, 100% {
        box-shadow:
            0 20px 60px rgba(0, 207, 255, 0.5),
            0 0 100px rgba(0, 174, 239, 0.3),
            inset 0 0 80px rgba(0, 207, 255, 0.1);
    }
    50% {
        box-shadow:
            0 20px 60px rgba(0, 207, 255, 0.7),
            0 0 120px rgba(0, 174, 239, 0.5),
            inset 0 0 100px rgba(0, 207, 255, 0.15);
    }
}

.wizard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(0, 10, 30, 0.98) 0%, rgba(0, 5, 20, 0.98) 100%);
    border-top: 2px solid rgba(0, 207, 255, 0.2);
    font-size: 8px;
}

.wizard-status {
    color: #9ca3af;
}

.wizard-powered {
    color: #6b7280;
    text-decoration: none;
}

.wizard-powered:hover {
    color: #00CFFF;
    text-shadow: 0 0 10px rgba(0, 207, 255, 0.8);
}

@media (max-width: 768px) {
    .wizard-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 140px);
        right: 20px;
    }
}
