@import "variables.css";
@import "utils.css";
@import "admin.css";

/* Reset CSS */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* base font */
html {
    font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica, helvetica neue, ubuntu, roboto, noto, segoe ui, arial, sans-serif;
    font-size: var(--mm-rem);
    color: var(--mm-primary);
}

/* fix overlapping borders */
main {
    padding: 1px;
}

button {
    font-weight: bold;
    transition: box-shadow 1s;
    padding: 0;
    margin: 0;
}

/* fluid behaviour for images */
img {
    max-width: 100%;
    height: auto;
}

/* top header section */
.top-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 1rem 1rem;
}

.top-section > * {
    flex-grow: 1;
}

.greeting-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 1rem;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    font-size: 1.8rem;
}

.top-bar > img {
    height: 4rem;
}

/* call to action section */
.call-to-action {
    max-width: 100%;
    height: 10rem;
    margin: 2rem 1rem;
    background-color: var(--mm-light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
}

.call-to-action > button, .submit-btn {
    height: 3rem;
    padding: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 90%;
    text-transform: uppercase;
    font-size: 1.4rem;
    color: white;
    border: none;
    background-color: var(--mm-primary-light);
}

.submit-btn {
    flex-grow: 1;
    color: var(--mm-light-gray);
}

.submit-btn:not(:disabled) {
    background-color: var(--mm-primary);
    color: white;
}

/********* Seizures form ********/
form {
    margin: 1rem;
    padding: 0 1rem;
}

.radio-group {
    margin: 0.5rem 0;
}

.input-group-label {
    display: inline-block;
    margin-bottom: 1rem;
}

.horizontal-form-inputs-container {
    display: flex;
    flex-flow: row wrap;
    align-items: start;
    justify-content: space-between;
    margin-top: 1rem;
}

.meter-inputs-container {
    display: flex;
    flex-flow: column nowrap;
}

.vertical-form-input {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
}

.vertical-form-input input[type="radio"] {
    display: none;
}

.vertical-form-input input[type="radio"]+label {
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 50%;
    height: 2.5rem;
    width: 2.5rem;
    box-shadow: 0 0 7px 0 rgba(0, 0, 0, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.vertical-form-input.feedback-question input[type="radio"]+label {
    border-radius: 10%;
    width: 3rem;
}

.vertical-form-input input[type="radio"]:checked+label {
    background-color: var(--mm-primary);
    color: white;
}

.horizontal-spaced-labels {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/********* METER styles *************/
.meter {
    position: relative;
}

.range-container {
    position: relative;
}

.range-container label {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.meter > .meter-needle {
    position: absolute;
    border: var(--mm-meter-border);
    bottom: 0.5rem;
    left: calc(44% + 2px);
    width: 0;
	height: 0;
	border-left: 15px solid transparent;
    border-top: 2px solid transparent;
	border-right: 15px solid transparent;
	border-bottom: 150px solid #555;
    transform-origin: bottom center;
    transform: rotate(0deg);
}

.likeliness-range-bar {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    margin-top: 1rem;
    width: 100%;
}

/***** Chrome, Safari, Opera, and Edge Chromium *****/
.likeliness-range-bar::-webkit-slider-runnable-track {
    background-color: var(--mm-primary);
    border-radius: 1rem;
    height: 1rem;
}

.likeliness-range-bar:disabled::-webkit-slider-runnable-track {
    background-color: var(--mm-primary-light);
}

.likeliness-range-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 2rem;
    width: 2rem;
    background-color: var(--mm-primary);
    border-radius: 50%;
    margin-top: -10px;
    box-shadow: 0 0 7px 0 rgba(0, 0, 0, 0.3);
}

.likeliness-range-bar:disabled::-webkit-slider-thumb {
    background-color: var(--mm-primary-light);
    box-shadow: none;
}

/******** Firefox ********/
.likeliness-range-bar::-moz-range-track {
    background-color: var(--mm-primary-light);
    border-radius: 1rem;
    height: 1rem;
}

.likeliness-range-bar:disabled::-moz-range-track {
    background-color: var(--mm-primary-light);
}

.likeliness-range-bar::-moz-range-thumb {
    -webkit-appearance: none;
    height: 2rem;
    width: 2rem;
    background-color: var(--mm-primary);
    border: none;
    border-radius: 50%;
    margin-top: -10px;
}

.likeliness-range-bar:disabled::-moz-range-thumb {
    background-color: var(--mm-primary-light);
    box-shadow: none;
}

.form-action-container {
    display: flex;
    flex-flow: row wrap;
    align-items: center;
    justify-content: center;
}

/*************** Forecast page ****************/
.forecast-meter {
    border: var(--mm-border);
    position: relative;
}

.forecast-meter > h3 {
    text-align: center;
    margin-top: 1rem;
}

.forecast-details {
    margin: 1rem;
    font-size: 1.2rem;
    text-align: justify;
}

/************ Forecast error page style *************/
.forecast-error {
    border: var(--mm-border);
    margin: 1rem;
    padding: 3rem 1rem;
    color: var(--mm-light-gray);
    text-transform: capitalize;
    text-align: center;
}

.confirm-section {
    text-align: center;
    padding-left: 0;
    padding-right: 0;
    margin-top: 2rem;
}

.confirm-section > button {
    min-width: max-content;
}

/************* GRID MENU STYLES **************/
.nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background-color: var(--mm-light-gray);
    gap: 2px;
    padding: 2px;
}

.nav-grid-item, .nav-grid-item > a {
    height: 8rem;
    background-color: white;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
}

.nav-grid-item * {
    -webkit-text-decoration: none!important;
    text-decoration: none!important;
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--mm-primary);
    text-transform: capitalize;
}

.nav-grid-item svg {
    height: 80px;
    width: 111px;
    fill: var(--mm-primary);
}

/************ Information page ************/
.information-section {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
footer.app-details{
    position: absolute;
    bottom: 6rem;
}

/************ Feedback page styles *****************/
.feedback-section {
    padding: 1rem;
}

.feedback-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    margin: 1rem 0;
}

.feedback-form > textarea {
    display: block;
    width: calc(100vw - 4rem);
    height: 12rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    border: var(--mm-border);
    font-size: 1rem;
    color: var(--mm-primary);
    padding: 0.5rem;
}

/************ LOG PAGE STYLES ****************/
.calendar-container {
    max-width: 500px;
}

.calendar-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-left: 2rem;
    padding-bottom: 0.5rem;
}

.seizure-buttons button, .seizure-buttons a {
    border: none;
    text-decoration: none!important;
    background-color: transparent;
    color: var(--mm-primary);
}

.calendar-buttons a > svg, .calendar-buttons path, .seizure-buttons svg {
    width: 2rem;
    height: 1rem;
    fill: var(--mm-primary);
}

#plus {
    stroke: var(--mm-primary);
}

