/* static/css/browse.css */

/* General Page Styles */
#browse-section {
    max-width: 950px;
    margin: 2rem auto;
    padding: 1.5rem;
    background-color: #e0dcc2; 
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    font-family: Arial, sans-serif;
}

#browse-section h2 {
    text-align: center;
    color: #092407; 
    margin-bottom: 1.5rem;
}

/* Category Selector */
.category-selector {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.category-btn {
    padding: 12px 28px;
    font-size: 1.1em; 
    cursor: pointer;
    border: 2px solid #081405; 
    background-color: #fff;
    color: #062b0b; 
    border-radius: 25px; 
    transition: all 0.3s ease; 
    font-weight: 500;
}

.category-btn:hover {
    background-color: #132e04; 
    color: #fff;
    transform: translateY(-3px) scale(1.03); 
    box-shadow: 0 6px 12px rgba(52, 152, 219, 0.3); 
}

.category-btn.active {
    background-color:#132e04; 
    color: #fff;
    border-color:#081405; 
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(18, 133, 69, 0.4); 
}

/* Results Area */
#results-area {
    margin-top: 25px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #fff;
}

#results-area.hidden {
    display: none;
}

/* Results Header Controls (Title + Top Pagination) */
#results-header-controls {
    display: flex;
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 15px;
    flex-wrap: wrap; 
}

#results-header-controls #results-title {
    color: #444;
    font-size: 1.4em;
    margin: 0; 
    flex-grow: 1; 
}

/* Table Styles */
#table-placeholder {
    overflow-x: auto; 
}

#table-placeholder table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px; 
    font-size: 0.9em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    border-radius: 6px; 
    overflow: hidden; 
}
#table-placeholder td a {
    color: #193116; /* Your dark green color from h2, or choose another */
    text-decoration: none; /* Removes the default underline */
    font-weight: 500; /* Optional: make them slightly bolder if desired */
    text-decoration: underline;
}

#table-placeholder td a:hover {
    color: #4a7a33; /* Your darker green from category button hover, or another hover color */
    text-decoration: underline; /* Adds underline on hover for better affordance */
}

#table-placeholder th,
#table-placeholder td {
    border: 1px solid #bbb; 
    padding: 12px 15px;   
    text-align: left;
    vertical-align: top; 
}

#table-placeholder th {
    background-color: #e8e8e8; 
    font-weight: 600;
    color: #333; 
    position: relative;
    border-bottom-width: 2px;
    border-bottom-color: #aaa; 
}

/* Styles for table header with search input */
#table-placeholder th.th-with-search {
    vertical-align: top; 
}

#table-placeholder th.th-with-search span { 
    display: block; 
    margin-bottom: 4px; 
    font-weight: 600; 
}
#table-placeholder th input.header-search-input { 
    width: calc(100% - 10px); 
    padding: 4px 6px;
    border: 1px solid #ccc;     
    border-radius: 4px;        
    font-size: 0.9em;          
    box-sizing: border-box;    
}

/* Specific width for phytochemical and formulation search bars */
#table-placeholder th input#phytochemical-name-search,
#table-placeholder th input#formulation-name-search {
    width: 150px; /* Or your desired smaller width */
}


#table-placeholder th input.header-search-input:focus { 
    outline: none;
    border-color: #102206; 
    box-shadow: 0 0 0 0.2rem rgba(13, 59, 1, 0.25); 
}

#table-placeholder tr:nth-child(even) {
    background-color: #f5f5f5; 
}

#table-placeholder tr:hover {
    background-color: #e9e9e9; 
    color: #000;
}

#table-placeholder p { 
    color: #666;
    font-style: italic;
    padding: 15px;
    text-align: center;
}

/* Pagination Controls Containers */
.pagination-controls-container {
    margin-top: 25px; 
    display: flex;
    flex-direction: column; 
    align-items: center; 
    gap: 10px;
}
#pagination-controls-placeholder-top {
    margin-top: 0; 
    align-items: flex-end; 
    min-width: 250px; 
}

/* Pagination UL and LI styles */
.pagination {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 0; 
}

.page-item .page-link {
    display: inline-block;
    padding: 8px 14px;
    text-decoration: none;
    color: #0a4d0a; 
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, color 0.15s ease-in-out;
    cursor: pointer;
    font-size: 0.9em;
    line-height: 1.5; 
}

.page-item.active .page-link {
    z-index: 3; 
    color: #fff; 
    background-color: #6c757d;
    border-color: #6c757d;   
    pointer-events: none;   
}

.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.page-item:not(.disabled) .page-link:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #14580e; 
}

.page-item.disabled span.page-link {
    background-color: transparent; 
    border-color: transparent;
    color: #495057; 
    padding-left: 5px; 
    padding-right: 5px;
}

.pagination-info {
    font-size: 0.9em;
    color: #555;
    text-align: center;
    margin-top: 5px; 
}

#pagination-controls-placeholder-top .pagination-info {
    display: none !important; 
}

.visually-hidden { 
    position: absolute; 
    width: 1px; 
    height: 1px; 
    margin: -1px; 
    padding: 0; 
    overflow: hidden; 
    clip: rect(0, 0, 0, 0); 
    border: 0; 
}