/**
 * In-App Guide System Styles
 * Clean, minimal design that matches the existing aesthetic
 */

/* Guide Triggers */
.guide-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    border: 1px solid hsl(var(--border));
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    margin: 0.25rem;
}

.guide-trigger:hover {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.guide-trigger i {
    font-size: 1rem;
    opacity: 0.8;
}

/* Compact trigger for tight spaces */
.guide-trigger.compact {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
}

.guide-trigger.compact span {
    display: none;
}

.guide-trigger.compact:hover span {
    display: inline;
}

/* Main Guide Overlay */
.guide-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.guide-overlay.active {
    opacity: 1;
    visibility: visible;
}

.guide-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Guide Content */
.guide-content {
    position: relative;
    background: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    animation: guideSlideIn 0.3s ease;
}

@keyframes guideSlideIn {
    from {
        transform: translateY(-20px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Guide Header */
.guide-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid hsl(var(--border));
    background: hsl(var(--muted) / 0.3);
}

.guide-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

.guide-close {
    background: none;
    border: none;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
}

.guide-close:hover {
    background: hsl(var(--muted));
    color: hsl(var(--foreground));
}

/* Guide Body */
.guide-body {
    padding: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.guide-text h4 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

.guide-text p {
    margin: 0;
    line-height: 1.6;
    color: hsl(var(--muted-foreground));
}

.guide-visual {
    margin-top: 1rem;
    padding: 1rem;
    background: hsl(var(--muted) / 0.3);
    border-radius: 8px;
    border: 1px solid hsl(var(--border));
}

/* Guide Footer */
.guide-footer {
    padding: 1.5rem;
    border-top: 1px solid hsl(var(--border));
    background: hsl(var(--background));
}

.guide-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.step-counter {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    font-weight: 500;
    min-width: 100px;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: hsl(var(--muted));
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: hsl(var(--primary));
    transition: width 0.3s ease;
    border-radius: 2px;
}

.guide-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.guide-btn {
    padding: 0.625rem 1.25rem;
    border: 1px solid hsl(var(--border));
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
}

.guide-btn:hover:not(:disabled) {
    background: hsl(var(--muted));
    transform: translateY(-1px);
}

.guide-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.guide-btn.guide-next {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-color: hsl(var(--primary));
}

.guide-btn.guide-next:hover {
    background: hsl(var(--primary) / 0.9);
}

.guide-btn.guide-skip {
    background: transparent;
    color: hsl(var(--muted-foreground));
    border: none;
    padding: 0.625rem 0.75rem;
}

.guide-btn.guide-skip:hover {
    color: hsl(var(--foreground));
    background: hsl(var(--muted));
}

/* Element Highlighting */
.guide-highlight {
    position: relative;
    z-index: 9999;
    animation: guideHighlight 0.5s ease;
}

.guide-highlight::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: hsl(var(--primary) / 0.1);
    border: 2px solid hsl(var(--primary));
    border-radius: 8px;
    pointer-events: none;
    animation: guidePulse 2s infinite;
    z-index: -1;
}

@keyframes guideHighlight {
    from {
        transform: scale(1.05);
    }
    to {
        transform: scale(1);
    }
}

@keyframes guidePulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 0.3;
        transform: scale(1.02);
    }
}

/* Quick Tooltips */
.guide-tooltip {
    position: absolute;
    background: hsl(var(--foreground));
    color: hsl(var(--background));
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 9998;
    max-width: 200px;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    animation: tooltipFadeIn 0.2s ease;
}

.guide-tooltip::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 6px solid transparent;
}

.guide-tooltip-top {
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
}

.guide-tooltip-top::before {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: hsl(var(--foreground));
}

.guide-tooltip-bottom {
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
}

.guide-tooltip-bottom::before {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: hsl(var(--foreground));
}

.guide-tooltip-left {
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
}

.guide-tooltip-left::before {
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-left-color: hsl(var(--foreground));
}

.guide-tooltip-right {
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
}

.guide-tooltip-right::before {
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-right-color: hsl(var(--foreground));
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Body state when guide is active */
body.guide-active {
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
    .guide-content {
        width: 95%;
        margin: 1rem;
        max-height: 90vh;
    }
    
    .guide-header,
    .guide-body,
    .guide-footer {
        padding: 1rem;
    }
    
    .guide-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .guide-btn {
        width: 100%;
        justify-content: center;
    }
    
    .guide-trigger span {
        display: none;
    }
    
    .guide-trigger {
        padding: 0.5rem;
        border-radius: 50%;
        width: 2.5rem;
        height: 2.5rem;
        justify-content: center;
    }
}

/* Integration with existing design system */
.guide-trigger,
.guide-btn {
    font-family: inherit;
}

/* Dark mode support (if implemented) */
@media (prefers-color-scheme: dark) {
    .guide-backdrop {
        background: rgba(0, 0, 0, 0.8);
    }
}