/* =============================================================================
   TUTORIAL STYLES - "Jak dziala model"
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Progress Bar
   ----------------------------------------------------------------------------- */

.tutorial-progress {
    padding: 24px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.step-indicator-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.step-indicator {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    font-weight: 600;
    color: #6c757d;
}

.step-indicator:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.step-indicator.completed {
    background: #198754;
    border-color: #198754;
    color: white;
}

.step-indicator.completed::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    font-size: 0.7rem;
}

.step-indicator.completed .step-number,
.step-indicator.completed .step-icon {
    display: none;
}

.step-indicator.active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: white;
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(13, 110, 253, 0.4);
}

.step-link {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.step-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-align: center;
    max-width: 70px;
}

.step-connector {
    flex: 1;
    height: 4px;
    background: #dee2e6;
    margin: 0 4px;
    border-radius: 2px;
    min-width: 20px;
    max-width: 60px;
    align-self: center;
    margin-bottom: 24px;
}

.step-connector.completed {
    background: linear-gradient(90deg, #198754 0%, #198754 100%);
}

/* -----------------------------------------------------------------------------
   Step Header
   ----------------------------------------------------------------------------- */

.step-header {
    text-align: center;
    padding: 20px 0;
}

.step-header h1 {
    color: #212529;
    margin-bottom: 12px;
}

.step-header .lead {
    max-width: 700px;
    margin: 0 auto;
}

/* -----------------------------------------------------------------------------
   Data Source Badges
   ----------------------------------------------------------------------------- */

.data-source-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: help;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.data-source-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Dane z modelu - zielony */
.data-source-model {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #28a745;
}

/* Dane przykładowe - pomarańczowy */
.data-source-example {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    color: #856404;
    border: 1px solid #ffc107;
}

/* Formuły matematyczne - niebieski */
.data-source-formula {
    background: linear-gradient(135deg, #cce5ff 0%, #b8daff 100%);
    color: #004085;
    border: 1px solid #007bff;
}

/* Dane mieszane - fioletowy */
.data-source-mixed {
    background: linear-gradient(135deg, #e2d5f1 0%, #d4c4e8 100%);
    color: #5a3d7a;
    border: 1px solid #6f42c1;
}

/* -----------------------------------------------------------------------------
   Content Sections
   ----------------------------------------------------------------------------- */

.tutorial-section {
    margin-bottom: 32px;
}

.tutorial-section h2 {
    font-size: 1.5rem;
    color: #212529;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.tutorial-section h3 {
    font-size: 1.25rem;
    color: #495057;
    margin-bottom: 12px;
}

/* Wprowadzenie */
.intro-section {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid #0d6efd;
    padding: 24px;
    border-radius: 0 12px 12px 0;
    margin-bottom: 32px;
    font-size: 1.1rem;
    line-height: 1.7;
}

/* -----------------------------------------------------------------------------
   Interactive Area
   ----------------------------------------------------------------------------- */

.interactive-area {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 16px;
    padding: 24px;
    margin: 24px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.interactive-area-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

.interactive-area-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.interactive-area-actions {
    display: flex;
    gap: 8px;
}

/* Control Panel */
.control-panel {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    height: 100%;
}

.control-group {
    margin-bottom: 24px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 500;
    color: #495057;
}

.control-value {
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    background: #e9ecef;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #212529;
    min-width: 60px;
    text-align: center;
}

.form-range {
    height: 8px;
}

.form-range::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
}

.control-limits {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 4px;
}

/* Chart Container */
.chart-container {
    min-height: 400px;
    position: relative;
}

/* -----------------------------------------------------------------------------
   Explanation Section
   ----------------------------------------------------------------------------- */

.explanation-section {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    margin: 24px 0;
}

.explanation-section h3 {
    color: #0d6efd;
    margin-bottom: 16px;
}

.explanation-section p {
    line-height: 1.8;
    margin-bottom: 16px;
}

/* Math equations */
.equation {
    background: #f8f9fa;
    padding: 16px 24px;
    border-radius: 8px;
    font-family: 'Times New Roman', serif;
    font-size: 1.2rem;
    text-align: center;
    margin: 16px 0;
    border-left: 4px solid #6c757d;
}

.equation-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 8px;
}

/* -----------------------------------------------------------------------------
   Term Tooltips
   ----------------------------------------------------------------------------- */

.term-tooltip {
    border-bottom: 2px dotted #0d6efd;
    cursor: help;
    color: #0d6efd;
    transition: all 0.2s ease;
}

.term-tooltip:hover {
    background: rgba(13, 110, 253, 0.1);
    border-bottom-style: solid;
}

.term-tooltip:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Tippy theme */
.tippy-box[data-theme~='light-border'] {
    background: #fff;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.tippy-box[data-theme~='light-border'] .tippy-content {
    padding: 16px;
    color: #212529;
    font-size: 0.9rem;
    line-height: 1.6;
}

.tippy-box[data-theme~='light-border'] hr {
    margin: 8px 0;
    border-color: #e9ecef;
}

/* -----------------------------------------------------------------------------
   Key Insights Box
   ----------------------------------------------------------------------------- */

.key-insights {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 4px solid #198754;
    padding: 24px;
    border-radius: 0 12px 12px 0;
    margin: 24px 0;
}

.key-insights h4 {
    color: #155724;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.key-insights h4 i {
    font-size: 1.2rem;
}

.key-insights ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.key-insights li {
    margin-bottom: 12px;
    color: #155724;
    padding-left: 28px;
    position: relative;
    line-height: 1.6;
}

.key-insights li:last-child {
    margin-bottom: 0;
}

.key-insights li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    color: #198754;
}

/* -----------------------------------------------------------------------------
   Quiz Section
   ----------------------------------------------------------------------------- */

.quiz-section {
    background: #fff;
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
}

.quiz-section h4 {
    color: #856404;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-question {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 16px;
    color: #212529;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-option:hover {
    border-color: #0d6efd;
    background: #f8f9fa;
}

.quiz-option.selected {
    border-color: #0d6efd;
    background: #e7f1ff;
}

.quiz-option.correct {
    border-color: #198754;
    background: #d4edda;
}

.quiz-option.incorrect {
    border-color: #dc3545;
    background: #f8d7da;
}

.quiz-option input[type="radio"] {
    margin-top: 4px;
}

.quiz-feedback {
    margin-top: 16px;
    padding: 16px;
    border-radius: 8px;
    display: none;
}

.quiz-feedback.show {
    display: block;
}

.quiz-feedback.correct {
    background: #d4edda;
    border: 1px solid #198754;
    color: #155724;
}

.quiz-feedback.incorrect {
    background: #f8d7da;
    border: 1px solid #dc3545;
    color: #721c24;
}

.quiz-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
}

