/* ************************************************************************** */
/*  style.css                                                                 */
/*  For a simple catalog browser for the OHDSI GIS extension                  */
/*  Tim Norris <tnorris@miami.edu>                                            */
/*  contributions by claude running gpt-oss:20b with ollama                   */
/* ************************************************************************** */

/* -------------------------------------------------------------------------- */
/*  Root variables                                                            */
/* -------------------------------------------------------------------------- */

:root {
  --primary: #0066cc;
  --primary-dark: #005bb5;
  --bg: #f9f9f9;
  --card-bg: #fff;
  --card-shadow: 0 2px 8px rgba(0,0,0,0.1);
  --font-base: 16px;
  --spacing: 0.5rem;
  --small-circle: 10px;
  --large-circle: 23px; 
}

/* -------------------------------------------------------------------------- */
/*  Global styles                                                             */
/* -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: system-ui, sans-serif;
  font-size: var(--font-base);
  line-height: 1.5;
}

body {
  margin: 0;
  background: var(--bg);
  color: #333;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 1em; /* var(--spacing); */
  /* margin: 1em; */
}

/* -------------------------------------------------------------------------- */
/*  Header                                                                    */
/* -------------------------------------------------------------------------- */

header {
  margin-bottom: var(--spacing);
}

h1 {
  font-size: 2rem;
  margin: 0;
  color: var(--primary);
}

/* -------------------------------------------------------------------------- */
/*  Search box                                                                */
/* -------------------------------------------------------------------------- */

#bannerWrapper {
  padding: 0.5em;
}

input[type="text"] {
  width: 100%;
  max-width: 600px;
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
}

/* -------------------------------------------------------------------------- */
/*  Settings button                                                           */
/* -------------------------------------------------------------------------- */

.settings-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1050; /* above other elements */
  border-radius: 50%;
  padding: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* -------------------------------------------------------------------------- */
/*  Settings modal                                                            */
/* -------------------------------------------------------------------------- */

.ui-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
}
.ui-modal.hidden { display: none; }

.ui-modal-content {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  width: 90%;
}
.settings-content {
  max-width: 400px;
}

/* -------------------------------------------------------------------------- */
/*  progress modal                                                            */
/* -------------------------------------------------------------------------- */

.progress-content {
  max-width: 800px;
  height: 80%;
  max-height: 500px;
}
.progress-steps {
  max-height: 80%;
  overflow-y: auto; 
  margin-bottom: 1em;
}
.ui-modal-content h2 {
  margin-top: 0;
}
.ui-modal-content form {
  display: flex;
  flex-direction: column;
}
.ui-modal-content label {
  margin-bottom: 0.5rem;
}
.ui-modal-content input[type="url"] {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-bottom: 1rem;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.progress-content {
  font-size: 1rem; 
}
.progress-success {
  font-weight: 800;
  font-size: 1.1em;
  color: #007700;
}
.progress-fail {
  color: #770000;
}

/* -------------------------------------------------------------------------- */
/*  Flex layout – left filter pane, right results pane                        */
/* -------------------------------------------------------------------------- */

#searchWrapper {
  display: flex;
  flex: 1;
  gap: var(--spacing);
  min-height: 0; /* allow children to shrink */
}

#filterPane {
  flex: 0 0 300px; /* fixed width for the filter column */
  overflow-y: auto;
  /* background: #fff; */
  border-radius: 6px;
  padding: var(--spacing);
  /* box-shadow: var(--card-shadow); */
  max-height: 85vh;
  /* keep the header sticky so it stays visible */
  display: flex;
  flex-direction: column;
}

#filterPane header {
  margin-bottom: var(--spacing);
}

#filterPane .accordion {
  flex: 1;
  overflow-y: auto;
}

#filterPane .accordion-item {
  margin: 3px 0px;
}

.filter-pills {
  height: 2.25em;
}

/* -------------------------------------------------------------------------- */
/*  Results pane – scrollable area                                            */
/* -------------------------------------------------------------------------- */

#resultsPane {
  flex: 1;
  overflow-y: auto;
  padding: 0.25em 0.5em;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

#resultsContainer {
  flex: 1;
  overflow-y: auto;
}

/* -------------------------------------------------------------------------- */
/*  Results grid                                                              */
/* -------------------------------------------------------------------------- */

#results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--spacing);
}

#results li {
  list-style: none;
}

#results a {
  text-decoration: none;
  color: inherit;
}

