/* Serendipity & Discovery Features */

/* Random Connection Generator */
.random-connection-widget {
    position: fixed;
    bottom: 280px;
    right: 32px;
    z-index: 9996;
}

.random-connection-button {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(236, 72, 153, 0.4);
    transition: all 0.3s ease;
}

.random-connection-button:hover {
    transform: scale(1.1) rotate(180deg);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.6);
}

.random-connection-button svg {
    width: 28px;
    height: 28px;
    color: white;
}

.random-connection-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 20px;
}

.random-connection-modal.active {
    display: flex;
}

.random-connection-content {
    background: var(--color-surface, #ffffff);
    border-radius: 20px;
    max-width: 700px;
    width: 100%;
    padding: 40px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.random-connection-title {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.connection-cards {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
    align-items: center;
}

.connection-card {
    flex: 1;
    padding: 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    border: 2px solid var(--color-border, #e2e8f0);
}

.connection-card-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-secondary, #64748b);
    margin-bottom: 12px;
}

.connection-card-content {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text, #0f172a);
    line-height: 1.4;
}

.connection-symbol {
    font-size: 2rem;
    color: #ec4899;
    flex-shrink: 0;
}

.connection-prompt {
    padding: 20px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #78350f;
    border-left: 4px solid #f59e0b;
}

.connection-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.connection-action-btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 0.9375rem;
}

.connection-action-btn.primary {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: white;
}

.connection-action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(236, 72, 153, 0.3);
}

.connection-action-btn.secondary {
    background: var(--color-surface, #ffffff);
    color: var(--color-text, #0f172a);
    border: 2px solid var(--color-border, #e2e8f0);
}

.connection-action-btn.secondary:hover {
    background: var(--color-bg-secondary, #f8fafc);
}

/* Serendipity Engine */
.serendipity-button {
    position: fixed;
    bottom: 350px;
    right: 32px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.4);
    transition: all 0.3s ease;
    z-index: 9996;
    animation: pulse-glow 3s infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(6, 182, 212, 0.4);
    }
    50% {
        box-shadow: 0 4px 24px rgba(6, 182, 212, 0.7), 0 0 30px rgba(6, 182, 212, 0.3);
    }
}

.serendipity-button:hover {
    transform: scale(1.1);
}

.serendipity-button svg {
    width: 28px;
    height: 28px;
    color: white;
}

/* Cross-Domain Links Panel */
.cross-domain-panel {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%) translateX(calc(100% - 48px));
    width: 320px;
    background: var(--color-surface, #ffffff);
    border: 1px solid var(--color-border, #e2e8f0);
    border-right: none;
    border-radius: 16px 0 0 16px;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    z-index: 9995;
    padding: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

.cross-domain-panel.open {
    transform: translateY(-50%) translateX(0);
}

.cross-domain-toggle {
    position: absolute;
    left: -40px;
    top: 20px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cross-domain-toggle svg {
    width: 20px;
    height: 20px;
    color: white;
}

.cross-domain-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--color-text, #0f172a);
}

.cross-domain-link {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--color-bg-secondary, #f8fafc);
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    border-left: 3px solid transparent;
}

.cross-domain-link:hover {
    background: var(--color-accent-light, #eef2ff);
    border-left-color: var(--color-accent, #6366f1);
    transform: translateX(-4px);
}

.cross-domain-icon {
    width: 20px;
    height: 20px;
    color: #10b981;
    flex-shrink: 0;
}

.cross-domain-text {
    flex: 1;
}

.cross-domain-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text, #0f172a);
    margin-bottom: 2px;
}

.cross-domain-description {
    font-size: 0.75rem;
    color: var(--color-text-secondary, #64748b);
    line-height: 1.4;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .random-connection-widget,
    .serendipity-button {
        right: 20px;
        width: 48px;
        height: 48px;
    }
    
    .random-connection-content {
        padding: 24px;
    }
    
    .connection-cards {
        flex-direction: column;
    }
    
    .cross-domain-panel {
        width: 90%;
        transform: translateY(-50%) translateX(100%);
    }
    
    .cross-domain-panel.open {
        transform: translateY(-50%) translateX(0);
    }
}

[data-theme="dark"] .random-connection-content,
[data-theme="dark"] .cross-domain-panel {
    background: var(--color-surface, #14141f);
}

[data-theme="dark"] .connection-card {
    background: var(--color-bg, #0a0a0f);
}
