:root {
    font-size: 16px;
    --buttons-text-color: #070b13;
    --linear-gradient-back: linear-gradient(135deg, #00f5e9 0%, #00bfff 100%);
    --linear-gradient-hover: linear-gradient(135deg, #00e0d5 0%, #00a6e0 100%);
    --linear-gradient-back-classic: linear-gradient(90deg,rgba(21, 24, 62, 1) 0%, rgba(150, 71, 198, 1) 100%);
    --linear-gradient-hover-classic: linear-gradient(90deg,rgba(0, 4, 42, 1) 0%, rgba(130, 51, 178, 1) 100%);
    --main-font: 'League Spartan', sans-serif;
}

@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;
    transition: all 0.25s ease;
}

a:hover {
    text-decoration: none;
    color: #00f5e9;
}

body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: #070b13;
    color: #f7fbff;
}

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

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

/* Sidebar Styles (Re-designed with PlayTek Dark Side panel) */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    height: 100%;
    background: linear-gradient(180deg, #05080e 0%, #070b13 52%, #020407 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    color: #f7fbff;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.2rem;
    position: relative;
    overflow-y: auto;
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(0, 245, 233, 0.08), transparent 35%);
    pointer-events: none;
    z-index: 0;
}

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

.logo-container {
    margin-bottom: 2.2rem;
    padding: 0.5rem;
    text-align: center;
}

.sidebar-logo {
    display: block;
    width: 100%;
    max-width: 140px;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(0, 245, 233, 0.2));
}

.sidebar-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    padding: 0;
    color: #f7fbff;
    letter-spacing: -0.01em;
}

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

.sidebar li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #8a99ad;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.95rem;
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar li a svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    transition: transform 0.2s ease;
}

.sidebar li a:hover {
    color: #00f5e9;
    background-color: rgba(0, 245, 233, 0.05);
    border-color: rgba(0, 245, 233, 0.1);
}

.sidebar li a:hover svg {
    transform: scale(1.1);
}

.sidebar li a.active, .sidebar li a.active:hover {
    background-color: rgba(0, 245, 233, 0.1);
    color: #00f5e9;
    border-color: rgba(0, 245, 233, 0.2);
    font-weight: 600;
    box-shadow: 0 0 15px rgba(0, 245, 233, 0.05);
}

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

/* Main Content Area (Redesigned with radial/linear dark overlays) */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
    background: 
        radial-gradient(circle at top right, rgba(0, 245, 233, 0.14), transparent 28%),
        radial-gradient(circle at 15% 15%, rgba(0, 191, 255, 0.08), transparent 25%),
        linear-gradient(180deg, #070b13 0%, #090f1a 45%, #030509 100%);
}

header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 1.2rem 2.2rem;
    background-color: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

header h1 {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #f7fbff;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin: 0;
    padding: 0.35rem 1.2rem;
    border-radius: 9999px;
    color: #f7fbff;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.top-nav a {
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.top-nav a:hover {
    color: #00f5e9;
    text-shadow: 0 0 8px rgba(0, 245, 233, 0.4);
}

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

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

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

.credits {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background: rgba(0, 245, 233, 0.1);
    color: #00f5e9;
    border: 1px solid rgba(0, 245, 233, 0.15);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.content-container {
    flex: 1;
    overflow-y: auto;
    padding: 2.2rem;
    position: relative;
    z-index: 1;
}

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

.selected-lang {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 32px;
}

.selected-lang:hover {
    background: rgba(255, 255, 255, 0.05);
}

.selected-lang img {
    width: 1.5rem;
    height: auto;
    border-radius: 2px;
}

.arrow {
    font-size: 0.7rem;
    margin-left: 2px;
    opacity: 0.7;
}

.language-dropdown {
    position: absolute;
    top: 120%;
    right: 0;
    min-width: 160px;
    background: #090e17;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    border-radius: 12px;
    overflow: hidden;
    color: #f7fbff;
    
    /* Animation styles */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    font-size: 0.9rem;
}

.lang-option:hover {
    background: rgba(0, 245, 233, 0.08);
    color: #00f5e9;
}

.lang-option img {
    width: 1.4rem;
    height: auto;
    border-radius: 2px;
}

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;
}

/* Modal layouts */
.layout {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(7, 11, 19, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.layout>div {
    background-color: #0b1220;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2.2rem;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    width: fit-content;
    max-width: 600px;
    max-height: 90%;
    overflow-y: auto;
}

/* Scrollbar styling (Rebuilt for Dark Theme) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #070b13;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 245, 233, 0.35);
}

/* Loader spinner: */
.loader {
    position: absolute;
    top: 30%;
    margin: 0 auto;
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-bottom-color: #00f5e9;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    filter: drop-shadow(0 0 10px rgba(0, 245, 233, 0.3));
}

@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: 3px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 245, 233, 0.1);
}

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

.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: 15px;
    right: 15px;
    font-size: 24px;
    color: #8a99ad;
    cursor: pointer;
    z-index: 100;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #00f5e9;
}

p.error {
    color: #ff4a4a;
    font-weight: 600;
    text-align: center;
    margin: 0 auto;
    text-shadow: 0 0 15px rgba(255, 74, 74, 0.25);
}

.form-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Notebook/Laptop viewport optimizations (e.g. 1366x720) */
@media (max-width: 1366px) {
    .sidebar {
        width: 220px;
        padding: 1.2rem 1rem;
    }
    .sidebar-logo {
        max-width: 120px;
    }
    .logo-container {
        margin-bottom: 1.5rem;
    }
    .sidebar li a {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
        gap: 0.6rem;
    }
    .content-container {
        padding: 1.2rem;
    }
    header {
        padding: 1rem 1.5rem;
    }
}