/* styles.css - Professional Shiny App Styling */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;500;600;700&family=Roboto+Mono:wght@300;400;500;600&display=swap');

/* CSS Custom Properties for easy theming */
:root {
  --primary-color: #0FADA4;
  --dark-navy: #0C1521;
  --accent-teal: #14C4B8;
  --complementary-orange: #FF6B35;
  --light-grey: #F8F9FA;
  --medium-grey: #6C757D;
  --dark-grey: #343A40;
  --white: #FFFFFF;
  --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --shadow-md: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --border-radius: 0.375rem;
  --transition: all 0.3s ease;
}

/* Global Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography Enhancements */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Lato', sans-serif;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.brand-text {
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  color: var(--primary-color);
}

code, pre {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.9em;
}

/* Shiny-specific Improvements */
.shiny-output-error {
  color: #DC3545;
  font-weight: 500;
  background-color: rgba(220, 53, 69, 0.1);
  padding: 0.75rem;
  border-radius: var(--border-radius);
  border-left: 4px solid #DC3545;
  margin: 1rem 0;
}

.shiny-output-error:before {
  content: "⚠️ ";
  font-weight: bold;
}

/* Loading Indicators */
.shiny-spinner-output-container {
  position: relative;
}

.shiny-spinner-output-container .load-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
}

/* Enhanced Cards */
.card {
  border: none;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
}

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

.card-header {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-teal));
  color: white;
  font-weight: 600;
  border-bottom: none;
  padding: 1rem 1.25rem;
}

.card-header h4,
.card-header h5 {
  margin: 0;
  color: white;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  background-color: var(--light-grey);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1rem 1.25rem;
}

/* Enhanced Buttons */
.btn {
  font-weight: 500;
  border-radius: var(--border-radius);
  transition: var(--transition);
  border: none;
  padding: 0.5rem 1.5rem;
  font-size: 0.9rem;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-teal));
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-teal), var(--primary-color));
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline-primary {
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--medium-grey);
  color: white;
}

.btn-secondary:hover {
  background: var(--dark-grey);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Enhanced Form Controls */
.form-control,
.form-select {
  border-radius: var(--border-radius);
  border: 2px solid var(--light-grey);
  padding: 0.75rem;
  font-size: 0.95rem;
  transition: var(--transition);
  background-color: var(--white);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(15, 173, 164, 0.25);
  outline: none;
}

.form-label {
  font-weight: 600;
  color: var(--dark-navy);
  margin-bottom: 0.5rem;
}

/* Enhanced Form Controls */
.form-control,
.form-select {
  border-radius: var(--border-radius);
  border: 2px solid var(--light-grey);
  padding: 0.75rem;
  font-size: 0.95rem;
  transition: var(--transition);
  background-color: var(--dark-navy);
  color: var(--white);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(15, 173, 164, 0.25);
  outline: none;
}

.form-select:hover {
  background-color: var(--accent-teal);
}

/* Enhanced Tables */
.table {
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table thead th {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-teal));
  color: white;
  font-weight: 600;
  border: none;
  padding: 1rem;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.table tbody tr {
  transition: var(--transition);
}

.table tbody tr:hover {
  background-color: rgba(15, 173, 164, 0.05);
  transform: scale(1.01);
}

.table td {
  padding: 1rem;
  vertical-align: middle;
  border-color: var(--light-grey);
}

/* DataTable Enhancements */
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  color: var(--dark-navy);
  font-weight: 500;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 0.5rem 1rem;
  margin: 0 0.25rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--light-grey);
  color: var(--primary-color);
  background: white;
  transition: var(--transition);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Sidebar Enhancements */
.sidebar {
  background: var(--light-grey);
  border-right: 1px solid rgba(0, 0, 0, 0.05);
  min-height: 100vh;
  padding: 1.5rem;
}

.sidebar .form-group {
  margin-bottom: 1.5rem;
}

.sidebar .well {
  background: var(--white);
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
}

/* Sidebar Label Styling - Make headings white */
.sidebar .control-label,
.sidebar .form-label,
.sidebar label {
  color: var(--white) !important;
  font-weight: 600 !important;
  margin-bottom: 0.5rem !important;
}

