:root {
    --primary-color: #9E1B32;
    --secondary-color: #0d0c1d;
    --tertiary-color: #ffffff;
    --accent-color: #ffffff;
    --text-color: #000000;
    --background-color: #828a8f9d;
    --border-color: #9E1B32;
    --user-text-color: #0d0c1d;
    --user-bubble-color: #ffffff;
    --ai-bubble-color: #9E1B32;
    --ai-text-color: #ffffff;
    --button-color: var(--primary-color);
    --dashboard-box-color: var(--tertiary-color);
    --dashboard-text-color: #FF003F;
}


body, html {
    height: 100%;
    margin: 0;
    padding: 0;
    padding-bottom: 50px; /* Space for fixed footer */
    font-family: 'Roboto', sans-serif;
    background-color: #ffffff;
}

h2 {
    margin-top: 10px;
    margin-bottom: 10px;
    padding-top: 0px;
    padding-bottom: 0px;
}

footer {
    margin-top: auto;
}

.carebot-header {
    display: flex;
    position: sticky;
    flex-direction: row;
    align-items: center;
    background-color: var(--primary-color);
    color: white;
    padding: 10px 0px;
    font-size: xx-large;
    width: 100%;
    border-bottom: 1px solid rgba(0,0,0,0.3);
    box-shadow: 0px 0px 20px 5px rgba(0, 0, 0, 0.5);
    top: 0;
    z-index: 10000;
}

.carebot-header a {
    position: absolute;
    margin: 0 20px;
    color: white;
    text-decoration: none;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);

}

.carebot-header a.left {
    left: 0px;

}

.carebot-header a.right {
    right: 0px;

}

.header-tools {
    position: absolute;
    right: 84px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10050;
}

.gear-label {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    transition: opacity 0.18s ease, width 0.18s ease, margin 0.18s ease;
}

.header-tools.panel-open .gear-label {
    opacity: 0;
    width: 0;
    margin: 0;
    overflow: hidden;
}

.gear-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.gear-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tts-gear-panel {
    position: absolute;
    right: calc(100% + 6px);
    top: 50%;
    transform: translate(10px, -50%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.22s ease, opacity 0.22s ease;
    background: rgba(255, 255, 255, 0.96);
    color: #222;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    padding: 6px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    width: clamp(150px, 14vw, 180px);
    max-width: calc(100vw - 100px);
    overflow: hidden;
}

.tts-gear-panel.open {
    transform: translate(0, -50%);
    opacity: 1;
    pointer-events: auto;
}

.carebot-header h1 {
    margin: 0;
    text-align: center;
    width: 100%;
    color: white;
    text-decoration: none;
    font-size: larger;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.3);

}

.caregiver-connect {
    color: white;
    position: absolute;
    box-shadow: 0px -3px 5px rgba(0, 0, 0, 0.5);
}

.carebot-header a:hover {
    color: #242729;
}

/*from .popup to @webFrame FadeIn is styling for the popup message used to alert users on why we use their location
 /* Popup container - can be anything you want */
 /* .popup {
    position: relative;
    height: 7%;
    width: 18%;
    display: inline-block;
    cursor: pointer;
    font-size: larger;
    user-select: none;
    border-radius: 20px;
    margin-top: 7%;
    margin-left: 10%;
    -webkit-animation: fadeIn 3s;
    animation: fadeIn 3s;
  }

  .popup:hover {
      background-color: #6bc1f0;
  }

  /* .popup::before {
    content: "";
    position: absolute;
    top: 100%;
    right: 50%;
    margin-bottom: -5px;
    border-width: 10px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
  }
  
  /* The actual popup 
  .popup .popuptext {
    visibility: hidden;
    width: 250px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 12%;
    font-size: larger;
    /* margin-left: 10%; 
  }
  
  /* Popup arrow
  .popup .popuptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
  }
  
  /* Toggle this class - hide and show the popup 
  .popup .show {
      visibility: visible;
      -webkit-animation: fadeIn 1s;
      animation: fadeIn 1s;
  }
  
  /* Add animation (fade in the popup) 
  @-webkit-keyframes fadeIn {
    from {opacity: 0;} 
    to {opacity: 1;}
  }
  
  @keyframes fadeIn {
    from {opacity: 0;}
    to {opacity:1 ;}
  } */


.carebot-footer {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 0px;
    min-width: 100vw;
    text-align: center;
    font-size: 12pt;
    box-shadow: 0px -3px 5px rgba(0, 0, 0, 0.5);
    position: fixed; 
    bottom: 0; 
    left: 0; 
    z-index: 1000;
}

