/*
The primary stylesheet for Oolith. This sheet pulls in all the components in order of appearance.
*/
@import url('css/normalize.css');
@import url('css/accessibility.css');
@import url('css/custom-properties.css');
@import url('css/custom-media.css');
@import url('css/global.css');
@import url('css/typography.css');
@import url('css/elements.css');
@import url('css/layout.css');
@import url('css/masthead.css');
@import url('css/navigation.css');
@import url('css/images.css');
@import url('css/content.css');
@import url('css/datatables.css');
@import url('css/tabs.css');
@import url('css/footer.css');
@import url('css/print.css');
@import url('css/accordion.css');
@import url('css/search.css');
@import url('css/loading.css');
@import url('css/mobile.css');

/*
Enhanced Stylesheet for xQTL NIAGADS Portal
Modern, clean, and professional design for scientific data presentation
*/

/* ============================================
   MODERN ENHANCEMENTS
   ============================================ */

:root {
  /* Enhanced Color Palette */
  --primary-blue: #2563eb;
  --primary-blue-dark: #1e40af;
  --primary-blue-light: #3b82f6;
  --accent-purple: #7c3aed;
  --accent-teal: #0d9488;
  --background-light: #f8fafc;
  --background-white: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Enhanced Body and Global Styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-primary);
  background-color: var(--background-light);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Enhanced Header/Masthead */
header,
.masthead {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  box-shadow: var(--shadow-md);
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  /*z-index: 1000;*/
  z-index: 5;
  backdrop-filter: blur(10px);
}

header h1,
.masthead h1 {
  color: white !important;
  font-weight: 700;
  font-size: 1.875rem;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  -webkit-text-fill-color: white !important;
  background: none !important;
  background-clip: unset !important;
  -webkit-background-clip: unset !important;
}

header p,
.masthead p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  margin-top: 0.5rem;
}

/* Enhanced Navigation */
nav,
.navigation {
  background: transparent;
  box-shadow: none;
  border-bottom: none;
}

nav ul,
.navigation ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

nav li,
.navigation li {
  margin: 0;
}

nav a,
.navigation a {
  display: block;
  padding: 0.75rem 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  position: relative;
  background: transparent;
}

