* {
    font-family: "Merriweather", sans-serif !important;
    font-display: optional;
}

body {
    background-color: bisque;
}

.main-container {
    margin-left: 10%;
    padding: 0em;
    max-width: 80%;
    width: max-content;
}

/* Header logo and heading alignment */
.header-logo-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    margin-left: -192px; /* Adjust to center the logo and heading */
    font-size: 150%;
}

.header-logo-container .logo {
    margin-right: 2rem;
    box-shadow: 0 4px 16px 0 rgba(128, 64, 0, 0.12); /* Soft shadow */
    border: 2px solid maroon; /* Border to match the theme */
    border-radius: 20%; /* Circular logo */
}

h1 {
    color: maroon;
    text-align: center;
}

.list-select {
    display: grid;
    grid-template-columns: 40% 40%;
    row-gap: 1em;
    column-gap: 1em;
    background-color: beige;
    max-width: 100%;
    justify-content: space-around;
    padding: 1em;
    border-radius: 10px;
    border: 2px solid maroon;
    margin: 2em 0em;
}

.list-select label {
    color: maroon;
    font-size: large;
    font-weight: bold;
}

.source-select {
    display: flex;
    flex-wrap: wrap;
    row-gap: 0.5em;
    column-gap: 0.5em;
    text-align: center;
    align-items: center;
}

.source-select label {
    color: firebrick;
    font-weight: normal;
    padding: 1em;
    flex-grow: 1;
    background-color: floralwhite;
    border: 2px solid maroon;
    border-radius: 10px;
    flex-basis: calc(100% / 6);
    &:hover{
        background-color: tan;
        cursor: pointer;
    }
}

#source-select-selected {
    background-color: maroon;
    color: floralwhite;
}

.list-select input[type="submit"], .list-select button {
    grid-column: auto / span 2;
    padding: 0.5em;
    border-radius: 10px;
    font-size: large;
    background-color: snow;
    color: maroon;
    border: solid 2px;
    cursor: pointer;
    &:hover {
        background-color: tan;
    }
}

.search-result input[type="submit"] {
    padding: 0.5em;
    border-radius: 10px;
    font-size: large;
    background-color: snow;
    color: maroon;
    border: solid 2px;
    cursor: pointer;
    &:hover {
        background-color: tan;
    }
}

.search-result p {
    text-align: center;
}

.category-select-major {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    & button {
        font-size: medium;
    }
}

.company-select-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.date-div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.date-div input[type="date"] {
    padding: 0.5em;
    border-radius: 5px;
    border: 2px solid maroon;
    background-color: snow;
}

@media only screen and (max-width: 800px) {
    /* CSS rules for mobile devices */
    .list-select {
        display: flex;
        flex-direction: column;
        row-gap: 1em;
        column-gap: 1em;
        background-color: beige;
        min-width: 60%;
        max-width: 100%;
        justify-content: space-around;
        padding: 1em;
        border-radius: 10px;
        border: 2px solid maroon;
        margin: 2em 0em;
    }

    .source-select {
        flex-direction: column;
    }
    .source-select label {
        font-size: initial;
        width: 80%;
    }

    .main-container {
        margin-left: 0%;
        padding: 0em;
        max-width: 100%;
        width: max-content;
    }

    .result-table {
        font-size: small;
        & input[type="submit"], a {
            font-size: smaller;
        }
    }

    .result-table th, td {
        text-overflow: ellipsis;
        max-width: 20px;
        overflow: hidden;
    }

    .result-extra {
        display: none;
    }

    .summary-container {
        margin: 0em !important;
        & ul  {
            padding-inline-start: 20px;
        }
    }

    .features{
        display: flex !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch; /* for smooth scrolling on iOS */
    }

    .feature-item {
        flex: 0 0 100%;
        scroll-snap-align: start;
    }

    .header-logo-container {
        margin-left: 0;
        font-size: 100%;
        & .logo {
            width: 128px;
            height: 128px;
            margin-right:0;
        }
    }

    .status {
        flex-direction: column;
    }

    .status p {
        text-align: center !important;
    }
}