.carebot-footer a {
    color: white;
    text-decoration: none;
}

.carebot-footer a:hover {
    color: #242729;
}

/* Chat page styles */
#chatbot-container {
    height: 100vh;
    width: 100vw; 
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#chatbot-container header {
    margin-top: 0;
    z-index: 0;
}

#chat-messages {
    display: flex;
    flex-direction: column;
    font-size: large;
    gap: 10px;
    /* Ensure that the chat pane can scroll down when feedback, etc. cover messages */
    padding-bottom: 400px;
}

.user-message {
    align-self: flex-end;
    background-color: var(--user-bubble-color);
    color: var(--user-text-color);
    margin-bottom: 15px;
    padding: 10px;
    padding-top: 3px;
    padding-bottom: 3px;
    border-radius: 15px;
    margin-left: 10%;
    margin-right: 4%;
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.5), -3px -3px 5px rgba(255, 255, 255, 0.2);
}

.ai-message {
    position: relative;
    align-self: flex-start;
    background-color: var(--ai-bubble-color);
    color: var(--ai-text-color);
    margin-bottom: 15px;
    padding: 10px;
    padding-top: 3px;
    padding-bottom: 3px;
    border-radius: 15px;
    margin-left: 4%;
    margin-right: 10%;
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.5), -3px -3px 5px rgba(255, 255, 255, 0.2);
}

.latest-response-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.response-action-btn {
    border: 1px solid rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 999px;
    font-size: 0.82rem;
    padding: 4px 10px;
    cursor: pointer;
}

.response-action-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

.system-message {
    align-self: center;
    align-items: center;
    background-color: var(--border-color);
    color: var(--ai-text-color);
    margin-bottom: 15px;
    padding: 10px;
    padding-top: 3px;
    padding-bottom: 3px;
    border-radius: 15px;
}

textarea {
    height: 50px;
    resize: none;
    overflow-y: auto;
}

#chat-form {
    width: 100%;
    margin: 0;
    padding: 0;
}

.form-group {
    display: flex;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    background-color: var(--primary-color);
    /* border-top: 1px solid #ccc; */
    box-shadow: 0px 3px 20px 5px rgba(0, 0, 0, 0.5);
}

textarea.form-control {
    height: 35px;
    max-height: 15vh;
    width: 95%; 
    text-align: left;
    font-size: x-large;
    resize: none;   /* Disable manual resizing */
    overflow-y: scroll; /* Enable vertical scrollbar when needed */
    font-family: 'Roboto', sans-serif;
    flex-grow: 1;
    margin-right: 10px;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: calc(min(0.5vw, 10px));
}

.btn-send {
    padding: 10px 20px;
    border-radius: 20px;
    background-color: var(--user-bubble-color);
    color: var(--user-text-color);
    font-size: x-large;
    cursor: pointer;
    margin-left: 10px;
}

.btn-send:hover {
    /* background-color: var(--border-color); */
    background-color: var(--background-color);
    color: black;
}

.btn-send.suggested-message {
    padding: 15px 20px;
    font-size: 20px;
}

#chat-panel {
    position: relative;
    height: 100vh;
    flex: 1;

    display: flex;
    flex-direction: column;
}

#chat-messages-wrapper {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 2vw;
    margin-bottom: 200px;
}

#bottom-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;

    position: fixed;
    width: 100%;
    bottom: 0;
    pointer-events: none;
}

#bottom-panel * {
    pointer-events: auto;
}

/* Feedback section */
.feedback {
    align-self: flex-start;
    background-color: var(--ai-bubble-color);
    color: var(--ai-text-color);
    margin-left: 4%;
    margin-right: 10%;
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 15px;
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.5), -3px -3px 5px rgba(255, 255, 255, 0.2);
}

.chat-controls .feedback {
    margin: 0 0 8px 0;
}

.feedback-prompt {
    margin: 0 0 8px 0;
    font-size: 0.95em;
}

.feedback-buttons {
    justify-content: center;
    display: flex;
    gap: 12px;
}

.feedback-btn {
    background: none;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    padding: 6px 14px;
    font-size: 1.4em;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, transform 0.15s;
}

.feedback-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.7);
    transform: scale(1.1);
}

.feedback-btn.selected {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: #ffffff;
    transform: scale(1.1);
}