/* Target slider labels specifically */
.form-group .control-label {
  color: var(--white) !important;
}

/* Target all labels in form groups */
.form-group label {
  color: var(--white) !important;
}

/* Also target any h tags in sidebar */
.sidebar h1,
.sidebar h2,
.sidebar h3,
.sidebar h4,
.sidebar h5,
.sidebar h6 {
  color: var(--white) !important;
}

/* Navigation Enhancements */
.navbar {
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar-brand {
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  color: var(--primary-color) !important;
  font-size: 1.5rem;
}

.nav-link {
  font-weight: 500;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--primary-color) !important;
  transform: translateY(-1px);
}

/* Tab Enhancements */
.nav-tabs {
  border-bottom: 2px solid var(--light-grey);
}

.nav-tabs .nav-link {
  border: none;
  background: transparent;
  color: var(--medium-grey);
  font-weight: 500;
  padding: 1rem 1.5rem;
  margin-right: 0.5rem;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  transition: var(--transition);
}

.nav-tabs .nav-link:hover {
  background: var(--light-grey);
  color: var(--dark-navy) !important;
  border-color: transparent;
}

.nav-tabs .nav-link.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

/* Progress Bar Enhancements */
.progress {
  height: 0.75rem;
  border-radius: var(--border-radius);
  background: var(--light-grey);
  overflow: hidden;
  box-shadow: inset 0 0 0.2rem rgba(0, 0, 0, 0.1);
}

.progress-bar {
  background: linear-gradient(90deg, var(--primary-color), var(--accent-teal));
  transition: width 0.6s ease;
}

/* Alert Enhancements */
.alert {
  border: none;
  border-radius: var(--border-radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid;
  font-weight: 500;
}

.alert-success {
  background: rgba(40, 167, 69, 0.1);
  color: #28A745;
  border-left-color: #28A745;
}

.alert-info {
  background: rgba(15, 173, 164, 0.1);
  color: var(--primary-color);
  border-left-color: var(--primary-color);
}

.alert-warning {
  background: rgba(255, 193, 7, 0.1);
  color: #FFC107;
  border-left-color: #FFC107;
}

.alert-danger {
  background: rgba(220, 53, 69, 0.1);
  color: #DC3545;
  border-left-color: #DC3545;
}

/* Slider Input Styling - Complete Override */
/* Slider Input Styling - IRS v2 Compatible */
.irs {
  font-family: 'Lato', sans-serif;
}

.irs.irs--shiny .irs-line {
  background: var(--light-grey) !important;
  border: none;
  height: 3px;
  border-radius: 0px;
  top: 31px !important;
}

.irs.irs--shiny .irs-bar {
  background: linear-gradient(90deg, var(--primary-color), var(--accent-teal));
  border: none;
  height: 6px;
  top: 31px; 
}

.irs--shiny .irs-handle {
  background: var(--white);
  border: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.irs--shiny .irs-handle:hover,
.irs--shiny .irs-handle.state_hover {
  background: var(--primary-color);
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

.irs--shiny .irs-from,
.irs--shiny .irs-to,
.irs--shiny .irs-single {
  background: var(--primary-color);
  color: white;
  border-radius: var(--border-radius);
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.irs--shiny .irs-from:before,
.irs--shiny .irs-to:before,
.irs--shiny .irs-single:before {
  border-top-color: var(--primary-color);
}

.irs--shiny .irs-min,
.irs--shiny .irs-max {
  color: var(--medium-grey);
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--light-grey);
  border-radius: var(--border-radius);
  padding: 0.25rem 0.5rem;
}

.irs--shiny .irs-grid-text {
  color: var(--medium-grey);
  font-size: 0.75rem;
  font-weight: 500;
}



/* Pagination and other controls */
.reactable .rt-pagination,
.reactable .rt-page-info,
.reactable .rt-page-size {
  color: white !important;
}

.reactable select {
  background-color: white !important;
  color: #333 !important;
  border: 1px solid #495057 !important;
}

/* Athlete Summary Styles */
.athlete-summary-label {
  font-weight: bold !important;
  font-size: 1.1em !important;
  margin-right: 4px;
  display: inline-block;
}