/* PIASOmarkerDB Custom Styles */
/* Version 2.0 - Updated for PostgreSQL release */

/* ============================================
   Navbar / Header Styling
   ============================================ */

/* Custom navbar with light gray background (#F3F3F3) */
.navbar-custom {
    background-color: #F3F3F3 !important;
}

/* Navbar brand styling */
.navbar-brand {
    padding: 0.25rem 0;
    transition: opacity 0.3s ease;
}

.navbar-brand:hover {
    opacity: 0.85;
}

.navbar-brand img {
    max-height: 40px;
    height: auto;
    width: auto;
    transition: transform 0.3s ease;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

/* Ensure proper contrast with light background */
.navbar-custom .navbar-nav .nav-link {
    color: #333333;
    font-weight: 500;
}

.navbar-custom .navbar-nav .nav-link:hover {
    color: #2E6BB2;
}

.navbar-custom .navbar-nav .nav-link.active {
    color: #2E6BB2;
    font-weight: 600;
}

/* Mobile toggle button for light background */
.navbar-custom .navbar-toggler {
    border-color: rgba(0, 0, 0, 0.2);
}

.navbar-custom .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.7%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ============================================
   Logo Responsive Styles
   ============================================ */

/* Ensure logo doesn't get too large on very wide screens */
@media (min-width: 1400px) {
    .navbar-brand img {
        max-height: 45px;
    }
}

/* Adjust logo size for tablets */
@media (max-width: 991px) and (min-width: 768px) {
    .navbar-brand img {
        max-height: 35px;
    }
}

/* Mobile logo adjustments */
@media (max-width: 767px) {
    .navbar-brand img {
        max-height: 32px;
    }
    
    .navbar-brand span {
        font-size: 1.1rem;
    }
}

/* ============================================
   Layout & Spacing
   ============================================ */

body {
    padding-top: 5rem;
}

.footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    text-align: center;
}

main.container {
    margin-bottom: 80px;
}

/* ============================================
   Table Styling
   ============================================ */

/* DataTables search box */
div.dt-search {
    margin-bottom: 0.5rem;
}

/* Study/Publication column width constraint */
.study-column,
.study-cell,
td.study-col,
th.study-col {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Table hover effect */
.table-hover tbody tr:hover {
    background-color: rgba(46, 107, 178, 0.1);
}

/* Truncate long text in cells */
.text-truncate-cell {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   Select2 Styling
   ============================================ */

.select2-container--bootstrap-5 .select2-selection {
    min-height: calc(1.5em + 0.5rem + 2px);
}

/* Exclude filter row styling */
.exclude-filter-row {
    background-color: #f8f9fa;
}

/* ============================================
   Badge Styling
   ============================================ */

.badge {
    font-weight: 500;
}

.badge-score {
    min-width: 60px;
    display: inline-block;
}

/* ============================================
   Card Styling
   ============================================ */

.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Statistics cards */
.stats-card .display-4 {
    font-size: 2.5rem;
}

/* ============================================
   Accordion Styling (FAQ)
   ============================================ */

.accordion-button:not(.collapsed) {
    background-color: rgba(46, 107, 178, 0.1);
    color: #2E6BB2;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(46, 107, 178, 0.25);
}

/* ============================================
   Links & Buttons
   ============================================ */

a {
    color: #2E6BB2;
    text-decoration: none;
}

a:hover {
    color: #1d4a7a;
    text-decoration: underline;
}

/* Primary button styling */
.btn-primary {
    background-color: #2E6BB2;
    border-color: #2E6BB2;
}

.btn-primary:hover {
    background-color: #1d4a7a;
    border-color: #1d4a7a;
}

.btn-outline-primary {
    color: #2E6BB2;
    border-color: #2E6BB2;
}

.btn-outline-primary:hover {
    background-color: #2E6BB2;
    border-color: #2E6BB2;
    color: white;
}

/* ============================================
   Modal Styling
   ============================================ */

.modal-invitation .modal-header {
    background-color: #F3F3F3;
    border-bottom: 2px solid #2E6BB2;
}

.modal-invitation .btn-primary {
    min-width: 120px;
}

/* ============================================
   Loading Indicators
   ============================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner-large {
    width: 3rem;
    height: 3rem;
}

/* ============================================
   API Code Examples
   ============================================ */

pre.api-example {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 1rem;
    overflow-x: auto;
}

code.api-endpoint {
    background-color: #e9ecef;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 576px) {
    .stats-card .display-4 {
        font-size: 1.75rem;
    }
    
    .table-responsive-sm {
        font-size: 0.875rem;
    }
    
    .btn-sm-mobile {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .navbar,
    .footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    body {
        padding-top: 0;
    }
    
    main.container {
        margin-bottom: 0;
    }
}
