:root {
    font-size: 18px;
    --buttons-text-color: #ffffff;
    --linear-gradient-back: linear-gradient(90deg,rgba(21, 24, 62, 1) 0%, rgba(150, 71, 198, 1) 100%);
    --linear-gradient-hover: linear-gradient(90deg,rgba(0, 4, 42, 1) 0%, rgba(130, 51, 178, 1) 100%);
}

@media (max-width: 1400px), (max-height: 900px) {
    :root {
        font-size: 14px;
    }
}

* {
    box-sizing: border-box;
    font-family: var(--main-font);
}

a {
    text-decoration: none;
    color: inherit;
    animation: all 0.3s;
}

a:hover {
    text-decoration: underline;
    font-weight: bold;
}

a:visited {
    color: inherit;
}

body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

main {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    flex-shrink: 0;
    height: 100%;
    background-color: #15183e;
    color: white;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.sidebar-logo {
    display: block;
    width: 100%;
    max-width: 150px;
    height: auto;
    margin: 0 auto 2rem auto;
    /* Placeholder visuals */
    min-height: 50px;
    /* background: rgba(255, 255, 255, 0.1); */
    border-radius: 8px;
    object-fit: contain;
}

.sidebar-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    padding: 0;
    color: rgba(255, 255, 255, 0.8);
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar li a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sidebar li a:hover, .sidebar li a.active {
    background-color: #9647c6;
    color: white;
    font-weight: 600;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 2rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background-color: #f8f9fa;
}

header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 1rem 2rem;
    background-color: white;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #15183e;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0;
    padding: 0;
    border-radius: 15px;
    color: white;
    background: var(--linear-gradient-back);
}

.top-nav a {
  font-weight: 500;
}

.top-nav a:hover {
  text-decoration: underline;
  text-shadow: 0 0 0 currentColor;
  font-weight: inherit !important;
}

.pad-left {
    padding-left: 1rem;
}

.top-nav-div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-nav-icon {
    width: 16px;
    height: auto;
}

.content-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* Language Switcher Dropdown */
.language-switcher-cust {
    position: relative;
    display: inline-block;
}

.selected-lang {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0.5rem;
    /* background-color: rgba(255, 255, 255, 0.8); */
    border-radius: 15px;
    /* box-shadow: 5px 5px 5px 2px rgba(0, 94, 184, .2); */
    cursor: pointer;
    transition: box-shadow ease 0.5s;
    min-height: 40px; /* match button height approx */
}

.selected-lang:hover {
    box-shadow: 0 0 0 0 rgba(0, 0, 0, .2), inset 5px 5px 5px 2px rgba(0, 94, 184, .2);
}

.selected-lang img {
    width: 2rem;
    height: auto;
}

.arrow {
    font-size: 0.8rem;
    margin-left: 5px;
}

.language-dropdown {
    position: absolute;
    top: 110%;
    right: 0;
    min-width: 160px;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
    z-index: 1000;
    border-radius: 10px;
    overflow: hidden;
    color: white;
    
    /* Animation styles */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease, background-color 0s; /* Excluding bg from transition if needed, or keeping all */
}

.language-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    background: var(--linear-gradient-back);
}

.lang-option:hover {
    background: var(--linear-gradient-hover);
}

.lang-option img {
    width: 1.5rem;
    height: auto;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.file-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.info-form-group {
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
}

.hide {
    display: none !important;
}

.invisible {
    opacity: 0;
    pointer-events: none;
}

.layout {
    position: fixed;
    top: 0;
    left: 0;
    width: 100svw;
    height: 100svh;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.layout>div {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: fit-content;
    max-width: 600px;
    max-height: 90%;
    overflow-y: auto;
}

button,
input[type="submit"] {
    border: none;
    border-radius: 15px;
    box-sizing: border-box;
    box-shadow: 5px 5px 5px 2px rgba(0, 94, 184, .2), inset 0 0 0 0 rgba(0, 0, 0, .2);
    cursor: pointer;
    padding: 0.5em 1em;
    width: fit-content;
    transition: box-shadow ease 0.5s, transform ease 0.1s;
    background: var(--linear-gradient-back);
    color: var(--buttons-text-color);
}

button:hover,
input[type="submit"]:hover {
    box-shadow: 0 0 0 0 rgba(0, 0, 0, .2), inset 5px 5px 5px 2px rgba(0, 94, 184, .2);
    background: var(--linear-gradient-hover);
}

button:active,
input[type="submit"]:active {
    transform: scale(0.95);
}


/* Scrollbar: */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    box-shadow: inset 0 0 5px grey;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(26, 20, 20, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(26, 20, 20, 0.75);
}

::-webkit-scrollbar-thumb:horizontal {
    background: rgba(26, 20, 20, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:horizontal:hover {
    background: rgba(26, 20, 20, 0.5);
}

/* Loader spinner: */
.loader {
    position: absolute;
    top: 30%;
    margin: 0 auto;
    width: 48px;
    height: 48px;
    border: 5px solid #000;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.btns {
    margin: 1rem 0;
}

table {
    width: 100%;
}

td {
    text-align: center;
    align-items: center;
}

.reference-content img {
    max-width: 90vw;
    max-height: 90vh;
    border: 5px solid white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.reference-viewer {
    padding: 0 !important;
    overflow: hidden !important;
}

.reference-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pointer {
    cursor: pointer;
    text-decoration: underline;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 30px;
    color: rgb(128, 128, 128);
    cursor: pointer;
    z-index: 100;
}

.close-btn:hover {
    color: #2e2e2e;
}

p.error {
    color: red;
    font-weight: bold;
    text-align: center;
    margin: 0 auto;
}