/* Beers Criteria Tool Styles */
#beers-criteria-tool-container {
    border: 1px solid #ccc;
    padding: 15px;
    margin-bottom: 20px;
    background-color: #f9f9f9;
    font-family: sans-serif;
}

/* Tabs */
.beers-tabs-nav {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
    border-bottom: 1px solid #71BFA9;
    display: flex;
    flex-wrap: wrap;
}

.beers-tabs-nav li {
    margin: 0 5px -1px 0; /* Overlap bottom border */
}

.beers-tabs-nav a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    background-color: #71BFA9;
    border: 1px solid #ccc;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    color: #000;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.beers-tabs-nav a:hover {
    background-color: #ddd;
}

.beers-tabs-nav a.active {
    background-color: #f9f9f9; /* Match container background */
    border-bottom: 1px solid #f9f9f9; /* Hide bottom border */
    font-weight: bold;
}

.beers-tab-pane {
    display: none; /* Hide all panes initially */
    padding: 15px;
    border: 1px solid #ccc;
    border-top: none;
}

.beers-tab-pane.active {
    display: block; /* Show active pane */
}

/* Forms and Buttons */
.beers-search-form,
.beers-calculator-form {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

#beers-criteria-tool-container input[type="text"],
#beers-criteria-tool-container select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    min-width: 200px; /* Adjust as needed */
}

#beers-criteria-tool-container button {
    padding: 8px 15px;
    background-color: #71BFA9; /* WP Blue */
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#beers-criteria-tool-container button:hover {
    background-color: #71BFA9;
}

/* Results and Lists */
.beers-results-area {
    margin-top: 15px;
    padding: 10px;
    border: 1px dashed #ddd;
    background-color: #fff;
}

.beers-loading {
    font-style: italic;
    color: #666;
}

#beers-anticholinergic-list ul,
#beers-anticholinergic-reference-list ul {
    list-style: disc;
    margin-left: 20px;
    max-height: 200px; /* Limit height for reference list */
    overflow-y: auto; /* Add scrollbar */
    border: 1px solid #eee;
    padding: 10px;
    background: #fff;
}
#beers-anticholinergic-list ul li,
#beers-anticholinergic-reference-list ul li {
    margin-bottom: 5px;
    display: flex; /* For remove button */
    justify-content: space-between;
    align-items: center;
}

#beers-anticholinergic-list .remove-drug-btn {
    background-color: #dc3232;
    color: white;
    font-size: 0.8em;
    padding: 2px 5px;
    border-radius: 3px;
    cursor: pointer;
    margin-left: 10px;
}

#beers-anticholinergic-total-score {
    margin-top: 10px;
    font-size: 1.1em;
}

/* Tables */
.beers-table-filter {
    margin-bottom: 10px;
}
.beers-filter-input {
    width: 100%;
    max-width: 400px; /* Limit width */
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
}


.beers-table-wrapper {
    max-height: 600px; /* Limit table height */
    overflow: auto;   /* Add scrollbars */
    border: 1px solid #ccc;
}

.beers-criteria-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9em;
    background-color: #fff;
}

.beers-criteria-table th,
.beers-criteria-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    vertical-align: top;
}

.beers-criteria-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.beers-criteria-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.beers-criteria-table td ul {
    margin: 0;
    padding-left: 15px;
}
.beers-criteria-table td ul li {
     margin-bottom: 3px;
}

.beers-search-results-table mark {
    background-color: #71BFA9; /* Yellow highlight */
    padding: 0.1em;
}

.beers-search-result-group {
    margin-bottom: 20px;
    border-bottom: 1px dotted #ccc;
    padding-bottom: 15px;
}
.beers-search-result-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}


/* Hidden rows for filtering */
.beers-criteria-table tbody tr.hidden-row {
    display: none;
}
#beers-anticholinergic-reference-list ul li.hidden-item {
    display: none;
}

/* Mobile optimizations (não altera desktop) */
@media (max-width: 850px) {
    #beers-criteria-tool-container {
        padding: 12px;
    }

    .beers-tabs-nav {
        gap: 6px;
        margin-bottom: 10px;
    }
    .beers-tabs-nav li {
        margin: 0;
    }
    .beers-tabs-nav a {
        padding: 8px 10px;
        font-size: 0.85rem;
        border-radius: 8px;
    }

    .beers-tab-pane {
        padding: 10px;
    }

    .beers-search-form,
    .beers-calculator-form {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    #beers-criteria-tool-container input[type="text"],
    #beers-criteria-tool-container select {
        min-width: 0;
        width: 100%;
    }

    #beers-criteria-tool-container button,
    #beers-drug-search-button,
    #beers-add-anticholinergic-drug {
        width: 100%;
    }

    #beers-anticholinergic-list ul,
    #beers-anticholinergic-reference-list ul {
        max-height: 240px;
    }

    .beers-table-wrapper {
        max-height: none;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .beers-criteria-table {
        font-size: 0.85em;
        min-width: 720px; /* força scroll horizontal */
    }

    .beers-criteria-table th,
    .beers-criteria-table td {
        padding: 6px;
    }
}
