/* User Experience Enhancements */

/* Smooth Scroll Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Interactive Tooltips */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) scale(0);
    padding: 0.75rem 1rem;
    background: rgba(10, 14, 39, 0.95);
    color: white;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.tooltip::before {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%) scale(0);
    border: 6px solid transparent;
    border-top-color: rgba(10, 14, 39, 0.95);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip:hover::after,
.tooltip:hover::before {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.05) 25%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1rem;
    margin: 0.5rem 0;
}

.skeleton-title {
    height: 2rem;
    margin: 1rem 0;
}

.skeleton-image {
    height: 200px;
    width: 100%;
}

/* Page Loading Overlay */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 2rem;
    animation: pulse 2s infinite;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

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

.loader-text {
    color: var(--text-secondary);
    font-size: 1rem;
}

.loader-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 1rem auto 0;
    overflow: hidden;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    animation: progress 2s ease-in-out;
}

@keyframes progress {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Guided Tour */
.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9998;
    display: none;
}

.tour-overlay.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.tour-spotlight {
    position: fixed;
    border: 3px solid var(--accent-primary);
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.85);
    z-index: 9999;
    pointer-events: none;
    transition: all 0.5s ease;
}

.tour-tooltip {
    position: fixed;
    background: rgba(10, 14, 39, 0.98);
    border: 1px solid rgba(102, 126, 234, 0.5);
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    z-index: 10000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.tour-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.tour-step {
    font-size: 0.85rem;
    color: var(--accent-primary);
    font-weight: 600;
}

.tour-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.tour-close:hover {
    color: var(--text-primary);
}

.tour-tooltip h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.tour-tooltip p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.tour-actions {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.tour-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.tour-btn-skip {
    background: transparent;
    color: var(--text-secondary);
}

.tour-btn-skip:hover {
    color: var(--text-primary);
}

.tour-btn-next {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.tour-btn-next:hover {
    transform: scale(1.05);
}

/* Focus Indicators for Accessibility */
*:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 3px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Skip to Content Link */
.skip-to-content {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    z-index: 99999;
    transition: top 0.3s ease;
    text-decoration: none;
    font-weight: 600;
}

.skip-to-content:focus {
    top: 1rem;
}

/* Interactive Pricing Cards */
.pricing-card.interactive {
    cursor: pointer;
    position: relative;
}

.pricing-card.interactive::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-radius: 20px;
    transition: border-color 0.3s ease;
    pointer-events: none;
}

.pricing-card.interactive.selected::after {
    border-color: var(--accent-primary);
}

.pricing-card.interactive:hover {
    transform: translateY(-15px) scale(1.02);
}

.feature-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    cursor: pointer;
    transition: color 0.3s ease;
}

.feature-toggle:hover {
    color: var(--accent-primary);
}

.toggle-switch {
    position: relative;
    width: 40px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: background 0.3s ease;
}

.toggle-switch.active {
    background: var(--accent-primary);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-switch.active::after {
    transform: translateX(20px);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .tour-tooltip {
        max-width: 90%;
        padding: 1.5rem;
    }
    
    .tooltip::after {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Enhanced Chat Styling */
.chat-message {
    margin-bottom: 1rem;
    animation: slideInMessage 0.3s ease;
}

@keyframes slideInMessage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user .message-bubble {
    background: linear-gradient(135deg, #667eea, #764ba2);
    margin-left: auto;
}

.chat-message.bot .message-bubble {
    background: rgba(255, 255, 255, 0.1);
}

.message-bubble {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    position: relative;
}

.message-bubble p {
    margin: 0 0 0.5rem 0;
    color: white;
    white-space: pre-line;
}

.message-time {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
}

.typing-indicator {
    margin-bottom: 1rem;
}

.typing-dots {
    display: flex;
    gap: 0.3rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: fit-content;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite;
}

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

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

@keyframes typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}
