/* 
# Copyright (c) 2025 The SMART Solutions
# All rights reserved.
#
# This file is part of the FIINSY platform.
#
# File Name : 
#
# Author: Thelotham Ravi (Thelotham.ravi@tsstechservices.com)
# Last Updated : Thelotham Ravi (Thelotham.ravi@tsstechservices.com)
# Description:
*/
/* Instrument Search Page Styles */

/* Search box styling */
/* FIINSY Instrument Search Page Styles */

/* Select2 Dropdown */
.select2-container--default .select2-selection--single {
    height: 38px;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px;
    padding-left: 12px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #0d6efd;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    overflow: hidden;
}
canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}
.chart-container {
    position: relative;
    height: auto;
    overflow: hidden;
    padding: 0;
}

/* Add this wrapper to control height and overflow */
.chart-scroll {
    height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Canvas rules */
.chart-scroll canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
}

/* Card Styling */
.card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem;
}
.card-body {
    padding: 1.25rem;
}
@media (max-width: 767.98px) {
    .card-body {
        padding: 1rem;
    }
}

/* Summary Cards */
.border-success {
    border-color: rgba(25, 135, 84, 0.2) !important;
}
.border-danger {
    border-color: rgba(220, 53, 69, 0.2) !important;
}
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
    margin-right: 0.5rem;
}
.badge.bg-light {
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Increase font size for summary cards */
.summary-card {
    font-size: 1.1rem;
}

.summary-card .card-body {
    font-size: 1.25rem;
}

.summary-card .badge {
    font-size: 1rem;
}

.summary-card .text-muted {
    font-size: 0.95rem;
}

/* Loading Overlay */
.loading {
    position: relative;
    min-height: 200px;
}
.loading::after {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.7) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"><circle cx="50" cy="50" fill="none" stroke="%230d6efd" stroke-width="10" r="35" stroke-dasharray="165 57"><animateTransform attributeName="transform" type="rotate" repeatCount="indefinite" dur="1s" values="0 50 50;360 50 50" keyTimes="0;1"/></circle></svg>') center no-repeat;
    background-size: 50px;
    z-index: 1;
}

/* No Data Message */
#noDataMessage {
    color: #6c757d;
}
#noDataMessage i {
    opacity: 0.5;
}

#instrumentTableHead th {
    font-size: 1rem;  /* increase from default */
    padding: 10px 14px;  /* increase padding a bit for readability */
    font-weight: 600;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    text-align: center;
}

#instrumentTableBody td {
    padding: 10px;
    vertical-align: middle;
    font-size: 1rem;
}

.text-success {
    color: #198754 !important;
}
.text-danger {
    color: #dc3545 !important;
}
.text-muted {
    color: #6c757d !important;
}

/* ✅ Enhanced CSS for better table display and horizontal scrolling */

.funds-table {
  font-size: 1rem;
  white-space: nowrap;
  border-collapse: separate;
  border-spacing: 0;
}

.funds-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  padding: 8px 12px;
  border: 1px solid #e9ecef;
  position: sticky;
  top: 0;
  z-index: 10;
}

.funds-table td {
  padding: 6px 12px;
  border: 1px solid #f1f3f4;
  vertical-align: middle;
}

/* ✅ Fixed MF column styling - Higher z-index to prevent overlap */
.funds-table th:first-child,
.funds-table td:first-child {
  position: sticky;
  left: 0;
  background-color: #fff;
  z-index: 20; /* Higher z-index than other headers */
  min-width: 250px;
  max-width: 300px;
  word-wrap: break-word;
  white-space: normal;
  border-right: 1px solid #e9ecef; /* Subtle border to separate from data columns */
}

.funds-table th:first-child {
  z-index: 25; /* Even higher for header */
  background-color: #f8f9fa;
  font-weight: 600;
}

/* ✅ Ensure other headers don't overlap the first column */
.funds-table th:not(:first-child) {
  z-index: 10;
}

/* ✅ Add subtle shadow to first column for better visual separation */
.funds-table th:first-child::after,
.funds-table td:first-child::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1px;
  box-shadow: 1px 0 2px rgba(0,0,0,0.05);
  pointer-events: none;
}

/* ✅ Enhanced horizontal scrolling */
.table-responsive {
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.table-responsive::-webkit-scrollbar {
  height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* ✅ Additional styling for better header appearance */
.funds-table th, .funds-table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    white-space: nowrap;
}

.funds-table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.funds-table td {
    text-align: center;
    border-bottom: 1px solid #f1f3f4;
}

.fund-name-column {
    text-align: left !important;
    font-weight: 500;
}

.table-container {
    overflow-x: auto;
}

.funds-table th[colspan] {
    border-right: 1px solid #e9ecef;
}

/* ✅ Fix for overlapping month headers */
.funds-table thead tr:first-child th:first-child {
    z-index: 30; /* Highest z-index for the main header */
}

.funds-table thead tr:nth-child(2) th:first-child {
    z-index: 25; /* Second highest for subheader */
}

/* ✅ Sortable column styling */
.sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s;
}