/* -------------------------------------------------------------------------- */
/*  Card                                                                      */
/* -------------------------------------------------------------------------- */

.card {
  background: var(--card-bg);
  border-radius: 6px;
  box-shadow: var(--card-shadow);
  padding: var(--spacing);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.2s;
}

.card:hover {
  transform: translateY(-4px);
}

.card h2 {
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
  color: var(--primary);
}

.card p {
  flex-grow: 1;
  margin: 0;
  color: #555;
}

/* -------------------------------------------------------------------------- */
/*  Detail pages                                                              */
/* -------------------------------------------------------------------------- */

.detail-title {
  margin-bottom: 0em;
}

.detail-element {
  margin-top: 0.3em;
}

.wrapScroll {
  white-space: nowrap;
  overflow-x: auto;
  /* border: 1px solid grey; */
  /* border-radius: 4px; */
}

.back-link {
  display: inline-block;
  margin-bottom: var(--spacing);
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

.custom-tooltip {
  --bs-tooltip-bg: var(--bg);
  --bs-tooltip-color: #000000;
  --bs-tooltip-font-size: 1rem;
  --bs-tooltip-border-radius: 4px;
  --bs-tooltip-max-width: 350px; 
  --bs-tooltip-opacity: 1;
}

.custom-tooltip .tooltip-inner {
  min-width: 280px; 
  padding: 0.8em;
  background-color: var(--bg);
  border: 1px solid #444444;
}

.custom-tooltip .tooltip-arrow {
  display: none !important;
}

/* -------------------------------------------------------------------------- */
/*  Interface response for loading and searching                              */
/* -------------------------------------------------------------------------- */

.highlight-term {
  background-color: #ffc;
}
.circle {
  position: relative;
  border-radius: 100%;
  display: inline-block;
}
.small-circle {
  width: 10px;
  height: 10px;
  border-radius: 5px 5px 5px 5px;
  margin-left: 5px;
  margin-top: 5px;
}
.large-circle {
  width: 24px;
  height: 24px;
  border-radius: 12px 12px 12px 12px;
  margin-left: 12px;
  margin-top: 12px;
}
.green-fill {
  background: green;
}
.red-fill {                                          
  background: red;
  cursor: pointer;
}

/* -------------------------------------------------------------------------- */
/*  yin-yang spinner                                                          */
/* -------------------------------------------------------------------------- */

.yin-yang {
  box-sizing: border-box;
	position:relative;
	border-style:solid;
	background:#fff;
	border-radius: 100%;
  -webkit-animation:spin 4s linear infinite;
  -moz-animation:spin 4s linear infinite;
  animation:spin 4s linear infinite;
}
.yin-yang:before,
.yin-yang:after {
	content:"";
	position:absolute;
	top:50%;
	border-radius: 100%;
  box-sizing: content-box;
}
.yin-yang:before {
	background:white;
	left:0;
}
.yin-yang:after {
	left:50%;
}

.yin-yang-large {
  border-color:rgb(152, 152, 152);
  margin-right: 42px;
	width:42px;
	height:42px;
	border-width:2px 2px 22px 2px;
}
.yin-yang-large:before,
.yin-yang-large:after {
	width:5px;
	height:5px;
}
.yin-yang-large:before {
	border:7px solid rgb(152, 152, 152);
}
.yin-yang-large:after {
  background:rgb(152, 152, 152);
	border:7px solid white;
}

.yin-yang-small {
  border-color:rgb(255, 0, 0);
  margin-top: 5px;
  margin-left: 5px;
  display: inline-block;
	width:10px;
	height:10px;
	border-width:1px 1px 4px 1px;
}
.yin-yang-small:before,
.yin-yang-small:after {
	width: 1.25px;
	height:1.25px;
}
.yin-yang-small:before {
	border:1.35px solid rgb(255, 0, 0);
}
.yin-yang-small:after {
	background:rgb(255, 0, 0);
	border:1.35px solid white;
}

@-moz-keyframes spin { 100% { -moz-transform: rotate(360deg); } }
@-webkit-keyframes spin { 100% { -webkit-transform: rotate(360deg); } }
@keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } }

/* -------------------------------------------------------------------------- */
/*  Responsive adjustments                                                    */
/* -------------------------------------------------------------------------- */

@media (max-width: 768px) {
  #searchWrapper {
    flex-direction: column;
  }

  #filterPane {
    flex: 0 0 auto;
    width: 100%;
    max-height: 250px; /* keep the filter pane collapsed on small screens */
  }
}