/* -----------------------------------------------------------------------------
   Navigation
   ----------------------------------------------------------------------------- */

.tutorial-navigation {
    padding: 24px 0;
}

.step-counter {
    font-size: 1.1rem;
    font-weight: 500;
}

/* -----------------------------------------------------------------------------
   Summary Page
   ----------------------------------------------------------------------------- */

.summary-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #dee2e6;
    padding: 24px;
    margin-bottom: 24px;
    transition: all 0.2s ease;
}

.summary-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.summary-card h3 {
    color: #0d6efd;
    margin-bottom: 12px;
}

.summary-equation {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    font-family: monospace;
    margin: 12px 0;
}

/* -----------------------------------------------------------------------------
   Responsive
   ----------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .tutorial-progress {
        padding: 16px 12px;
    }

    .step-indicator {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .step-connector {
        margin-bottom: 0;
        min-width: 10px;
    }

    .interactive-area {
        padding: 16px;
    }

    .control-panel {
        margin-bottom: 20px;
    }

    .intro-section,
    .key-insights,
    .explanation-section {
        padding: 16px;
    }

    .equation {
        font-size: 1rem;
        padding: 12px 16px;
    }
}

@media (max-width: 576px) {
    .step-indicator {
        width: 36px;
        height: 36px;
    }

    .step-header h1 {
        font-size: 1.5rem;
    }

    .tutorial-navigation .btn {
        padding: 8px 16px;
    }
}

/* -----------------------------------------------------------------------------
   Animations
   ----------------------------------------------------------------------------- */

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.step-indicator.active {
    animation: pulse 2s infinite;
}

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

.tutorial-content {
    animation: fadeIn 0.3s ease;
}

/* -----------------------------------------------------------------------------
   Print
   ----------------------------------------------------------------------------- */

@media print {
    .tutorial-progress,
    .tutorial-navigation,
    .quiz-section,
    .control-panel {
        display: none;
    }

    .interactive-area {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}
