/* Main Styles */
body {
    background-color: #f5f5f5;
}

.chart-container {
    height: 400px;
    width: 100%;
    padding: 20px 0;
    overflow: auto; /* Enable both horizontal and vertical scrolling */
    margin-bottom: 15px;
}

.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 20px;
}

.card-body {
    padding: 1.25rem;
    overflow: hidden;
}

.card-header {
    background-color: #f8f9fa;
}

/* Form styling */
.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Table styling */
.table-sm td {
    padding: 0.3rem;
}

/* Tab styling */
.nav-tabs .nav-link {
    color: #495057;
}

.nav-tabs .nav-link.active {
    color: #007bff;
    font-weight: 500;
}

/* Results section styling */
#results h5 {
    color: #343a40;
    margin-bottom: 15px;
}

/* Loading spinner styling */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Formula details view styling */
#formula-details-view {
    padding: 15px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#formula-details-view .formula-content {
    overflow-x: auto;
    padding: 10px;
    margin: 10px 0;
    background-color: #f8f9fa;
    border-radius: 4px;
}

#formula-details-view .formula-title {
    font-weight: 600;
    color: #343a40;
    margin-bottom: 10px;
}

#formula-details-view .formula-description {
    color: #495057;
    line-height: 1.5;
    margin-bottom: 15px;
}

/* Make plots responsive */
@media (max-width: 768px) {
    .chart-container {
        height: 300px;
    }
    
    /* Improve table responsiveness on mobile */
    .table,
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Adjust card padding on mobile */
    .card-body {
        padding: 1rem;
    }
    
    /* Improve formula details view on mobile */
    #formula-details-view {
        padding: 10px;
    }
    
    #formula-details-view .formula-content {
        padding: 8px;
        font-size: 0.9rem;
    }
    
    /* Improve button spacing on mobile */
    .btn {
        margin-bottom: 0.5rem;
    }
    
    /* Adjust form layout on mobile */
    .form-group {
        margin-bottom: 1rem;
    }
    
    /* Adjust table cell padding on mobile */
    .table td, .table th {
        padding: 0.5rem;
        white-space: nowrap;
    }
}

/* Chart scroll indicator */
.chart-scroll-indicator {
    display: none;
    text-align: center;
    color: #6c757d;
    font-size: 0.8rem;
    margin-bottom: 5px;
}

/* Show scroll indicator only on small screens */
@media (max-width: 768px) {
    .chart-scroll-indicator {
        display: block;
    }
}

#circuit-diagram-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#circuit-diagram {
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.tab-content {
    overflow: hidden;
    margin-top: 15px;
}

.tab-pane {
    width: 100%;
    height: 100%;
}

/* Improve table responsiveness */
.table {
    width: 100%;
    margin-bottom: 1rem;
    background-color: transparent;
}

/* Improve form layout on mobile */
@media (max-width: 768px) {
    .form-label {
        margin-bottom: 0.25rem;
    }
    
    .input-group {
        margin-bottom: 0.5rem;
    }
    
    .form-check {
        margin-bottom: 0.25rem;
    }
}

/* Improve button layout on mobile */
@media (max-width: 768px) {
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        margin-bottom: 0.5rem;
        width: 100%;
    }
}

.formula-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
}
.formula-scroll .katex-display {
    min-width: 400px;
    width: max-content;
}
@media (max-width: 768px) {
    .formula-scroll .katex-display {
        min-width: 300px;
    }
}

.plot-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    text-align: center;
}   