/**
 * Step-by-Step Tool Styles
 * Inline checklist-style tutorial for lesson content
 */

/* Container */
.sbs-container {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    overflow: hidden;
    margin: 1rem 0;
}

/* Header */
.sbs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid #e2e8f0;
}

.sbs-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sbs-software-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white;
    border-radius: 0.5rem;
    font-size: 1.1rem;
}

.sbs-instructions {
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
}

.sbs-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sbs-progress-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    background: #f0fdf4;
    color: #22c55e;
    border-radius: 1rem;
    font-weight: 600;
    font-size: 0.85rem;
}

.sbs-btn-reset {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sbs-btn-reset:hover {
    border-color: #94a3b8;
    color: #334155;
}

/* Platform tabs */
.sbs-platform-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
}

.sbs-platform-tab {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    background: white;
    color: #64748b;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sbs-platform-tab:hover {
    border-color: var(--tab-color, #4f46e5);
    color: var(--tab-color, #4f46e5);
}

.sbs-platform-tab.active {
    background: var(--tab-color, #4f46e5);
    border-color: var(--tab-color, #4f46e5);
    color: white;
}

.sbs-platform-tab i {
    font-size: 1rem;
}

/* Platform indicator */
.sbs-platform-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Steps container */
.sbs-steps-container {
    padding: 1rem;
    max-height: 500px;
    overflow-y: auto;
}

/* Individual step */
.sbs-step-item {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 0.875rem;
    margin-bottom: 0.625rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 0.625rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sbs-step-item:last-child {
    margin-bottom: 0;
}

.sbs-step-item:hover {
    border-color: #94a3b8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.sbs-step-item.completed {
    background: #f0fdf4;
    border-color: #22c55e;
}

.sbs-step-item.other-platform {
    opacity: 0.6;
    background: #f8fafc;
}

/* Step number */
.sbs-step-number {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: #4f46e5;
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
}

.sbs-step-item.completed .sbs-step-number {
    background: #22c55e;
}

.sbs-step-item.other-platform .sbs-step-number {
    background: #94a3b8;
}

/* Step content */
.sbs-step-content {
    flex: 1;
    min-width: 0;
}

.sbs-step-instruction {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #1e293b;
}

/* Platform badge */
.sbs-platform-badge {
    display: inline-flex;
    align-items: center;
    margin-top: 0.375rem;
    padding: 0.125rem 0.5rem;
    background: #f1f5f9;
    border-radius: 1rem;
    font-size: 0.7rem;
    color: #64748b;
}

/* Step image */
.sbs-step-image-container {
    margin-top: 0.625rem;
    border-radius: 0.375rem;
    overflow: hidden;
}

.sbs-step-image {
    max-width: 100%;
    max-height: 200px;
    width: auto;
    height: auto;
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sbs-step-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Image placeholder */
.sbs-step-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 0.375rem;
    color: #64748b;
    font-size: 0.85rem;
    text-align: center;
    min-height: 100px;
}

.sbs-step-image-placeholder > i {
    font-size: 1.75rem;
    color: #94a3b8;
}

.sbs-placeholder-description {
    max-width: 280px;
    line-height: 1.4;
    color: #64748b;
}

/* Step checkbox */
.sbs-step-checkbox {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.25rem;
    color: transparent;
    transition: all 0.2s ease;
}

.sbs-step-item:hover .sbs-step-checkbox {
    border-color: #4f46e5;
}

.sbs-step-item.completed .sbs-step-checkbox {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
}

/* No steps message */
.sbs-no-steps {
    text-align: center;
    padding: 2rem;
    color: #64748b;
    font-size: 0.95rem;
}

/* Error message */
.sbs-error {
    text-align: center;
    padding: 1.5rem;
    color: #dc2626;
    font-size: 0.95rem;
}

/* Completion banner */
.sbs-completion-banner {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    text-align: center;
}

.sbs-completion-banner.sbs-hidden {
    display: none;
}

.sbs-completion-content h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.sbs-completion-content p {
    margin: 0.25rem 0 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.sbs-completion-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sbs-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .sbs-platform-tabs {
        padding: 0.5rem;
    }

    .sbs-platform-tab {
        padding: 0.375rem 0.75rem;
        font-size: 0.85rem;
    }

    .sbs-platform-tab span {
        display: none;
    }

    .sbs-platform-tab i {
        margin-right: 0 !important;
    }

    .sbs-steps-container {
        padding: 0.75rem;
        max-height: 400px;
    }

    .sbs-step-item {
        padding: 0.75rem;
        gap: 0.625rem;
    }

    .sbs-step-number {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.8rem;
    }

    .sbs-step-instruction {
        font-size: 0.9rem;
    }
}

/* Data Entry Table */
.sbs-data-entry-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.9rem;
}

.sbs-data-entry-table th {
    background: #4f46e5;
    color: white;
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 600;
}

.sbs-data-entry-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.sbs-data-entry-table tr:nth-child(even) {
    background: #f8fafc;
}

.sbs-data-entry-table td:first-child {
    font-family: monospace;
    font-weight: 600;
    color: #4f46e5;
    background: #f1f5f9;
}

/* Inline code */
.sbs-inline-code {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    font-family: monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4f46e5;
    background: #f1f5f9;
    border-radius: 4px;
}

/* Keyboard shortcuts */
.sbs-step-instruction kbd {
    display: inline-block;
    padding: 0.2rem 0.4rem;
    font-family: monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    box-shadow: 0 2px 0 #94a3b8;
}

.sbs-kbd-combo {
    white-space: nowrap;
}

/* Menu paths */
.sbs-menu-path .sbs-menu-item {
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9rem;
}

.sbs-menu-path .sbs-menu-arrow {
    color: #64748b;
    margin: 0 0.25rem;
}

/* URLs in instructions */
.sbs-instruction-url {
    color: #4f46e5;
    text-decoration: underline;
    font-weight: 500;
}

.sbs-instruction-url:hover {
    color: #3730a3;
}

/* Spreadsheet formulas */
.sbs-formula {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    background: #fef3c7;
    color: #92400e;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    border: 1px solid #fcd34d;
}

/* Cell references and ranges */
.sbs-cell-ref,
.sbs-cell-range {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    background: #e0e7ff;
    color: #3730a3;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

/* Button labels like (B), (OK) */
.sbs-button-label {
    font-weight: 600;
    background: #f1f5f9;
    padding: 0.1rem 0.25rem;
    border-radius: 3px;
    border: 1px solid #cbd5e1;
}
