﻿/* ===========================================
   Progress Steps
   =========================================== */

.progress-container {
    display: block;
    color: inherit;
    margin-bottom: 1rem !important;
    padding: 0.5rem;
    padding-right: 1rem !important;
    padding-left: 1rem !important;
    border-radius: var(--bs-border-radius-xl) !important;
}

.progress-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 2rem;
    margin: 0;
}

.step {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.step:last-child {
    flex-grow: 0;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

a.step-icon {
    color: white;
}

a.step-icon:hover {
    transform: scale(1.1);
    transition: transform 0.2s;
}

.step-connector {
    flex-grow: 1;
    height: 2px;
    margin: 0 -1px;
}

/* Step Status: Completed */
.step.completed .step-icon {
    background-color: #198754;
    border: 2px solid #198754;
}

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

.step.completed:has(+ .step.in-progress) .step-connector {
    background: linear-gradient(to right, #198754, #fd7e14);
}

.step.completed:has(+ .step.rejected) .step-connector {
    background: linear-gradient(to right, #198754, #dc3545);
}

/* Step Status: In-Progress */
.step.in-progress .step-icon {
    background-color: #fd7e14;
    border: 2px solid #fd7e14;
}

.step.in-progress:has(+ .step.pending) .step-connector {
    background: linear-gradient(to right, #fd7e14, #dee2e6);
}

/* Step Status: Rejected */
.step.rejected .step-icon {
    background-color: #dc3545;
    border: 2px solid #dc3545;
}

/* Step Status: Pending */
.step.pending .step-icon {
    background-color: #6c757d;
    border: 2px solid #6c757d;
}

.step.pending .step-connector {
    background-color: #dee2e6;
}

/* ===========================================
   Case Filters Layout
   =========================================== */

.case-filters-container {
    width: 100%;
}

/* Main Row - Desktop: alles in einer Zeile */
.case-filter-main-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: flex-end;
}

/* Filter Buttons Container */
.case-filter-buttons {
    min-width: 0;
}

.case-filter-grow {
    flex: 1 1 auto;
}

.case-filter-buttons .btn-group {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
}

.case-filter-buttons .btn-group .btn {
    white-space: nowrap;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
}

/* Search and Dropdowns Container */
.case-filter-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
}

.case-search-form {
    max-width: 400px;
    min-width: 200px;
    flex: 2 2 auto;
}

.case-filter-dropdowns {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.case-filter-dropdowns .dropdown {
    min-width: 120px;
}

.case-filter-dropdowns .dropdown button {
    white-space: nowrap;
}

.case-filter-dropdowns .dropdown .dropdown-btn-text {
    display: inline;
}

.case-filter-dropdowns .dropdown .dropdown-text {
    display: inline-block;
    max-width: 15ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* ===========================================
   Case Cards
   =========================================== */

.case-card.case-action-required {
    background-color: rgba(253, 126, 20, 0.11);
}

/* ===========================================
   Rent Table
   =========================================== */

@media (min-width: 577px) {
    .rent-table-responsive {
        overflow-x: visible;
    }

    .rent-table-responsive table.table {
        overflow-y: visible;
    }
}

/* ===========================================
   Responsive: Mobile (max-width: 576px)
   =========================================== */

@media (max-width: 576px) {
    /* Main Row - Stack everything vertically on mobile */
    .case-filter-main-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Filter Buttons - Mobile Layout */
    .case-filter-buttons {
        width: 100%;
    }

    .case-filter-buttons .btn-group {
        justify-content: center;
    }

    .case-filter-buttons .btn-group .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.5rem;
    }

    /* Search and Controls - Stack Vertically on Mobile */
    .case-filter-controls {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .case-search-form {
        width: 100%;
    }

    .case-filter-dropdowns {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        width: 100%;
    }

    .case-filter-dropdowns .dropdown {
        min-width: 0;
        width: 100%;
    }

    .case-filter-dropdowns .dropdown button {
        width: 100%;
        justify-content: space-between;
    }

    .case-search-form {
        max-width: unset;
    }

    /* ===========================================
   Responsive: Mobile (max-width: 472px)
   =========================================== */

    @media (max-width: 472px) {
        .case-filter-buttons .btn-group .btn:first-child {
            border-top-left-radius: 0;
            border-bottom-left-radius: 0;
            margin-left: calc(var(--bs-border-width) * -1);
        }
        
        .case-filter-buttons .btn-group .btn:last-child {
            border-top-right-radius: 0;
            border-bottom-right-radius: 0;
        }
    }

    /* Progress Steps - Mobile Layout */
    .progress-container {
        padding: 0.5rem;
    }

    .progress-steps {
        display: flex;
        flex-wrap: wrap;
        padding: 0 0.5rem;
        row-gap: 0.5rem;
    }

    .progress-steps:has(.step:nth-child(8):last-child) .step {
        flex: 0 0 29%;
        max-width: 29%;
        justify-content: flex-start;
    }

    .progress-steps:has(.step:nth-child(8):last-child) .step:nth-child(4),
    .progress-steps:has(.step:nth-child(8):last-child) .step:last-child {
        flex: 0 0 13%;
        max-width: 13%;
    }

    .progress-steps:has(.step:nth-child(8):last-child) .step:nth-child(4) .step-connector,
    .step:last-child .step-connector {
        display: none;
    }

    .step-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .step-connector {
        flex-grow: 1;
        min-width: 0;
    }
}

/* ===========================================
   Responsive: Tablet (577px - 992px)
   =========================================== */

@media (min-width: 577px) and (max-width: 992px) {
    /* Filter Buttons - Slightly smaller on tablets */
    .case-filter-buttons .btn-group .btn {
        font-size: 0.85rem;
        padding: 0.45rem 0.65rem;
    }

    /* Search form - smaller on medium screens */
    .case-search-form {
        width: 220px;
        min-width: 180px;
    }

    /* Progress Steps - Tablet Layout */
    .step-icon {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }

    .progress-steps {
        padding: 0 0.5rem;
    }
}

/* ===========================================
   Responsive: Small Tablets (577px - 768px)
   =========================================== */

@media (min-width: 577px) and (max-width: 768px) {
    /* On smaller tablets, wrap to second line if needed */
    .case-filter-main-row {
        gap: 0.5rem;
    }

    .case-filter-buttons {
        flex: 1 1 100%;
    }

    .case-filter-controls {
        flex: 1 1 100%;
        justify-content: space-between;
    }

    .case-search-form {
        flex: 1 1 auto;
        min-width: 150px;
    }
}

/* ===========================================
   Responsive: Medium Screens (769px - 1199px)
   =========================================== */

@media (min-width: 769px) and (max-width: 1199px) {
    /* Smaller button text on medium screens */
    .case-filter-buttons .btn-group .btn {
        font-size: 0.85rem;
        padding: 0.45rem 0.6rem;
    }
}

/* ===========================================
   Responsive: Large Screens (1200px+)
   =========================================== */

@media (min-width: 1200px) {
    /* Full size buttons on large screens */
    .case-filter-buttons .btn-group .btn {
        font-size: 0.9rem;
        padding: 0.5rem 0.85rem;
    }
}

