:root {
    --color-background: #f4f4f4;
    --color-background-light: rgba(244, 244, 244, 0.7);
    --color-text: #333;
    --color-text-light: #666;
    --color-white: #fff;
    --color-gray: #f0f0f0;
    --color-gray-dark: #e0e0e0;
    --color-black: #000;
    --color-shadow-light: rgba(0, 0, 0, 0.1);
    --color-shadow-medium: rgba(0, 0, 0, 0.2);
    --color-shadow-dark: rgba(0, 0, 0, 0.3);
}

body,
textarea {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    scroll-behavior: smooth;
}

body,
.navbar {
    padding: 0;
    margin: 0;
    text-align: center;
    color: var(--color-text);
    scroll-padding-top: 70px;
}

body,
.container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

body {
    background-color: var(--color-background);
    line-height: 1.6em;
    height: 100vh;
}

.navbar {
    position: sticky;
    top: 0;
    backdrop-filter: blur(1px);
    z-index: 1;
    background-color: var(--color-background-light);
    padding: 10px 20px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    padding-left: 20px !important;
    box-shadow: 0 2px 4px var(--color-shadow-light);
}

.nav-link,
.about-link {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    font-weight: 900;
}

.logo {
    height: 28px;
    width: auto;
    margin-right: 3px;
}

.container {
    background-color: var(--color-white);
    padding: 20px;
    height: calc(100vh - 90px);
    height: calc(var(--vh, 1vh) * 100 - 90px);
}

#result {
    font-size: 1.5em;
    margin-bottom: 10px;
    user-select: text;
}

.textareas {
    display: flex;
    flex-direction: column;
    height: 78vh;
    font-size: large;
    margin-left: 3%;
    margin-right: 3%;
    height: calc(var(--vh, 1vh) * 78); 
    max-height: -webkit-fill-available;
}

textarea {
    resize: none;
    max-width: 100%;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px;
    font-size: 1em;
    outline: none;
    box-shadow: inset 0px 0px 1px var(--color-shadow-light);
    transition: box-shadow 0.5s ease, border-color 0.5s ease;
    position: relative;
    height: 100%;
    max-height: -webkit-fill-available;
    overflow-y: auto;
}

textarea:focus {
    box-shadow: 0 0 4px var(--color-gray-dark), 0 0 8px var(--color-gray-dark);
    border-color: var(--color-gray-dark);
}

textarea:not(:focus) {
    box-shadow: inset 0px 0px 5px var(--color-shadow-light);
    border-color: transparent;
}

textarea:focus::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8),
        0 0 30px rgba(255, 255, 255, 0.6),
        0 0 40px rgba(255, 255, 255, 0.4),
        0 0 50px rgba(255, 255, 255, 0.2);
    opacity: 0;
    animation: glow 1.5s infinite alternate;
}

@keyframes glow {
    0% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.counters {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 20px;
    margin-left: 3%;
    margin-right: 3%;
}

.counters>.counter {
    background-color: var(--color-gray);
    color: var(--color-text);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0px 0px 5px var(--color-shadow-light);
    box-sizing: border-box;
}

.counters>.counter:hover {
    background-color: var(--color-gray-dark);
}

@media (max-width: 888px) {
    .textareas,
    .counters,
    .bottom-stats {
        margin-left: 0;
        margin-right: 0;
    }
 
}

@media (max-width: 767px) {
    .options {
        flex-direction: column;
    }

    .counters>.counter,
    .bottom-stats>.bottom-stat {
        flex-basis: calc(50% - 10px);
        margin: 5px;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        box-sizing: border-box;
    }
}

@media (min-width: 768px) {
    .counters {
        gap: 2%;
    }

    .counters>.counter {
        flex-basis: calc(20% - 2%);
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        flex-grow: 1;
    }
}

.counters>.counter>.label {
    font-size: 0.8em;
    user-select: none;
}

.counters>.counter>.value {
    font-size: 1.5em;
    font-weight: 900;
}

.footer {
    padding: 20px;
    background-color: var(--color-text);
    text-align: left !important;
}

.lander {
    padding: 20px;
    text-align: left !important;
    font-size: 1em;
}

.dots {
    width: fit-content;
    font-weight: bold;
    font-size: 0.5em;
    clip-path: inset(0 3ch 0 0);
    animation: l4 1s steps(4) infinite;
}

@keyframes l4 {
    to {
        clip-path: inset(0 -1ch 0 0);
    }
}

#notification {
    visibility: hidden;
    min-width: 250px;
    background-color: rgba(50, 50, 50, 0.6);
    color: var(--color-white);
    text-align: center;
    border-radius: 10px;
    padding: 16px;
    position: fixed;
    z-index: 10000;
    left: 50%;
    bottom: 30px;
    font-size: 1em;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 30px var(--color-shadow-medium);
    cursor: pointer;
    transform: translateX(-50%);
    backdrop-filter: blur(10px);
}

#notification:hover {
    background-color: rgba(50, 50, 50, 0.8);
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 35px var(--color-shadow-dark);
}

#notification.show {
    visibility: visible;
    opacity: 1;
}

#progress-bar {
    height: 4px;
    background-color: rgba(255, 255, 255, 0.7);
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    transition: width 0.1s linear;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 5px var(--color-shadow-light);
}