.sortable:hover {
  background-color: #e9ecef !important;
}

.sortable i {
  margin-left: 4px;
  font-size: 0.75rem;
}

/* ✅ Chart container improvements */
.chart-container {
  height: 300px;
  position: relative;
}

.chart-scroll {
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}



/* ✅ Loading state */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* ✅ Responsive improvements */
@media (max-width: 768px) {
  .funds-table {
    font-size: 0.75rem;
  }

  .funds-table th,
  .funds-table td {
    font-size: 1rem;  /* increase from default */
    padding: 10px 14px;  /* increase padding a bit for readability */
  }

  .funds-table th:first-child,
  .funds-table td:first-child {
    min-width: 150px;
  }
}

/* ✅ Border enhancements for better column separation */
.border-end {
  border-right: 2px solid #dee2e6 !important;
}

/* ✅ Text alignment utilities */
.text-end {
  text-align: right !important;
}

/* ✅ Color utilities for positive/negative values */
.text-success {
  color: #198754 !important;
}

.text-danger {
  color: #dc3545 !important;
}

.text-muted {
  color: #6c757d !important;
}

.scroll-button {
    position: absolute;
    z-index: 10;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #ccc;
    padding: 8px 10px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.scroll-left {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.scroll-right {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
}

.scroll-up {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-down {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-button i {
    font-size: 1rem;
    color: #333;
}

/* Navy blue badge */
.bg-navy {
    background-color: #193c65 !important;
    color: #fff !important;
}

/* Force navy default */
.btn-outline-navy,
.btn-outline-navy:focus,
.btn-outline-navy:active,
.btn-outline-navy.active,
.show > .btn-outline-navy.dropdown-toggle {
    color: #193c65 !important;
    background-color: #fff !important;
    border-color: #193c65 !important;
}

/* Orange ONLY on hover and focus/press, not sticky */
.btn-outline-navy:hover,
.btn-outline-navy:focus-visible {
    color: #fff !important;
    background-color: #EF7F1A !important;
    border-color: #EF7F1A !important;
}

.custom-blue-linkbold,
.custom-blue-linkbold:visited,
.custom-blue-linkbold:active {
    color: #1E3C6F !important;
    font-weight: 500 !important;   /* Medium bold, not as heavy as bold */
    text-decoration: none !important;
    transition: color 0.18s;
}

.custom-blue-linkbold:hover,
.custom-blue-linkbold:focus {
    color: #EF7F1A !important;
    text-decoration: none !important;
}

.sorted-col {
    background-color: #dfe9f8 !important;
}

/*Download Progress Bar*/
.btn-download-report {
    position: relative;
    overflow: hidden;
    min-width: 180px;
    justify-content: center;
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
}

.btn-download-report:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
}

.btn-download-report.downloading {
    cursor: not-allowed;
    pointer-events: none;
}

.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    width: 0%;
    transition: width 0.3s ease;
    z-index: 1;
}

.btn-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-text {
    font-size: 12px;
}

/* Table structure */
table.table-borderless {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    color: #333;
}

/* Header row */
.table-borderless thead th {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    background-color: #f8f9fa;
    padding: 12px 16px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Data rows */
.table-borderless tbody td {
    font-size: 15px;
    font-weight: bold;
    padding: 14px 16px;
    text-align: center;
    color: #111;
}

/* Optional: responsive or hover effect */
.table-borderless tbody tr:hover {
    background-color: #f2f2f2;
    transition: background-color 0.3s;
}

.blur-container {
  position: relative;
  width: 100%;
  /* remove any fixed min-height here if it’s throwing things off */
}

/* never blur by default */
.blur-wrapper {
  filter: none !important;
  opacity: 1 !important;
  transition: filter .2s, opacity .2s;
}

/* when “locked” is on the container, blur it */
.blur-container.locked .blur-wrapper {
  filter: blur(6px) !important;
  opacity: 0.5 !important;
  pointer-events: none !important;
  user-select: none !important;
  
}

/* the overlay sits on top, but is hidden by default */
.blur-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: none;                /* start hidden */
  z-index: 10;
  background: rgba(255,255,255,0.9);
  /* center everything inside */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
}

/* show it only when “locked” */
.blur-container.locked .blur-overlay {
  display: flex !important;
}

.lock-icon {
  font-size: 2.5rem;
  color: #193c65;
  margin-bottom: 10px;
}

.lock-text {
  font-weight: bold;
  color: #193c65;
  font-size: 1.1rem;
}

.form-label[for="instrumentSearch"] {
  /*font-weight: bold;*/
  color: #000;
}
