/**
 * Theme Name:     Exploring Equities (TTF)
 * Author:         Patrick Frece
 * Template:       twentytwentyfive
 * Text Domain:	   exploring-equities-ttf
 * Description:    Child theme of Twenty Twenty-Five for Exploring Equities
 */

 /* ==============================================
   Child Theme Styles - Exploring Equities
   ============================================== */

   /* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400&display=swap');

:root {
    --background_primary: #fbfaf6;
    --background_secondary: #e6e2d6;
    --background_header_footer: #343a404d;
    --background_header_footer_secondary: #343a40;
    --font_primary: #3c3c3c;
    --accent_1: #78c2ad;
    --accent_2: #0c2d48;
    --accent_3: #189ab4;
    --accent_4: #ff7851;
    --font-size-base: 16px;
}

/* Ensure html and body take full height */
html, body {
    height: 100%;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: var(--font-size-base) !important;
    font-weight: 400;
}

/* New wrapper to control overall layout */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;  /* Ensure it spans the full viewport height */
}

/* Let header and footer size naturally */
.site-wrapper > .wp-block-template-part {
    flex: 0 0 auto;
}

/* Make the main content expand to fill available space */
.screeners-container {
    flex: 1 0 auto;
    width: 90%;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Optional: Force the footer to the bottom */
.site-wrapper > footer.wp-block-template-part {
    margin-top: auto;
}

.wp-footer-navigation {
    display: flex;
    justify-content: flex-end; /* Pushes navigation columns to the right */
    gap: 20px; /* Adjust spacing between columns if necessary */
}

/* Access Restricted */
.access-restricted {
    text-align: center;
    padding: 4rem 1rem;
}
.restricted-content {
    max-width: 600px;
    margin: 0 auto;
}

/* Main Content */
.screener-heading {
    text-align: center;
    margin-bottom: 3rem;
}

/* Content Wrapper as Flex */
.screener-content-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

/* Sticky Filters */
.screener-filters {
    width: 300px;
    position: sticky;
    top: 0;
    background: var(--background_secondary);
    padding: 15px;
    z-index: 10;
    border: 1px solid var(--font_primary);
}

.screener-table-container {
    flex: 1;
    overflow-x: auto;
    width: 100%;
}

/** Filter **/
.filter-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 5px;
}

.filter-group label {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

.select2-container {
    width: 100% !important; /* Ensures it fills the parent container */
}

.select2-selection {
    padding: 6px;
    border: 1px solid var(--accent_4);
    border-radius: 4px;
    background: var(--background_secondary);
}

.select2-selection__choice {
    background: var(--accent_1) !important;
    color: var(--font_primary) !important;
    border-radius: 4px;
    padding: 3px 6px;
}

.select2-selection__choice__remove {
    padding: 0px 0px !important;
    margin-left: 0px !important;
    bottom: 0px !important;
}

.select2-selection__choice__display {
    padding: 15px 0px
}

.select2-container .select2-search--inline .select2-search__field {
    height: 20px !important;
    font-size: 80% !important;
    margin-top: 7px !important;
}

.select2-selection__choice__remove {
    color: var(--font_primary) !important;
    margin-left: 5px;
}

/* Data Table */
.screener-data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--background_primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.screener-data-table th,
.screener-data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border: 1px solid var(--font_primary);
}

.screener-data-table th {
    background: var(--background_secondary);
    color: var(--font_primary);
    font-weight: 600;
}

/* Spinner Overlay */
#spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    place-items: center;
    z-index: 9999;
}

.spinner-content {
    text-align: center;
    font-size: 1.2rem;
    color: var(--accent_2);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .screener-content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .screener-filters {
        position: sticky;
        top: 120px;
        z-index: 100;
    }
}

@media (max-width: 768px) {
    .screener-data-table {
        display: block;
        overflow-x: auto;
    }
}

/** Header in table templates **/
/* Make the header sticky */
.wp-block-template-part {
    position: sticky;
    top: 0;
    z-index: 999; /* Ensure it stays on top of other elements */
}

header.wp-block-template-part {
    position: sticky;
    top: 0;
    z-index: 999;
}

header.wp-block-template-part {
    background-color: var(--background_header_footer_secondary);
}

/** AqMul Button**/
.button-filter {
    border-color: var(--accent_1);
    border: 3px solid var(--accent_1);
    border-radius: 5px;
    padding-top: var(--wp--preset--spacing--20);
    padding-right: 0;
    padding-bottom: var(--wp--preset--spacing--20);
    padding-left: 0;
    background-color: var(--background_header_footer_secondary);
    color: var(--accent_1)
}

.button-filter.active {
    border: 3px solid var(--accent_4); /* Border for active button */
    color: var(--accent_4)
}

.button-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px; /* Adjust spacing as needed */
}

/* Example styles for sorted header cells */
#aquirers-multiple-table thead th.sort-asc::after {
    content: ' ▲';
}
#aquirers-multiple-table thead th.sort-desc::after {
    content: ' ▼';
}

.text-center {
    text-align: center !important;
}

.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.sort-icon {
    margin-left: 5px;
    font-size: 12px;
    opacity: 0.6;
}


/* Modal container */
#chart-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    display: none; /* Initially hidden */
  }
  
  /* Modal content */
  #chart-modal .modal-content {
    background-color: var(--font_primary) !important;
    margin: 60px auto !important; /* moves the modal down */
    padding: 20px !important;
    border: 1px solid #888 !important;
    width: 90% !important;
    max-width: 90% !important;
    min-width: 800px;
    height: 100%;
    box-sizing: border-box;
    overflow: auto;
    position: relative !important;
  }
  
  /* Close button styling */
  #chart-modal .close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    z-index: 1100;
  }
  
  /* Chart container: add top padding for the modebar and ensure scroll if content is too tall */
  #chart-container {
    width: 100%;
    height: 100%;
    min-height: 800px;
    padding-top: 30px;
    box-sizing: border-box;
  }
  
/* Ensure Login/Logout link matches other menu items */
.wp-block-navigation-item a {
    font-size: inherit; /* Matches other menu items */
    text-decoration: none; /* Removes underline */
    color: inherit; /* Uses the same text color */
    padding: 10px 15px; /* Matches spacing of other items */
}

/* Hover effect: Change color instead of underlining */
.wp-block-navigation-item a:hover {
    color: var(--wp--preset--color--primary, var(--accent_4)); /* Adjust based on your theme */
    background: transparent;
    text-decoration: none;
}
 