/* Custom styles for Biomedical Research Platform */

/* General */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Icons spacing */
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }

/* Cards */
.card {
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 16px rgba(10,10,10,.1);
}

/* Tags */
.tag {
    font-weight: 500;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

/* Dashboard stats */
.title.has-text-success { color: #48c774; }
.title.has-text-warning { color: #ffdd57; }
.title.has-text-danger { color: #f14668; }
.title.has-text-info { color: #3298dc; }
.title.has-text-primary { color: #00d1b2; }

/* Entity badges */
.entity-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25em 0.75em;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Search highlights */
.search-highlight {
    background-color: #fffacd;
    padding: 0 2px;
}

/* Loading spinner */
.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Confidence score colors */
.confidence-high { color: #48c774; }
.confidence-medium { color: #ffdd57; }
.confidence-low { color: #f14668; }

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .hero-body {
        padding: 1.5rem;
    }

    .card-content {
        padding: 1rem;
    }
}

/* Disease Search Specific */
.disease-search-box {
    transition: all 0.3s ease;
}

.disease-search-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(10,10,10,.15);
}

.disease-result-card {
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.disease-result-card:hover {
    border-left-color: #00d1b2;
    transform: translateX(4px);
}

/* Fix per sovrapposizioni testo */
.title, .subtitle {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Neutralizza il margin-top negativo di Bulma su .title + .subtitle */
.title:not(.is-spaced) + .subtitle {
    margin-top: 0 !important;
}

/* Fix sovrapposizione nei level-item */
.level-item .title {
    margin-bottom: 0.5rem !important;
}

.level-item .heading + .title {
    margin-top: 0.25rem;
}

/* Fix specifico per la sezione risultati */
.search-results-header {
    display: block;
    clear: both;
}

.search-results-header .title {
    position: relative;
    z-index: 1;
    float: none !important;
    display: block !important;
}

.search-results-header .subtitle {
    position: relative;
    z-index: 1;
    margin-top: 0 !important;
    float: none !important;
    display: block !important;
    padding-top: 0.5rem;
}

/* Assicura che le colonne abbiano spazio sufficiente */
.columns.is-vcentered {
    align-items: flex-start !important;
}

.columns.is-vcentered .column {
    min-height: auto;
}

/* Assicura spacing corretto su mobile */
@media screen and (max-width: 768px) {
    .title {
        font-size: 1.5rem !important;
    }

    .subtitle {
        font-size: 0.875rem !important;
    }

    .is-flex-wrap-wrap > * {
        margin-bottom: 0.5rem;
    }

    .columns.is-vcentered {
        flex-direction: column !important;
        display: block !important;
    }

    .columns.is-vcentered .column {
        width: 100% !important;
        display: block !important;
        margin-bottom: 1rem;
    }

    .search-results-header {
        margin-bottom: 1.5rem !important;
    }

    .search-results-header .title {
        margin-bottom: 0.75rem !important;
    }

    .search-results-header .subtitle {
        margin-top: 0.5rem !important;
        display: block !important;
    }
}

/* Previene sovrapposizioni nei tag */
.tags {
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    margin-right: 0 !important;
    margin-bottom: 0 !important;
    white-space: nowrap;
}

/* Media query per migliorare il comportamento */
.media-content {
    overflow: hidden;
}

.media-content .title,
.media-content .subtitle {
    overflow-wrap: break-word;
    word-break: break-word;
}

.is-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

details summary {
    cursor: pointer;
    user-select: none;
}

details summary:hover {
    color: #00d1b2;
}

.tag.is-info a {
    color: inherit;
    text-decoration: none;
}

.tag.is-info a:hover {
    text-decoration: underline;
}

/* Print styles */
@media print {
    .navbar, .footer, .button, .pagination {
        display: none !important;
    }

    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}