.calendar-header, .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-grid .selected, .calendar-grid .current-day {
    position: relative;
}

.calendar-grid .selected::before, .calendar-grid .current-day::after {
    position: absolute;
    content: "";
    border: var(--mm-border);
    border-color: var(--mm-primary);
    top: -0.25rem;
    bottom: -0.25rem;
    left: -0.25rem;
    right: -0.25rem;
}

.calendar-grid .current-day::after {
    border: var(--mm-border);
}

.calendar-grid .future-day {
    color: var(--mm-light-gray);
}

.calendar-day {
    height: 2rem;
    width: 2rem;
    color: var(--mm-primary);
}

.calendar-day-seizure {
    border-radius: 50%;
    color: white;
    background-color: var(--mm-accent);
    height: 2rem;
    width: 2rem;
}

.calendar-header {
    font-weight: bold;
}

.calendar-header > *, .calendar-grid > * {
    text-align: center;
    font-size: 1.2rem;
    padding: 0.25rem;
}

.seizures-day-list {
    border: var(--mm-border);
    border-radius: 1rem;
    overflow-y: scroll;
    height: 13rem;
}

.seizures-day-list li {
    list-style-type: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.25rem;
}

.seizures-day-list li:first-child {
    margin-top: 0.5rem;
}

/************ FELT IT PAGE STYLES *********/

#nav-item-felt-it.active,  #nav-item-felt-it.active *{
    background-color: var(--mm-accent);
    color: white;
    fill: white;
}

#nav-item-felt-it.active text {
    fill: var(--mm-accent);
}

h5.log-mode {
    padding: 0.2rem 0;
}

#edit-type {
    border: none;
    background-color: transparent;
    text-transform: capitalize;
    color: var(--mm-light-gray);
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    flex-direction: column;
}

#edit-type > svg {
    max-height: 1.5rem;
    max-width: 1.5rem;
    fill: var(--mm-light-gray);
}

.seizure-types-grid-item.selected {
    border: 3px solid var(--mm-primary);
}

.seizure-types-grid-item.selected #edit-type {
    color: var(--mm-primary);
}

.seizure-types-grid-item.selected #edit-type > svg {
    fill: var(--mm-primary);
}

.felt-seizure-container {
    padding: 0;
}

.felt-seizure-form {
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    height: 70vh;
}

.felt-seizure-form button {
    flex-grow: 0;
    width: 100%;
}

.seizure-types-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    width: 100%;
    max-width: calc(100vw - 2rem);
}

.seizure-types-grid-item {
    height: 5rem;
    padding: 0.5rem;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: capitalize;
    text-align: center;
    color: var(--mm-primary-light);
    border: var(--mm-border);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    max-width: calc(calc(100vw - 4rem) / 2);
    word-break: break-word;
}

.seizure-types-grid-item > input:checked+label {
    color: var(--mm-primary);
}

.seizure-types-grid-item > input {
    display: none;
}

.seizure-types-grid-item > input:checked+label::before {
    position: absolute;
    content: "";
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 3px solid var(--mm-primary);
}

.seizures-subtypes-list {
    list-style-type: none;
}

