/* Custom CSS for Analysis Application */

/* ===== CUSTOM COLORS ===== */
.text-purple {
    color: #6f42c1 !important;
}

.btn-outline-purple {
    color: #6f42c1;
    border-color: #6f42c1;
}

.btn-outline-purple:hover {
    color: #fff;
    background-color: #6f42c1;
    border-color: #6f42c1;
}

/* ===== WIZARD NAVIGATION - Mobile First ===== */
.wizard-navigation {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.wizard-breadcrumb .breadcrumb {
    background: transparent;
    padding: 0;
}

.wizard-breadcrumb .breadcrumb-item a {
    color: #6c757d;
    text-decoration: none;
}

.wizard-breadcrumb .breadcrumb-item a:hover {
    color: #0d6efd;
}

.wizard-steps-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0;
}

.wizard-steps {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    min-width: 100%;
    gap: 0.25rem;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    min-width: 0;
}

.wizard-step-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding: 0.25rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    width: 100%;
}

a.wizard-step-link:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
}

.wizard-step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    background: #e9ecef;
    color: #6c757d;
    border: 2px solid #dee2e6;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

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

.wizard-step.current .wizard-step-circle {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.2);
}

.wizard-step.disabled .wizard-step-circle {
    background: #f8f9fa;
    color: #adb5bd;
    border-color: #e9ecef;
}

.wizard-step-content {
    margin-top: 0.5rem;
    text-align: center;
}

.wizard-step-name {
    font-size: 0.7rem;
    font-weight: 500;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60px;
}

.wizard-step.current .wizard-step-name {
    color: #0d6efd;
    font-weight: 600;
}

.wizard-step.completed .wizard-step-name {
    color: #198754;
}

.wizard-step.disabled .wizard-step-name {
    color: #adb5bd;
}

.wizard-step-connector {
    position: absolute;
    top: 18px;
    left: calc(50% + 22px);
    width: calc(100% - 44px);
    height: 2px;
    background: #dee2e6;
    z-index: 0;
}

.wizard-step-connector.completed {
    background: #198754;
}

.wizard-nav-buttons .btn {
    min-height: 44px;
    font-size: 0.875rem;
}

/* Tablet and up (md: 768px+) */
@media (min-width: 768px) {
    .wizard-navigation {
        padding: 1.25rem;
    }
    
    .wizard-step-circle {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
    
    .wizard-step-name {
        font-size: 0.8rem;
        max-width: 80px;
    }
    
    .wizard-step-connector {
        top: 22px;
        left: calc(50% + 26px);
        width: calc(100% - 52px);
    }
    
    .wizard-nav-buttons .btn {
        font-size: 1rem;
    }
}

/* Desktop (lg: 992px+) */
@media (min-width: 992px) {
    .wizard-step-circle {
        width: 48px;
        height: 48px;
    }
    
    .wizard-step-name {
        font-size: 0.875rem;
        max-width: 100px;
    }
    
    .wizard-step-connector {
        top: 24px;
        left: calc(50% + 28px);
        width: calc(100% - 56px);
    }
}

/* Large desktop (xl: 1200px+) */
@media (min-width: 1200px) {
    .wizard-step-name {
        max-width: 120px;
    }
}

/* Dropdown styling */
.pointer-events-none {
    pointer-events: none;
}

.position-relative .fas.fa-chevron-down {
    z-index: 1;
}

/* Mobile responsive dropdown */
@media (max-width: 768px) {
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .position-relative .fas.fa-chevron-down {
        right: 12px !important;
    }
}

/* Model status indicators */
.model-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Loading states */
.btn-loading .fa-robot {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Card improvements */
.card-header .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Form improvements */
.form-select.pe-5 {
    padding-right: 2.5rem !important;
}

/* Research question card */
.research-question-card {
    border-left: 4px solid #0d6efd;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 0.25rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table-responsive th,
    .table-responsive td {
        padding: 0.375rem 0.25rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
    
    .card-header .btn-group {
        margin-top: 0.5rem;
    }
}

/* Analysis runs table enhancements */
.analysis-runs-table {
    background: white;
    border-radius: 0.375rem;
    overflow: hidden;
}

.analysis-runs-table .table {
    margin-bottom: 0;
}

.analysis-runs-table .table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

.analysis-runs-table .table td {
    vertical-align: middle;
}

/* Download buttons styling */
.download-buttons {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}

.download-buttons .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

@media (max-width: 576px) {
    .download-buttons {
        flex-direction: column;
    }
    
    .download-buttons .btn {
        width: 100%;
        margin-bottom: 0.25rem;
    }
}

/* Release-minimum trust and consent shell; intentionally scoped. */
.trust-page {
    max-width: 52rem;
    margin-inline: auto;
}

.trust-page h2 {
    margin-top: 2rem;
    font-size: 1.35rem;
}

.trust-control,
.analytics-consent a,
.trust-page a {
    min-height: 44px;
}

.analytics-consent a,
.trust-page a {
    display: inline-flex;
    align-items: center;
}

.analytics-consent {
    position: fixed;
    z-index: 1080;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 72rem;
    margin-inline: auto;
    padding: 1rem;
    color: #fff;
    background: #182322;
    border: 1px solid #48726d;
    border-radius: .5rem;
    box-shadow: 0 .75rem 2rem rgba(0, 0, 0, .35);
}

.analytics-consent[hidden],
.analytics-feedback[hidden] {
    display: none;
}

.analytics-consent__actions {
    display: flex;
    flex: 0 0 auto;
    gap: .5rem;
}

.analytics-feedback {
    position: fixed;
    z-index: 1070;
    right: 1rem;
    bottom: 1rem;
}

.trust-control:focus-visible,
.analytics-consent a:focus-visible,
.trust-page a:focus-visible {
    outline: 3px solid #69d7c8;
    outline-offset: 3px;
}

@media (max-width: 576px) {
    .analytics-consent,
    .analytics-consent__actions {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .trust-control,
    .analytics-consent,
    .analytics-feedback {
        animation: none !important;
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

/* T68: delší texty v jiných jazycích (fr, it, nl, ru, …) nesmí na úzkém
   displeji přetéct – hlavička dashboardu s tlačítky a hlavička kroku
   workflow se štítkem stavu se zalomí. */
@media (max-width: 576px) {
    main > .d-flex.justify-content-between:has(> .d-flex.gap-2) {
        flex-wrap: wrap;
        gap: .75rem;
    }
    main > .d-flex.justify-content-between > .d-flex.gap-2 {
        flex-wrap: wrap;
    }
    .d-flex:has(> .step-number-badge) {
        flex-wrap: wrap;
    }
    .d-flex:has(> .step-number-badge) > div:not(.step-number-badge) {
        min-width: 0;
    }
    .d-flex:has(> .step-number-badge) .badge {
        white-space: normal;
    }
}

/* T65/T38: delší název produktu (T52) se v navbaru na 360 px musí vejít
   vedle toggleru – značka smí zalomit a zmenšit se. */
@media (max-width: 576px) {
    .navbar-brand {
        min-width: 0;
        flex: 1 1 0;
        white-space: normal;
        font-size: 1rem;
    }
    .navbar-toggler {
        flex: 0 0 auto;
    }
}

/* T76 (bod 7): dlouhý název souboru/hierarchie v řádku seznamu nesmí na úzkém
   displeji roztáhnout stránku (360 px: overflow 447 px na /projects/<id>). */
.list-group-item > .d-flex { gap: 0.75rem; }
.list-group-item > .d-flex > div:first-child { min-width: 0; }
.list-group-item > .d-flex > div:first-child > h3 { overflow-wrap: anywhere; }
