/**
 * Icon Protection - Project Page Tutorial Styles
 * Branded tutorial overlay and modal styling
 */

/* Tutorial Overlay - Grey out everything */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* Tutorial Spotlight - Highlights the current element */
.tutorial-spotlight {
    position: fixed;
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tutorial-spotlight.active {
    opacity: 1;
}

/* Tutorial Modal */
.tutorial-modal {
    position: fixed;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    max-width: 480px;
    width: calc(100% - 40px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, 
                visibility 0.25s ease;
}

.tutorial-modal.active {
    opacity: 1;
    visibility: visible;
}

.tutorial-modal.centered {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    max-height: 90vh;
    overflow-y: auto;
}

.tutorial-modal.centered.active {
    opacity: 1;
    visibility: visible;
}

/* Tutorial Content */
.tutorial-content {
    padding: 32px;
}

.tutorial-welcome {
    text-align: center;
}

/* Tutorial Header */
.tutorial-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.tutorial-welcome .tutorial-header {
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.tutorial-logo {
    margin-bottom: 20px;
}

.tutorial-logo img {
    height: 60px;
    width: auto;
    display: block;
}

.tutorial-subtitle {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    margin: 8px 0 0 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tutorial-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #2c2c2c;
    line-height: 1.3;
}

.tutorial-welcome .tutorial-header h2 {
    color: #1a1a1a;
}

.tutorial-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #999;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.tutorial-close:hover {
    color: #f2682a;
}

/* Tutorial Description */
.tutorial-description {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    margin: 0 0 24px 0;
}

.tutorial-welcome .tutorial-description {
    color: #4a4a4a;
}

/* Progress Bar */
.tutorial-progress {
    margin-bottom: 20px;
}

.tutorial-progress-bar {
    height: 4px;
    background-color: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.tutorial-progress-fill {
    height: 100%;
    background: #f2682a;
    transition: width 0.3s ease;
}

.tutorial-progress-text {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Tutorial Navigation */
.tutorial-navigation {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
}

/* Tutorial Buttons */
.tutorial-btn {
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
    white-space: nowrap;
}

.tutorial-btn-primary {
    background: #f2682a;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(242, 104, 42, 0.25);
}

.tutorial-btn-primary:hover {
    background: #d95a22;
    box-shadow: 0 4px 12px rgba(242, 104, 42, 0.35);
    transform: translateY(-1px);
}

.tutorial-btn-primary:active {
    transform: translateY(0);
}

.tutorial-btn-secondary {
    background: #ffffff;
    color: #555;
    border: 2px solid #ddd;
}

.tutorial-btn-secondary:hover {
    background: #f8f8f8;
    border-color: #ccc;
    color: #333;
}

/* Welcome Screen Actions */
.tutorial-welcome-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 32px;
}

.tutorial-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.tutorial-buttons-single {
    justify-content: center;
}

.tutorial-buttons-single .tutorial-btn {
    min-width: 200px;
}

.tutorial-welcome .tutorial-btn {
    flex: 1;
    max-width: 160px;
}

/* Checkbox */
.tutorial-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    justify-content: center;
    font-size: 14px;
    color: #666;
}

.tutorial-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #f2682a;
}

.tutorial-checkbox:hover {
    color: #1a1a1a;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tutorial-modal {
        max-width: calc(100% - 32px);
        width: calc(100% - 32px);
        left: 16px !important;
        right: 16px !important;
        margin: 0 auto;
    }
    
    .tutorial-content {
        padding: 24px;
    }
    
    .tutorial-header h2 {
        font-size: 20px;
    }
    
    .tutorial-description {
        font-size: 15px;
    }
    
    .tutorial-logo img {
        height: 50px;
    }
    
    .tutorial-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .tutorial-welcome .tutorial-btn {
        max-width: none;
        width: 100%;
    }
    
    .tutorial-navigation {
        flex-direction: column-reverse;
    }
    
    .tutorial-navigation .tutorial-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .tutorial-modal {
        max-width: calc(100% - 24px);
        width: calc(100% - 24px);
        left: 12px !important;
        right: 12px !important;
        margin: 0 auto;
    }
    
    .tutorial-content {
        padding: 20px;
    }
    
    .tutorial-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Animation for pulsing spotlight */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65);
    }
    50% {
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
    }
}

.tutorial-spotlight.active {
    animation: pulse 2s ease-in-out infinite;
}

/* Marker pulse animation for step 4 */
@keyframes markerPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(242, 104, 42, 0.7);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 0 10px rgba(242, 104, 42, 0);
    }
}

.tutorial-pulse-markers .marker,
.tutorial-pulse-markers .project-marker,
.tutorial-pulse-markers [class*="marker"] {
    animation: markerPulse 1.5s ease-in-out infinite !important;
}

/* Accessibility */
.tutorial-modal:focus-visible {
    outline: 2px solid #f2682a;
    outline-offset: 2px;
}

.tutorial-btn:focus-visible {
    outline: 2px solid #f2682a;
    outline-offset: 2px;
}

/* Prevent body scroll when tutorial is active */
body.tutorial-active {
    overflow: hidden;
}