html,
body {
    margin: 0;
    height: 100%;
    overscroll-behavior: none;
}

html {
    background-color: #608860;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    
    padding-top: env(safe-area-inset-top); /* iOS-specific "safe area" for safari*/
}

nav {
    height: 60px;

    display: flex;
    justify-content: space-around;
    align-items: center;

    background: #608860;
}

main {
    flex: 1;
    overflow-y: auto;
    background: #9be09b;
}

fieldset {
    background-color: #8cc98c;
    border: 4px dotted #384c38;
    margin: 2px;
}

legend {
    background-color: #caefc8;
    border: 2px solid #384c38;
    font-weight: 1000;
    font-size: large;
}

button {
    min-height: 44px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 0;
    padding: 12px 20px;
    background-color: #608860;;
    color: white;
    cursor: pointer;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
button:active {
    transform: scale(0.97);
}  
button:hover {    
    background-color: #567956;
}
button:active {
    background-color: #436043;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="file"]
{
    padding: 12px 20px;
}

.page {
    display: flex;
    flex-direction: column;
    
    min-height: 100%;
    padding: 16px;

    box-sizing: border-box;
    gap: 16px;
}
.stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.grow {
    flex: 1
}
.center {
    display: flex;
    justify-content: center;
    align-items: center;
}
.fill {
    display: flex;
    flex: 1;
    width: 100%;
    height: 100%;

}

.daily-form {
    display: flex;
    flex-direction: column;
    flex: 1;
}
#daily-fieldset {
    display: flex;
    flex-direction: column;
}

#symptom-inputs {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#daily-note {
    resize: none;
}

.nav-button {
    display: flex;
    flex: 3;
    height: 100%;
    justify-content: center;
    align-items: center;
    
    border: 0;
    border-radius: 0;

    background-color: #608860;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}
.nav-button:hover {    
    background-color: #567956;
}
.nav-button:active {    
    background-color: #436043;
}

.symptom-row {
    display: flex;
}
.symptom-label {
    flex-direction: row;
    flex: 2
}
.symptom-input {
    display: flex;
    flex-direction: row;
}

button[type="submit"] {
    align-self: stretch;
    justify-content: center;
    align-content: center;
    text-align: center;
    padding: 12px 20px;
    font-size: 1.5rem;
}



/* Calendar heat map */
.calendar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;

    width: fit-content;
    margin: 0 auto;
}

.month-header{
    display: flex;
    flex-direction: row;
    gap: 1rem;
    justify-content: center;
}
.month-label {
    text-align: center;
}
.month-btn{
    min-height: 22px;
    font-size: 0.8rem;
    padding: 6px 10px;
}


.grid {
    display: grid;

    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}
.weekday {
    text-align: center;
    font-size: 0.8rem;
    color: #000;
}
.day {
    width: 36px;
    height: 36px;

    border-radius: 4px;
    
    background: #ebedeb;

    transition: background-color 150ms;

    line-height: 36px;
    text-align: center;
}
.day:hover {
    outline: 3px solid white;
}

.day-details {
    position: fixed;

    left: 0;
    right: 0;
    bottom: 0;

    max-height: 70vh;
    overflow-y: auto;

    padding: 1.5rem;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    background-color: white;
    border-radius: 20px 20px 0 0;

    transform: translateY(100%);
    transition: transform 250ms ease-out;
}
.day-details.visible {
    transform: translateY(0);
}

.backdrop {
    display: none;
    position: fixed;
    inset: 0;

    background: rgba(0, 0, 0, 0.3);
}
.backdrop.visible {
    display: block;
}


/* Prevent text selection */
.no-select {
    -webkit-touch-callout: none; /* iOS Safari */
      -webkit-user-select: none; /* Safari */
       -khtml-user-select: none; /* Konqueror HTML */
         -moz-user-select: none; /* Old versions of Firefox */
          -ms-user-select: none; /* Internet Explorer/Edge */
              user-select: none; /* Non-prefixed version, currently
                                    supported by Chrome, Edge, Opera and Firefox */
}
.text-select {
    -webkit-touch-callout: text;
      -webkit-user-select: text;
       -khtml-user-select: text;
         -moz-user-select: text;
          -ms-user-select: text;
              user-select: text;
}
.all-select {
    -webkit-touch-callout: all;
      -webkit-user-select: all;
       -khtml-user-select: all;
         -moz-user-select: all;
          -ms-user-select: all;
              user-select: all;
}

.version-tag {
    position: fixed;

    left: 0;
    right: 0;
    bottom: 1rem;

    text-align: center;
    justify-content: center;
    color: #aaa;
}