nav a:hover,
.navigation a:hover,
nav a:focus,
.navigation a:focus {
  color: white;
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

nav a.active,
.navigation a.active {
  color: white;
  background-color: rgba(255, 255, 255, 0.2);
  font-weight: 600;
}

/* Enhanced Main Content Area */
main,
.content {
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* Enhanced Cards and Sections */
section,
.card,
.content-block {
  background: var(--background-white);
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

section:hover,
.card:hover,
.content-block:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Enhanced Headings */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 0;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 2rem;
  color: var(--primary-blue-dark);
  border-bottom: 3px solid var(--primary-blue-light);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

/* Special case: h2 inside blue header sections */
header h2,
.masthead h2,
section[style*="background"] h2,
div[style*="background: blue"] h2,
div[style*="background: #"] h2 {
  color: white;
  border-bottom: 3px solid rgba(255, 255, 255, 0.3);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

h3 {
  font-size: 1.5rem;
  color: var(--text-primary);
}

/* Special case: h3 inside blue header sections or white backgrounds */
header h3,
.masthead h3,
section[style*="background"] h3,
div[style*="background: blue"] h3,
div[style*="background: #"] h3 {
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Ensure h3 on white/light backgrounds are dark */
main h3,
.content h3,
section h3,
.card h3 {
  color: var(--text-primary);
  text-shadow: none;
}

/* Enhanced Buttons and Links */
button,
.button,
a.button,
input[type="submit"],
input[type="button"] {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--primary-blue);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

button:hover,
.button:hover,
a.button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  background: var(--primary-blue-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

button:active,
.button:active,
a.button:active {
  transform: translateY(0);
}

/* Secondary Button Style */
button.secondary,
.button.secondary {
  background: white;
  color: var(--primary-blue);
  border: 2px solid var(--primary-blue);
}

button.secondary:hover,
.button.secondary:hover {
  background: var(--primary-blue);
  color: white;
}

/* Enhanced Forms */
input[type="text"],
input[type="email"],
input[type="search"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s ease;
  background: white;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Enhanced Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

thead {
  background: var(--gradient-primary);
}

thead th {
  color: white;
  font-weight: 600;
  text-align: left;
  padding: 1rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s ease;
}

tbody tr:hover {
  background-color: var(--background-light);
}

tbody td {
  padding: 1rem;
  color: var(--text-primary);
}

tbody tr:last-child {
  border-bottom: none;
}

/* Enhanced Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-sm);
}

figure {
  margin: 2rem 0;
  text-align: center;
}

figcaption {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 0.75rem;
  font-style: italic;
}

/* Enhanced Lists */
ul, ol {
  padding-left: 1.5rem;
  margin: 1rem 0;
}

li {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* Data Visualization Container */
.data-viz,
.plot-container,
.chart-container {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
  margin: 2rem 0;
  border: 1px solid var(--border-color);
}

/* Enhanced Footer */
footer {
  background: var(--text-primary);
  color: white;
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

footer a {
  color: #93c5fd;
  text-decoration: none;
  transition: color 0.2s ease;
}

footer a:hover {
  color: white;
  text-decoration: underline;
}

footer p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
}

/* Badges and Tags */
.badge,
.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--primary-blue-light);
  color: white;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0.25rem;
}

/* Alert/Notice Boxes */
.alert,
.notice,
.info-box {
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  margin: 1.5rem 0;
  border-left: 4px solid;
}

.alert.info,
.info-box {
  background: #eff6ff;
  border-color: var(--primary-blue);
  color: var(--primary-blue-dark);
}

.alert.success {
  background: #f0fdf4;
  border-color: #10b981;
  color: #065f46;
}

.alert.warning {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}

.alert.error {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
}

/* Search Bar Enhancement */
.search-container {
  position: relative;
  max-width: 600px;
  margin: 2rem auto;
}

.search-container input[type="search"] {
  padding-left: 3rem;
  padding-right: 1rem;
}

.search-container::before {
  content: "🔍";
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  pointer-events: none;
}

/* Loading States */
.loading {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(37, 99, 235, 0.3);
  border-top-color: var(--primary-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  nav ul,
  .navigation ul {
    flex-direction: column;
    gap: 0;
  }
  
  section,
  .card,
  .content-block {
    padding: 1.5rem;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  
  table {
    font-size: 0.875rem;
  }
  
  thead th,
  tbody td {
    padding: 0.75rem 0.5rem;
  }
}

/* Accessibility Enhancements */
:focus-visible {
  outline: 3px solid var(--primary-blue);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  header,
  nav,
  footer {
    display: none;
  }
  
  body {
    background: white;
  }
  
  section,
  .card {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
}

 @media print {
        /* Hide print button when printing */
        button[onclick*="print"],
        .no-print {
            display: none !important;
        }

        /* Ensure colors print correctly */
        body {
            -webkit-print-color-adjust: exact;
            print-color-adjust: exact;
        }

        /* Prevent page breaks in tables/images */
        table, img {
            page-break-inside: avoid !important;
        }

        /* Add page breaks where you want them */
        .page-break {
            page-break-after: always;
        }
 }

.table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        margin: 20px 0;
				min-width: 0;  /* <— important when used inside flex */
				scroll-snap-type: x mandatory;
}
    
.table-responsive table {
        /*min-width: 600px;*/ /* Ensures table doesn't collapse too much */
        /*width: 100%;*/
				width: max-content;
        min-width: 100%;
				scroll-snap-align: start;
}
    
    /* Make tables more readable on mobile */
@media (max-width: 768px) {
        .table-responsive {
            border: 1px solid #ddd;
            border-radius: 4px;
        }
        
        table {
            font-size: 14px;
        }
        
        th, td {
            padding: 8px 6px !important;
            white-space: nowrap;
        }
   }