fieldset {
    grid-column: auto / span 2;
    border-color: firebrick;
    border-radius: 5px;
}

legend {
    color: firebrick;
    font-size: large;
    font-weight: bold;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.blink-element {
    animation: blink 1s 3;
    padding-top: 0.5em;
}


@keyframes dropDown {
    from {
      top: 0vh;
      opacity: 0;
    }
    to {
      top: 45vh;
      opacity: 1;
    }
}

/*   Open state of the dialog  */
dialog[open] {
    opacity: 1;
    transform: scaleY(1);
}

/*   Closed state of the dialog   */
dialog {
    position: fixed;
    opacity: 0;
    transform: scaleY(0);
    z-index: 1;
    transition: all 0.7s allow-discrete;
    animation: dropDown 1s ease-out forwards;
    border-color: saddlebrown;
    background-color: wheat;
    color: maroon;
    border-radius: 10px;
}

/*   Before-open state  */
/* Needs to be after the previous dialog[open] rule to take effect,
    as the specificity is the same */
@starting-style {
    dialog[open] {
        opacity: 0;
        transform: scaleY(0);
    }
}

/* Transition the :backdrop when the dialog modal is promoted to the top layer */
dialog::backdrop {
    background-color: rgb(0 0 0 / 0%);
    transition: all 0.5s allow-discrete;
}

dialog[open]::backdrop {
    background-color: rgb(0 0 0 / 25%);
}

/* This starting-style rule cannot be nested inside the above selector
because the nesting selector cannot represent pseudo-elements. */

@starting-style {
    dialog[open]::backdrop {
        background-color: rgb(0 0 0 / 0%);
    }
}

dialog button {
    background-color: antiquewhite;
    border-radius: 5px;
    float: right;
    padding: 0.4em;
}

dialog button:hover {
    background-color: tan;
}

.templated {
    display: none;
}

input[type="radio"] {
    display: none;
    accent-color: maroon;
}

.search-result {
    display: grid;
    justify-content: center;
    align-items: center;
    background-color: whitesmoke;
    padding: 1em;
    border-radius: 10px;
    border: 2px solid maroon;
    color: darkred;
}

.navlink {
    padding: 1em;
    background-color: snow;
    border: maroon 2px solid;
    border-radius: 10px;
    text-decoration: none;
    color: darkred;
    margin-right: 1em;
    text-align: center;
    align-content: center;
    &:hover {
        background-color: tan;
    }
}

.text-container {
    box-shadow: 0 4px 20px 8px rgba(0, 0, 0, 0.1);
    padding: 1em;
    min-width: fit-content;
    border-radius: 10px;
    display: grid;
    background-color: cornsilk;
}

.text-container p {
    line-height: 150%;
    text-align: justify;
}

.status {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status p {
    font-weight: bold;
    color: maroon;
    text-align: left;
}

.links {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    padding: 1em;
    justify-content: space-between;
    align-items: center;
    column-gap: 1em;
}

.links a {
    color: black;
    text-decoration: none;
    text-align: center;
}

#info-text {
    width: auto;
    padding: 1em min(5em, 10%);
}

.result-table {
    max-height: 50em;
    overflow-y: auto;
    text-align: center;
    background-color: antiquewhite;
    border-radius: 10px;
    border: 2px solid maroon;
    scrollbar-width: 5px;

    & table {
        width: 100%;
        border-spacing: 0px;
    }
}

.result-table th, td {
    border: 1px solid black;
    padding: 7.5px;
    line-height: 150%;
}

.result-table th {
    background-color: burlywood;
    font-weight: bold;
    color: maroon;
    position: sticky;
    top: 0;
}

.result-table tr:nth-child(even) {
    background-color: #d1b2a0bd;
}


.result-table::-webkit-scrollbar {
    width: 5px;
}
.result-table::-webkit-scrollbar-track {
    background: #f0f1f3;
    margin: 1em;
}
.result-table::-webkit-scrollbar-thumb {
    background: #cdcfd1;
}
.result-table::-webkit-scrollbar-thumb:hover {
    background: #b2b6b9;
}

.result-table input, .result-table label, .result-table a, .result-header input[type="submit"] {
    padding: 0.5em;
    border-radius: 10px;
    background-color: snow;
    color: maroon;
    border: solid 2px;
    cursor: pointer;
    text-decoration: none;
    &:hover {
        background-color: tan;
    }
}

.result-table label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.result-header {
    display: flex;
    align-items: center;
    column-gap: 1em;
    color: maroon;
    font-weight: bold;
    padding-left: 1em;
    margin-top: 1em;
    flex-wrap: wrap;
}

.result-header :first-child {
    flex-grow: 1;
    text-align: left;
}

.result-header select {
    padding: 0.5em;
    border-radius: 5px;
    border: 2px solid maroon;
    background-color: snow;
    color: firebrick;
}

.summary-container {
    box-shadow: 0 4px 20px 8px rgba(0, 0, 0, 0.1);
    padding: 1em 5%;
    min-width: fit-content;
    max-width: 100%;
    border-radius: 10px;
    display: grid;
    justify-items: center;
    background-color: cornsilk;
    margin: 2em 10%;
}

.summary-container p, li {
    line-height: 150%;
    text-align: justify;
}

.summary-container iframe {
    max-width: 100%;
    margin-top: 1em;
}

.content-options {
    display: flex;
    flex-wrap: wrap;
    row-gap: 1em;
    margin-bottom: 1em;
    margin-top: 1em;
}

.content-options a {
    flex-grow: 1;
}

.loader {
    margin: 2em;
    padding: 1em;
    height: fit-content;
    width: fit-content;
    --c:no-repeat linear-gradient(#b76d42 0 0);
    background: var(--c),var(--c),#cda967a6;
    background-size: 60% 100%;
    animation: l16 3s infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    color: darkred;
  }
  @keyframes l16 {
    0%   {background-position:-150% 0,-150% 0}
    66%  {background-position: 250% 0,-150% 0}
    100% {background-position: 250% 0, 250% 0}
  }

@keyframes blinkSuccess {
0%, 100% { background-color: transparent; }
50% { background-color: rgba(5, 70, 5, 0.5); } /* Green */
}

@keyframes blinkFailure {
0%, 100% { background-color: transparent; }
50% { background-color: rgba(255, 0, 0, 0.5); } /* Red */
}

.blink-success {
animation: blinkSuccess 0.5s 2;
}

.blink-failure {
animation: blinkFailure 0.5s 2;
}

#info-text {
    & h2, h3 {
        margin: 0;
        text-align: center;
        color: maroon;
        text-decoration: underline;
        text-underline-offset: 5px;
    }
}

.features {
    display: grid;
    grid-template-columns: 33% 33% 33%;
    column-gap: 1em;
    margin-top: 1em;
    justify-items: center;
    row-gap: 1em;
    & ul {
        padding-inline-start: 0px;
        list-style-type: none;
        display: grid;
        grid-auto-rows: 1fr;
        align-items: center;
        row-gap: 2em;
        & li {
            box-shadow: 0 4px 10px 8px rgba(0, 0, 0, 0.1);
            margin: 0.3em;
            padding: 0.5em;
            border-radius: 10px;
            background-color: bisque;
            text-align: center;
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            &:hover {
                transform: scale(1.1);
                transition: transform 0.3s ease;
                color: maroon;
                border: 2px solid maroon;
            }
        }
    }
}

.feedback {
    min-width: 60vh;
}

.feedback iframe {
    width: 100%;
    height: 60vh;
    border: none;
}

.checkbox-selected {
    background-color: lightsalmon !important;
}

#compare-button {
    font-size: large;
    margin-bottom: 0.5em;
    margin-top: 0.5em;
    width: 100%;
    text-align: center;
    flex-grow: 1;
}

#compare-form {
    flex-grow: 1;
}
