/* Custom styles to complement Bootstrap theme */
:root {
    --animation-duration: 0.3s;
}

/* Smooth transitions */
.card, .btn, .form-control, .form-select {
    transition: all var(--animation-duration) ease;
}

/* Card enhancements */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Table enhancements */
.table {
    margin-bottom: 0;
}

.table td input, .table td select {
    border: none;
    background: transparent;
    padding: 0.375rem 0.5rem;
}

.table td input:focus, .table td select:focus {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Effective capacity styling */
.effective-capacity {
    font-size: 0.875rem;
    min-width: 2rem;
    display: inline-block;
}

/* Animation for results */
#output {
    animation: fadeInUp var(--animation-duration) ease;
}

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

/* Error state styling */
.is-invalid {
    border-color: var(--bs-danger) !important;
}

/* Priority badges */
.priority-high { background-color: var(--bs-danger) !important; }
.priority-medium { background-color: var(--bs-warning) !important; }
.priority-low { background-color: var(--bs-success) !important; }

/* Responsive improvements */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .card-header .btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

.what-this-means {
    font-size: 0.7rem;
    color: var(--bs-secondary-color);
    margin-top: 4px;
    margin-bottom: 0;
    line-height: 1.3;
}

.coverage-status-badge {
    font-size: 0.85rem;
    padding: 4px 12px;
    border-radius: 20px;
}

/* Loading state */
.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 1rem;
    height: 1rem;
    top: 50%;
    left: 50%;
    margin-left: -0.5rem;
    margin-top: -0.5rem;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

/* Chart container styling */
#chartsContainer {
    transition: all var(--animation-duration) ease;
}

/* Export button styling */
.btn-group .btn {
    white-space: nowrap;
}

/* Chart responsive styling */
.card canvas {
    max-height: 300px;
}

@media (max-width: 768px) {
    .card canvas {
        max-height: 200px;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-group .btn {
        border-radius: 0.375rem !important;
    }
}

/* Quick Start section */
#quickStartSection {
    transition: opacity 0.4s ease, max-height 0.5s ease, margin 0.4s ease;
    overflow: hidden;
}

#quickStartSection.qs-hiding {
    opacity: 0;
    max-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.quick-start-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: default;
}

.quick-start-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.25) !important;
}

#quickStartReset {
    transition: opacity 0.3s ease;
}

/* Step Progress Indicator */
.step-progress {
    padding: 0 20px;
}
.step-progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
}
.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative;
}
.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    background: var(--bs-secondary-bg);
    color: var(--bs-secondary-color);
    border: 2px solid var(--bs-border-color);
    transition: all 0.3s ease;
}
.step.active .step-circle {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.25);
}
.step.completed .step-circle {
    background: #198754;
    color: white;
    border-color: #198754;
}
.step-label {
    margin-top: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    text-align: center;
    white-space: nowrap;
}
.step.active .step-label {
    color: #0d6efd;
}
.step.completed .step-label {
    color: #198754;
}
.step-line {
    flex: 1;
    height: 3px;
    background: var(--bs-border-color);
    margin: 0 8px;
    margin-bottom: 25px;
    transition: background 0.3s ease;
    max-width: 120px;
}
.step-line.completed {
    background: #198754;
}

/* Collapsible section headers */
.card-header.clickable-header {
    cursor: pointer;
    user-select: none;
}
.card-header.clickable-header:hover {
    opacity: 0.9;
}
.section-summary {
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
    margin-top: 4px;
    font-weight: normal;
}
.section-chevron {
    transition: transform 0.3s ease;
    font-size: 1rem;
}
.section-chevron.collapsed {
    transform: rotate(-90deg);
}

/* Tooltip help icons */
.fa-question-circle[data-bs-toggle="tooltip"] {
    cursor: help;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.fa-question-circle[data-bs-toggle="tooltip"]:hover {
    opacity: 1;
}

/* Mobile responsive for step progress */
@media (max-width: 768px) {
    .step-circle {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    .step-label {
        font-size: 0.65rem;
    }
    .step-line {
        margin-bottom: 20px;
        max-width: 60px;
    }
    .step-progress {
        padding: 0 8px;
    }
}

/* Plan Manager */
#planManagerCard {
    border: 1px solid var(--bs-border-color);
}

#planManagerCard .card-body {
    background: var(--bs-body-bg);
}
