/**
 * Freehand Drawing Tutorial CSS
 * 
 * Styles for the animated tutorial overlay that guides users
 * through the freehand drawing feature.
 * 
 * @since 2.0.0
 */

/* Main tutorial overlay */
#freehand-tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

/* Tutorial card */
.freehand-tutorial-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
    max-height: 90vh !important;
    overflow-y: auto !important;
}

/* Close button */
.freehand-tutorial-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none !important;
    font-size: 32px !important;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    transition: all 0.2s ease;
    display: flex;
    font-size: 32px !important;
    justify-content: center;
    align-items: center;
}

.freehand-tutorial-close:hover {
    color: #333;
}

/* Tutorial title */
.freehand-tutorial-card h2 {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #333;
    font-weight: 600;
}

/* Demo container */
.freehand-tutorial-demo {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
    height: 200px;
}

/* Instructions container */
.freehand-tutorial-instructions {
    margin-bottom: 25px;
}

/* Step styling */
.freehand-tutorial-step {
    display: flex;
    align-items: start;
    margin-bottom: 18px;
    animation: fadeInStep 0.6s ease both;
}

.freehand-tutorial-step .step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    margin-right: 15px;
}

.freehand-tutorial-step .step-content strong {
    color: #333;
    display: block;
    margin-bottom: 5px;
}

.freehand-tutorial-step .step-content span {
    color: #666;
    font-size: 14px;
}

/* Tip styling */
.freehand-tutorial-tip {
    background: #f0f4ff;
    border-left: 4px solid #667eea;
    padding: 12px 15px;
    border-radius: 6px;
    margin-top: 20px;
    animation: fadeInStep 0.6s ease both;
}

.freehand-tutorial-tip strong {
    color: #667eea;
    display: block;
    margin-bottom: 5px;
}

.freehand-tutorial-tip span {
    color: #555;
    font-size: 14px;
}

/* Buttons container */
.freehand-tutorial-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 25px;
}

/* Checkbox container */
.freehand-tutorial-checkbox {
    display: flex;
    align-items: center;
    margin-right: auto;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}

.freehand-tutorial-checkbox input {
    margin-right: 8px;
    cursor: pointer;
}

/* Got it button */
.freehand-tutorial-gotit {
    border: none;
    padding: 12px 28px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.freehand-tutorial-gotit:hover {
    transform: translateY(-2px);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

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

@keyframes fadeInStep {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInMarker {
    from { opacity: 0; transform: scale(0); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes drawPath {
    from { stroke-dashoffset: 500; }
    to { stroke-dashoffset: 0; }
}

@keyframes fillPolygon {
    from { fill-opacity: 0; }
    to { fill-opacity: 0.3; }
}

@keyframes moveCursor {
    0% { transform: translate(230px, 50px); opacity: 0; }
    5% { opacity: 1; }
    25% { transform: translate(320px, 50px); }
    50% { transform: translate(320px, 150px); }
    75% { transform: translate(140px, 150px); }
    95% { transform: translate(140px, 50px); opacity: 1; }
    100% { transform: translate(230px, 50px); opacity: 0; }
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    10%, 90% { opacity: 1; }
}

/* Responsive styles for mobile */
@media (max-width: 768px) {
    .freehand-tutorial-card {
        padding: 20px !important;
        width: 95% !important;
        max-width: 95% !important;
        margin: 10px !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }
    
    .freehand-tutorial-close {
        top: 10px !important;
        right: 10px !important;
        width: 50px !important;
        height: 50px !important;
        font-size: 48px !important;
        background: rgba(255, 255, 255, 0.95) !important;
        border-radius: 50% !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 10 !important;
    }
    
    .freehand-tutorial-card h2 {
        font-size: 20px !important;
        margin-right: 50px !important;
    }
    
    .freehand-tutorial-demo {
        height: 150px !important;
        padding: 15px !important;
    }
    
    .freehand-tutorial-step {
        margin-bottom: 15px !important;
    }
    
    .freehand-tutorial-step .step-number {
        width: 28px !important;
        height: 28px !important;
        font-size: 14px !important;
        margin-right: 12px !important;
    }
    
    .freehand-tutorial-step .step-content strong {
        font-size: 15px !important;
    }
    
    .freehand-tutorial-step .step-content span {
        font-size: 13px !important;
    }
    
    .freehand-tutorial-gotit {
        padding: 14px 24px !important;
        font-size: 16px !important;
        width: 100% !important;
        margin-top: 10px !important;
    }
    
    .freehand-tutorial-checkbox {
        font-size: 13px !important;
        margin-bottom: 10px !important;
    }
    
    .freehand-tutorial-buttons {
        flex-direction: column !important;
        gap: 0 !important;
    }
}

/* Extra small screens (phones in portrait) */
@media (max-width: 480px) {
    .freehand-tutorial-card {
        padding: 15px !important;
        border-radius: 8px !important;
    }
    
    .freehand-tutorial-close {
        width: 20px !important;
        height: 20px !important;
        font-size: 35px !important;
        top: 8px !important;
        right: 8px !important;
    }
    
    .freehand-tutorial-card h2 {
        font-size: 18px !important;
        margin-bottom: 15px !important;
    }
    
    .freehand-tutorial-demo {
        height: 120px !important;
        padding: 10px !important;
        margin-bottom: 15px !important;
    }
}