.modal {
    position: fixed;
    z-index: 2;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--color-white);
    margin: auto;
    padding: 0 20px 20px;
    border-radius: 20px;
    width: 80%;
    height: 80vh;
    color: var(--color-text);
    text-align: center;
    box-shadow: inset 0px 0px 5px var(--color-shadow-light);
    overflow: auto;
    resize: both;
    max-height: 90vh;
    max-width: 90vw;
    min-height: 50vh;
    min-width: 50vw;
}

.modal-header {
    backdrop-filter: blur(2px);
    position: sticky;
    top: 0;
    padding: 20px 0px 0px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title {
    font-size: 1.5em;
    font-weight: bold;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: var(--color-black);
    text-decoration: none;
    cursor: pointer;
}

.setting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    text-align: left;
}

.setting-name {
    font-weight: bold;
}

.options {
    display: flex;
    gap: 10px;
}

.option {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    background-color: var(--color-gray);
    cursor: pointer;
}

.option:hover {
    background-color: var(--color-gray-dark);
}

.option.active {
    background-color: #bbb !important;
    cursor: pointer;
}

.option.active:hover {
    background-color: #aaa !important;
}

.setting-description {
    display: flex;
    flex-direction: column;
    margin-right: 5px;
}

.description {
    font-size: 0.9em;
    color: var(--color-text-light);
}

a {
    text-decoration: none;
}

#links {
    text-decoration: none;
    opacity: 80%;
    color: var(--color-text);
}

#links:hover {
    text-decoration: underline;
}

.blog {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    box-sizing: border-box;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    cursor: pointer;
    color: var(--color-white);
}

.blog:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--color-shadow-medium);
}

.blog h2 {
    margin: 0 0 10px;
    font-size: 24px;
}

.blog p {
    margin: 0;
    font-size: 16px;
    color: #ffffffb3;
}

.back-button {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 15px;
    background-color: var(--color-black);
    color: var(--color-white);
    text-decoration: none;
    border-radius: 5px;
}

.back-button:hover {
    background-color: #999;
}

.shortcut {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.shortcut:last-child {
    border-bottom: none;
}

.key,
.command {
    background-color: #eee;
    color: var(--color-black);
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    margin-right: 2px;
}

.plus {
    margin: 0 2px;
    font-weight: bold;
    color: var(--color-text);
}

.scdescription {
    flex-grow: 1;
    text-align: left;
    color: #555;
}

.banner {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-gray);
    color: var(--color-black);
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 10px var(--color-shadow-light);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 80%;
}

.banner-message {
    flex-grow: 1;
}

.banner-dismiss {
    cursor: pointer;
    margin-left: 10px;
    font-weight: bold;
}

#citationList {
    max-height: 90%;
    overflow-y: auto;
    position: relative;
}
table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; 
}

th,
td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    width: 40px !important;
    word-wrap: break-word; 
    overflow-wrap: break-word; 
}

th {
    background-color: var(--color-background);
    position: sticky;
    top: 0;
    z-index: 10;
}

tfoot {
    position: sticky;
    bottom: 0;
    background-color: var(--color-background);
    z-index: 10;
}

tr:hover {
    background-color: var(--color-gray-dark);
}

.nocopy {
    user-select: none;
}

.bottomhr {
    opacity: 10%;
    margin-top: 100px;
}

#selectAllBtn {
    padding: 4px 8px;
    margin-left: 8px;
    background-color: var(--color-gray);
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

#selectAllBtn:hover {
    background-color: var(--color-gray-dark);
    border-color: #999;
}

#selectAllBtn:active {
    background-color: #d0d0d0;
    transform: translateY(1px);
}

.nav-buttons {
    display: flex;
    gap: 15px;
}

.bottom-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 20px 5%;
}

.bottom-stat {
    background: var(--color-gray);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0px 0px 5px var(--color-shadow-light);
    transition: background-color 0.3s ease;
}

.bottom-stat:hover {
    background-color: var(--color-gray-dark);
}

.bottom-stat-value {
    font-size: 1.5em;
    font-weight: 900;
    color: var(--color-text);
}

.bottom-stat-label {
    font-size: 0.8em;
    color: var(--color-text-light);
    user-select: none;
}

#safety {
    opacity: 0.8;
    font-size: small;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.8);
}

#safety img {
    opacity: 0.8;
    filter: brightness(0) invert(0);
    margin-top: -2px;
}

#safety a {
    text-decoration: underline;
    color: rgba(0, 0, 0, 0.8);
    opacity: 0.8;
}

@media (prefers-color-scheme: dark) {
  

    #safety {
        color: rgba(255, 255, 255, 0.8);
    }

    #safety img {
        filter: brightness(0) invert(1);
    }

    #safety a {
        color: rgba(255, 255, 255, 0.8);
    }
}

#cog {
    transition: opacity 0.1s ease;
}

.about-link:hover #cog {
    opacity: 0.5;
    filter: brightness(1.2); 
}

.cta {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    background: linear-gradient(45deg, rgba(255, 0, 150, 0.8), rgba(0, 204, 255, 0.8)); 
    filter: blur(15px);
    z-index: 0;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.cta:hover::before {
    opacity: 1;
}

.cta > * {
    position: relative;
    z-index: 1; 
}