.feedback-comment {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feedback-comment textarea {
    width: 100%;
    height: auto;
    padding: 8px 12px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--ai-text-color);
    font-family: 'Roboto', sans-serif;
    font-size: 0.9em;
    resize: none;
    box-sizing: border-box;
}

.feedback-comment textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.feedback-submit {
    align-self: flex-end;
    padding: 6px 20px;
    border: none;
    border-radius: 10px;
    background-color: var(--user-bubble-color);
    color: var(--user-text-color);
    font-family: 'Roboto', sans-serif;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.15s;
}

.feedback-submit:hover {
    background-color: var(--background-color);
    color: black;
    transform: scale(1.05);
}

.feedback-thanks {
    margin: 8px 0 0 0;
    font-size: 0.9em;
    font-style: italic;
    opacity: 0.85;
}

.location-modal {
    background-color: var(--primary-color);
    color: #ffffff;
    display: none;
    max-width: 350px;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    font-family: sans-serif;
    text-align: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
}

.modal-overlay {
    display: none;
    position: fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background: rgba(0,0,0,0.4);
    z-index: 9999;
}

.suggested-messages {
    overflow-x: auto;
    overflow-y: hidden;
    min-height: 55px;
    padding-bottom: 5px;
    padding-top: 0px;
}

.chat-controls-container {
    flex: 0 1 auto;
    margin-left: auto;
    width: auto;

    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: flex-end;
    margin-bottom: 0.5em;
    margin-right: 2em;
}

.chat-controls {
    flex: 0 0 auto;
    margin-left: auto;
    width: auto;
    margin-right: 2em;

    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.feedback-row {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    padding-right: 2em;
}

.tts-controls-row {
    display: flex;
    align-items: center;
    gap: 0.5em;
    white-space: nowrap;
}

.tts-gear-panel .tts-controls-row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 0.4em;
    font-size: 0.75em;
    max-width: 100%;
    white-space: nowrap;
}

.mic-btn {
    background: #eee;
    border: 1px solid #9E1B32;
    color: #9E1B32;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95em;
    cursor: pointer;
}

.tts-toggle {
    display: flex;
    align-items: center;
    gap: 0.3em;
    font-size: 0.82em;
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tts-toggle input {
    margin: 0;
}

.tts-rate-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45em;
    margin-top: 5px;
}

.tts-rate-label {
    font-size: 0.74em;
    color: #333;
}

.tts-rate-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tts-rate-value {
    display: inline-block;
    min-width: 42px;
    text-align: center;
    font-weight: 600;
    font-size: 0.8em;
    color: #222;
}

.tts-rate-btn {
    background: #eee;
    border: 1px solid #9E1B32;
    color: #9E1B32;
    border-radius: 8px;
    width: 20px;
    height: 20px;
    padding: 0;
    line-height: 1;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 700;
}

.tts-gear-panel .tts-toggle {
    color: #222;
}

.tts-rate-slider {
    width: 100%;
    max-width: 100%;
    vertical-align: middle;
}

/* Generic button styles */
.link-button {
    padding: 10px 20px;
    min-width: 250px;
    text-align: center;
    margin: 0px 5px;
    border-radius: 10px;
    background-color: var(--button-color);
    color: white;
    font-size: x-large;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.5), -3px -3px 5px rgba(255, 255, 255, 0.2);
}

.link-button:hover {
    background-color: var(--primary-color);
    transform: scale(1.15);
}

/* Homepage styles */
.home-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100vw;
    background-color: #ffffff;
    overflow: hidden;
    padding-top: 8vh;
    padding-bottom: 8vh;
}

.home-container p {
    color: var(--text-color);
    /* margin: 15px; */
    padding-left: 50px;
    padding-right: 50px;
    font-size: 18pt;
    text-align: center;
    padding-bottom: 1px;
}

.home-container h1 {
    text-align: center;
    font-size: xx-large;
}

/* Lays out buttons in 1 or 2 columns based on screen width */
.adjusting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
    gap: 10px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.adjusting-grid :nth-last-child(1):nth-child(odd) {
    grid-column: 1 / -1; /* Makes the item span all columns */
}

@media (min-width: 725px) {
    .adjusting-grid {
        grid-template-columns: repeat(2, 1fr); /* Creates a 2x2 grid */
    }
}

/* Just a section that separates some stuff */
#section {
    padding: 10px;
    text-align: center;
    justify-content: center;
    align-content: center;
}