.seizures-subtypes-list li {
    margin: 1.5rem 0;
    font-size: 1.2rem;
}

.seizures-subtypes-list li input[type='radio'] {
    display: none;
}

.seizures-subtypes-list li > label {
    display: flex;
    align-items: center;
}

.seizures-subtypes-list li > label::before {
    display: inline-block;
    content: "";
    height: 1rem;
    width: 1rem;
    border-radius: 50%;
    border: 3px solid var(--mm-primary);
    background-color: transparent;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.seizures-subtypes-list li > input:checked+label::before {
    background-color: var(--mm-primary);
}

/************ EDIT SEIZURE TYPES PAGE *****************/
.editable-types-list {
    flex-grow: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-evenly;
}

.editable-types-list > li {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    font-weight: bold;
    font-size: 1.2rem;
    text-transform: capitalize;
}

.editable-types-list > li svg {
    min-height: 1.5rem;
    margin-left: 0.5rem;
}

.editable-types-list > li .seizure-buttons {
    display: inline-flex;
    align-items: stretch;
    justify-content: center;
}

/************* EDIT SEIZURE TYPE FORM ************/
.seizure-type-form-title {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.seizure-type-form-title button {
    max-width: max-content;
}

.seizure-type-form-title > input[type='text'] {
    height: 2rem;
    color: var(--mm-primary);
    font-size: 1.2rem;
    font-weight: bold;
    max-width: 70%;
    border: var(--mm-border);
    border-width: 1px;
    border-radius: 5px;
    padding: 0.25rem;
}

.seizure-type-form-title svg {
    height: 1.5rem;
}

.seizure-type-form-description {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: stretch;
}

.seizure-type-form-description > label {
    font-weight: bold;
    margin-top: 0.5rem;
}

.seizure-type-form-description > textarea {
    width: 100%;
    border: var(--mm-border);
    border-radius: 0.5rem;
    margin: 0.5rem 0;
    padding: 1rem;
    font-size: 1rem;
    color: var(--mm-primary);
    height: 5rem;
}

a.add-seizure button.submit-btn {
    font-size: 1.2rem;
    padding: 0.5rem;
    height: 2rem;
    margin-top: 1rem;
    width: 100%;
    text-decoration: none!important;
}

/************ Bottom navbar style ************/
.bottom-navbar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4rem;
    border-top: var(--mm-border);
}

.nav-item {
    padding: 0.25rem 0.5rem;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon-button {
    border: none;
    background-color: transparent;
    color: var(--mm-primary);
    font-size: 1rem;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    text-decoration: none!important;
}

.nav-icon-button-icon {
    display: inline-block;
    max-width: 2rem;
}

.svg-btn-icon > * {
    fill: var(--mm-primary);
}
.svg-btn-icon {
    text-decoration: none!important;
}

.svg-btn-icon text {
    fill: white;
    text-decoration: none!important;
}

.highlighted .svg-btn-icon > circle {
    fill: var(--mm-accent);
}

.highlighted > .nav-icon-button-label {
    color: var(--mm-accent);
}

.active .svg-btn-icon > * {
    fill: white;
}
.active, .active * {
    background-color: var(--mm-primary);
    color: white;
}

main {
    height: calc(var(--vh, 1vh) * 100 - 4rem);
    overflow-y: auto;
}

.dark-text {
    color: var(--mm-dark-gray);
}

/* in case opened on desktop */
@media screen and (min-width: 500px) {
    main, .bottom-navbar {
        max-width: 500px;
        margin: 0 auto;
        background-color: white;
    }
    body {
     background-color: var(--mm-light-gray);
    }

     .feedback-form > textarea {
         max-width: calc(500px - 2rem);
     }
}

/* in case of smaller screens*/
@media screen and (max-height: 900px) {
    .top-section {
        margin: 0 1rem;
    }
}

@supports (bottom: env(safe-area-inset-bottom)) {
    .bottom-navbar {
        margin-bottom: env(safe-area-inset-bottom);
    }
    main {
        height: calc(var(--vh, 1vh) * 100 - 4rem - env(safe-area-inset-bottom));
    }
}

/*Only for PWA*/
@media (display-mode: fullscreen) {
    /*Only on IOS*/
    @supports (-webkit-touch-callout: none) {
        body .bottom-navbar {
            margin-bottom: 0.7rem;
        }
        main {
            height: calc(var(--vh, 1vh) * 100 - 4.7rem);
        }
    }
}

/* unlocked forecast home page */
.unlocked-forecast-ui {
    border: var(--mm-border);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.forecast-meter-caption {
    padding: 1rem;
    width: 50%;
}

/*************** LOGIN FORM *************/
.login-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    height: 70vh;
}

.login-form > * {
    flex-grow: 0;
    width: 100%;
}

.login-form > input {
    height: 3rem;
    border-radius: 5px;
    border: none;
    box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
    padding: 0.25rem;
    font-size: 1.5rem;
}

.login-form > input::placeholder {
    color: var(--mm-light-gray);
}
