/**
 * ILLIXIS Tour Styles
 * Custom Shepherd.js styling to match ILLIXIS brand
 */

/* CSS Variables for tours (aligned with ILLIXIS design system) */
:root {
    --tour-primary: var(--primary, #FFC400);
    --tour-primary-light: var(--primary-light, #FFF3CD);
    --tour-primary-hover: var(--primary-hover, #FFD700);
    --tour-text: var(--text-primary, #334155);
    --tour-text-secondary: var(--text-secondary, #64748b);
    --tour-border: var(--border, #e5e7eb);
    --tour-bg: var(--card-bg, #FFFFFF);
    --tour-success: var(--success, #10b981);
    --tour-shadow: var(--shadow-lg, 0 10px 15px rgba(0, 0, 0, 0.1));
}

/* ================================
   Shepherd.js Tour Styling
   ================================ */

/* Tour step container */
.shepherd-element {
    max-width: 420px;
    border-radius: 12px;
    box-shadow: var(--tour-shadow);
    border: none;
}

.shepherd-content {
    border-radius: 12px;
    padding: 0;
}

/* Header */
.shepherd-header {
    background: var(--tour-bg);
    padding: 20px 24px 0;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
}

.shepherd-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--tour-text);
    margin: 0;
}

/* Cancel button (X) */
.shepherd-cancel-icon {
    color: var(--tour-text-secondary);
    opacity: 0.7;
    transition: all 0.2s;
}

.shepherd-cancel-icon:hover {
    color: var(--tour-text);
    opacity: 1;
}

/* Content */
.shepherd-text {
    padding: 16px 24px;
    color: var(--tour-text);
    font-size: 0.95rem;
    line-height: 1.6;
}

.shepherd-text p {
    margin: 0 0 8px 0;
}

.shepherd-text p:last-child {
    margin-bottom: 0;
}

.shepherd-text ul {
    margin: 8px 0;
    padding-left: 20px;
}

.shepherd-text li {
    margin-bottom: 4px;
}

.shepherd-text strong {
    color: var(--tour-text);
    font-weight: 600;
}

/* Footer / Buttons */
.shepherd-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid var(--tour-border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: var(--tour-bg);
    border-radius: 0 0 12px 12px;
}

.shepherd-button {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

/* Primary button (Next, Let's Go, etc.) */
.shepherd-button:not(.shepherd-button-secondary) {
    background: var(--tour-primary);
    color: #000;
}

.shepherd-button:not(.shepherd-button-secondary):hover {
    background: var(--tour-primary-hover);
}

/* Secondary button (Back, Skip, Learn More) */
.shepherd-button-secondary {
    background: transparent;
    color: var(--tour-text-secondary);
    border: 1px solid var(--tour-border);
}

.shepherd-button-secondary:hover {
    background: var(--tour-primary-light);
    color: var(--tour-text);
    border-color: var(--tour-primary);
}

/* Arrow */
.shepherd-arrow,
.shepherd-arrow::before {
    background: var(--tour-bg);
}

/* Modal overlay */
.shepherd-modal-overlay-container {
    fill: rgba(0, 0, 0, 0.5);
}

/* Step progress indicator (optional - add via JS if needed) */
.shepherd-progress {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 0 24px 16px;
}

.shepherd-progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tour-border);
    transition: all 0.2s;
}

.shepherd-progress-dot.active {
    background: var(--tour-primary);
    transform: scale(1.2);
}

/* ================================
   Learning Center Modal
   ================================ */

.learning-center-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
}

.learning-center-content {
    background: var(--tour-bg);
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--tour-shadow);
}

.learning-center-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0;
}

.learning-center-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--tour-text);
}

.learning-center-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--tour-text-secondary);
    border-radius: 8px;
    transition: all 0.2s;
}

.learning-center-close:hover {
    background: var(--tour-primary-light);
    color: var(--tour-text);
}

.learning-center-subtitle {
    padding: 8px 24px 24px;
    margin: 0;
    color: var(--tour-text-secondary);
    font-size: 0.95rem;
}

/* Tour card grid */
.learning-center-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding: 0 24px 24px;
}

/* Tour cards */
.tour-card {
    position: relative;
    background: var(--tour-bg);
    border: 1px solid var(--tour-border);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.tour-card:hover {
    border-color: var(--tour-primary);
    box-shadow: 0 4px 12px rgba(255, 196, 0, 0.15);
}

.tour-card-main {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, var(--tour-primary-light) 0%, var(--tour-bg) 100%);
    border-color: var(--tour-primary);
}

.tour-card-main .tour-card-icon {
    flex-shrink: 0;
}

.tour-card-main h3,
.tour-card-main p {
    margin: 0;
}

.tour-card-main h3 {
    margin-bottom: 4px;
}

.tour-card-icon {
    color: var(--tour-primary);
    margin-bottom: 12px;
}

.tour-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--tour-text);
    margin: 0 0 4px;
}

.tour-card p {
    font-size: 0.85rem;
    color: var(--tour-text-secondary);
    margin: 0 0 8px;
    line-height: 1.4;
}

.tour-card-time {
    font-size: 0.75rem;
    color: var(--tour-text-secondary);
    background: var(--tour-primary-light);
    padding: 4px 8px;
    border-radius: 4px;
}

/* Completion badge */
.tour-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--tour-border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.tour-card-badge.completed {
    background: var(--tour-success);
}

.tour-card-badge.completed::after {
    content: '';
    width: 10px;
    height: 6px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(-45deg);
    margin-top: -2px;
}

/* ================================
   Responsive Adjustments
   ================================ */

@media (max-width: 768px) {
    .shepherd-element {
        max-width: calc(100vw - 40px);
    }

    .learning-center-grid {
        grid-template-columns: 1fr;
    }

    .tour-card-main {
        flex-direction: column;
        text-align: center;
    }
}

/* ================================
   Highlighted Element Styling
   ================================ */

/* Add a subtle pulse to the highlighted sidebar item */
.shepherd-target {
    position: relative;
    z-index: 9999;
}

.shepherd-target::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid var(--tour-primary);
    border-radius: 8px;
    animation: tourPulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes tourPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.02);
    }
}

/* Sidebar items need special handling for the highlight */
.sidebar-nav-link.shepherd-target::before,
.sidebar-section-header.shepherd-target::before {
    border-radius: 6px;
}
