/* ============================================
   HEDGEHOG - BCB-SGS Metadata Database Styles
   ============================================ */

/* Prevent horizontal scrolling on small devices */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* ========== Chart Containers ========== */
.series-chart-container {
    height: 500px;
}

.chart-container {
    height: 600px;
}

@media (max-width: 768px) {
    .series-chart-container {
        height: 400px;
    }

    .chart-container {
        height: 450px;
    }

    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    .series-chart-container {
        height: 350px;
    }

    .chart-container {
        height: 400px;
    }
}

/* ========== Content Display ========== */
/* Sticky sidebar on larger screens */
@media (min-width: 992px) {
    .sticky-sidebar {
        position: sticky;
        top: 20px;
    }
}

/* Responsive adjustments for smaller screens */
@media (max-width: 991.98px) {
    .sticky-sidebar {
        margin-top: 1rem;
    }

    .sticky-sidebar .card {
        margin-bottom: 1rem;
    }
}

/* Improved list item hover effect */
.list-group-item-action:hover {
    background-color: #f8f9fa;
    border-left: 3px solid #0d6efd;
}

/* Better scrollbar styling for series list */
.list-group-flush::-webkit-scrollbar {
    width: 8px;
}

.list-group-flush::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.list-group-flush::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.list-group-flush::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Content text formatting */
.conteudo-texto {
    line-height: 1.8;
}

.conteudo-texto h1,
.conteudo-texto h2,
.conteudo-texto h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.conteudo-texto p {
    margin-bottom: 1rem;
}

.conteudo-texto ul,
.conteudo-texto ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.conteudo-texto code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}

.conteudo-texto pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
}

.conteudo-texto blockquote {
    border-left: 4px solid #0d6efd;
    padding-left: 1rem;
    margin-left: 0;
    color: #6c757d;
    font-style: italic;
}

.conteudo-texto img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 1rem 0;
}

.conteudo-texto table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}

.conteudo-texto table th,
.conteudo-texto table td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
}

.conteudo-texto table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* ========== Admin Action Buttons ========== */
.action-btn {
    min-width: 88px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 767.98px) {
    .action-btn {
        min-width: 44px;
        padding-left: .5rem;
        padding-right: .5rem;
    }

    .action-btn span {
        display: none;
    }
}

/* ========== Admin List Items ========== */
.list-group-item {
    transition: background-color 0.2s;
}

.list-group-item:hover {
    background-color: #f8f9fa;
}

#search-results .list-group-item {
    cursor: default;
}

.remove-series,
.remove-panel {
    opacity: 0.7;
}

.remove-series:hover,
.remove-panel:hover {
    opacity: 1;
}

/* ========== Panels List ========== */
.panel-card {
    border-left: 4px solid transparent;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    overflow: hidden;
}

.panel-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(18, 38, 63, 0.08);
    border-left-color: rgba(13,110,253,0.18);
}

.panel-card .panel-icon {
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
}

.panel-card .meta .badge {
    background-color: #f8f9fb;
    border: 1px solid #e9ecef;
}

@media (max-width: 767.98px) {
    .panel-card .card-body {
        flex-direction: column;
        gap: .75rem;
    }
    .panel-card .ms-auto {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }
}

/* Subtle gradient for icon backgrounds to look more modern */
.panel-card .panel-icon.bg-primary {
    background-image: linear-gradient(135deg, #0d6efd 0%, #4f86ff 100%);
}

/* Admin charts: ensure a reasonable height on small screens and avoid clipping */
.admin-chart {
    /* Fixed height helps Chart.js render without growing vertically
       when `maintainAspectRatio: false` is used in chart options. */
    height: 300px;
    max-height: 480px;
    width: 100% !important;
    display: block;
}

@media (max-width: 991.98px) {
    .admin-chart {
        height: 260px;
        max-height: 380px;
    }
}

@media (max-width: 480px) {
    .admin-chart {
        height: 220px;
        max-height: 320px;
    }
}