/* Message loading dots */
.dot {
    display: inline-block;
    width: 15px; 
    height: 15px;
    border-radius: 50%; 
    background-color: var(--user-bubble-color);
    margin: 0 5px; 
}
  
/* Animation for the bouncing effect */
@keyframes bounce {
    0%, 100% {
        transform: translateY(6px);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-6px); 
        opacity: 0.4;
    }
}
/* To hopefully work on safari and such */
@-webkit-keyframes bounce {
    0%, 100% {
        -webkit-transform: translateY(6px);
        opacity: 0.8;
    }
    50% {
        -webkit-transform: translateY(-6px); 
        opacity: 0.4;
    }
}

.dot:nth-child(1), .dot:nth-child(2), .dot:nth-child(3) {
    animation: bounce 1.2s infinite;
    animation-fill-mode: both; /* Ensure smooth start and end */
}

.dot:nth-child(1) {
animation-delay: 0.2s;
}
  
.dot:nth-child(2) {
    animation-delay: 0.4s;
}
  
.dot:nth-child(3) {
    animation-delay: 0.6s;
}
  
.chat-bubble {
    position: relative;
    background-color: #f5f5f5;
    border-radius: 16px;
    padding: 10px 20px;
    color: #333;
    display: inline-block;
    max-width: 200px;
}
  
/* Cute 'lil picture */
.elderly-person-bubble::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 0;
    border: 15px solid transparent;
    border-top-color: #f5f5f5;
    border-bottom: 0;
    margin-left: -15px;
    margin-bottom: -15px;
}
  
.computer-bubble::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    width: 0;
    height: 0;
    border: 15px solid transparent;
    border-top-color: #f5f5f5;
    border-bottom: 0;
    margin-right: -15px;
    margin-bottom: -15px;
}

#owl-image {
    width: 250px;
    margin-top: 20px;
}

/* Testing stuff with box shadows */
.box {
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.3), -3px -3px 5px rgba(255, 255, 255, 0.5);
}

.home-icon {
    filter: invert(100%) brightness(200%) contrast(200%);
    height: 40px;
}

.team-member {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px;
    width: 200px; 
}

#about-me-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding-top: 1px; 
}

/* Dashboard styles */

.dashboard-title {
    padding: 10px 0;
    margin: 0;
}

#heatmap {
    height: calc(100% - 40px);
    width: calc(100% - 40px);
    border-radius: 10px;
    margin: 20px;
    box-shadow: var(--box-shadow);
}
@media (max-width: 600px) {
    .header-tools {
        right: 68px;
    }

    .tts-gear-panel {
        width: min(52vw, 170px);
        max-width: calc(100vw - 84px);
        right: calc(100% + 4px);
        top: 50%;
    }

    .gear-label {
        font-size: 0.78rem;
    }
}

#data-table {
}
  
  #resources-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
  }
  
  #resources-table, #resources-table th, #resources-table td {
    border: 1px solid #ddd;
  }
  
  #resources-table th, #resources-table td {
    padding: 8px;
    text-align: left;
  }
  
.dashboard-box {
    background-color: var(--tertiary-color);
    padding: 20px;
    margin: 10px;
    border-radius: 15px;
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.5), -3px -3px 5px rgba(255, 255, 255, 0.2);
    min-height: 300px;
}

.dashboard-box > .dashboard-box-header {
    color: var(--dashboard-text-color);
    text-align: center;
    font-size: x-large;
    margin: 0px;
}

.dashboard-canvas {
    position: relative;
    height: 97%;
    width: 100%;
    min-height: 250px;
}

#chart-container {
    height: 140vh;
    width: 100vw;
    padding-bottom: 50px;
    background-color: var(--background-color);
    overflow: auto;            
    box-sizing: border-box;

    display: grid;
    grid-template-areas:
        "header header header header"
        "heatmap heatmap heatmap table"
        "history history analysis analysis";
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-template-rows: auto 1fr 1fr;
    grid-gap: 5px;
}

#heatmap-div { grid-area: heatmap;}
#feedback-ratio-div { grid-area: ratio; }
#feedback-analysis-div {
    grid-area: analysis;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: auto;
}

#feedback-analysis-div canvas {
    flex: 1 1 0;
    min-height: 0;
}
#feedback-history-div { grid-area: history; }
#feedback-counties-div { grid-area: counties; }
#data-table { grid-area: table; }

#chart-container > h1 {
    grid-area: header;
    grid-column: 1 / -1;
    margin-top: 0;
}
