/* Font Face Declarations for Exo 2 */
@font-face {
    font-family: 'Exo 2';
    src: url('../assets/fonts/exo-2/Exo2-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Exo 2';
    src: url('../assets/fonts/exo-2/Exo2-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Exo 2';
    src: url('../assets/fonts/exo-2/Exo2-SemiBold.otf') format('opentype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Exo 2';
    src: url('../assets/fonts/exo-2/Exo2-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Exo 2';
    src: url('../assets/fonts/exo-2/Exo2-Light.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

/* CSS Custom Properties (Global Variables) */
:root {
    --primary-blue: #004e9f;
    --primary-yellow-hover: #fcba00;
    --primary-blue-light: #3498db;
    --primary-blue-dark: #003366;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Exo 2', Arial, sans-serif;
    min-width: 500px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f9f9f9;
}

/* Top logos */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 30px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #ddd;
}

.top-links a {
    color: var(--primary-blue);
    text-decoration: none;
    margin: 0 6px;
    font-weight: 600;
    font-size: 18px;
}

.top-links a:hover {
    text-decoration: underline;
}

/* Content Links (for JSON references and people links) */
a[style*="color: #004e9f"] {
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

a[style*="color: #004e9f"]:hover {
    color: var(--primary-yellow-hover) !important;
    text-decoration: underline !important;
}

/* BibTeX Tooltip */
.bibtex-tooltip {
    position: relative;
}

.bibtex-tooltip:hover::before {
    content: attr(data-tooltip);
    visibility: visible;
    opacity: 1;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    background-color: #333;
    color: #fff;
    font-size: 14px;
    text-align: left;
    border-radius: 5px;
    padding: 10px;
    white-space: pre-line;
    z-index: 10;
    margin-bottom: 8px;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    transition-delay: 0.1s;
}

.bibtex-tooltip:hover::after {
    content: "";
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%) translateX(-5px);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #333;
    z-index: 11;
}

/* Nav bar */
.navbar {
    background-color: var(--primary-blue);
    color: white;
    padding: 12px 30px;
    display: flex;
    gap: 23px;
    justify-content: flex-end;
    margin-bottom: 0px;
}

.navbar a {
    color: white;
    text-decoration: none;
    font-size: 22px;
    position: relative;
    font-weight: normal;
}

.navbar a:hover {
    font-weight: bold;
}

.navbar a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 102%;
    height: 1px;
    background-color: white;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.navbar a:hover::after {
    opacity: 1;
}

/* Desktop default: show links, hide hamburger */
.hamburger-btn { display: none !important; }

/* Hamburger button */
.hamburger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 0px solid rgba(255,255,255,0.6);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.hamburger-btn:hover {
    background-color: rgba(255,255,255,0.12);
    border-color: #fff;
}

.hamburger-btn .material-icons {
    font-size: 26px;
}

/* Side drawer and overlay */
.side-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1000;
}

.side-overlay.visible { opacity: 1; pointer-events: auto; }

.side-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 320px;
    max-width: 85vw;
    background: #fff;
    box-shadow: -6px 0 18px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.side-drawer.open { transform: translateX(0); }

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}

.drawer-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
}

.drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: #444;
    cursor: pointer;
}

.drawer-close .material-icons { font-size: 24px; }

.drawer-nav {
    display: flex;
    flex-direction: column;
    padding: 8px;
}

.drawer-link {
    display: block;
    padding: 12px 14px;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1rem;
}

.drawer-link:hover { background: #f4f6f8; color: var(--primary-blue); }

/* Show hamburger and hide links on small viewports */
@media (max-width: 900px) {
    .navbar { justify-content: flex-end; gap: 12px; }
    .navbar a { display: none; }
    .hamburger-btn { display: inline-flex !important; }
}

/* Modal Styles - CSS Only Click-to-Dismiss */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal:target {
    display: flex;
}

/* Backdrop overlay that covers the entire modal area */
.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1;
    text-decoration: none;
}

.modal-content {
    background: white;
    padding: 25px 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    position: relative;
    z-index: 2;
    /* Ensure content is above backdrop */
    margin: 20px;
    /* Add some margin for mobile */
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    text-decoration: none;
    font-size: 22px;
    font-weight: bold;
    color: #444;
    z-index: 3;
    /* Ensure close button is above all other modal elements */
    transition: color 0.2s ease;
}

.close:hover {
    color: var(--primary-blue);
}

/* Custom logo section */
.custom-logo {
    text-align: center;
    margin-bottom: 35px;
    margin-top: 20px;
}

.custom-logo img {
    height: 80px;
}

/* Main content */
.main {
    /* Fix invalid 'margin-bottom: 40px auto' */
    margin: 1rem auto 40px;
    padding: 0 20px;
    flex: 1;
    background-color: #f9f9f9;
}

section {
    margin-bottom: 60px;
}

h2 {
    border-bottom: 2px solid #eee;
    padding-bottom: 6px;
}

.middle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    text-align: center;
    font-size: 2.25rem;
    margin-bottom: 20px;
    color: black;
    width: 100%;
}

.layer1-icon {
    height: 4.5rem;
    width: auto;
    transition: transform 0.3s ease;
}

.layer1-icon:hover {
    transform: scale(1.1);
}

/* Submit form */
.submit-form {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 8px;
}

.submit-form input,
.submit-form select,
.submit-form button {
    display: block;
    width: 100%;
    margin: 10px 0;
    padding: 10px;
    font-size: 14px;
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer;
    font-size: 20px;
    margin-left: 10px;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 300px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 5px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    top: -5px;
    left: 110%;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

pre {
    background: #222;
    color: #eee;
    padding: 10px;
    overflow: auto;
    font-size: 13px;
}

.submit-wrapper {
    display: flex;
    justify-content: center;
}

.submit-card {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 30px;
    padding-top: 15px;
    border-radius: 12px !important;
    width: 100%;
    max-width: 520px;
    margin-bottom: 40px;
    position: relative;
}

.submit-card h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3rem;
    color: #2c3e50;
}

.submit-card p {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 20px;
}

.submit-card label {
    font-weight: 500;
    margin-top: 15px;
    display: block;
}

.submit-card input[type="file"],
.submit-card input[type="email"],
.submit-card input[type="text"] {
    width: 93%;
    margin-top: 6px;
    padding: 8px;
    border: 2px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.submit-card input[type="email"]:focus,
.submit-card input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-yellow-hover);
}

.submit-card input[type="radio"] {
    margin-right: 6px;
    accent-color: var(--primary-blue);
    transform: scale(1.2);
}

.submit-btn {
    margin-top: 15px;
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.submit-btn:hover {
    background-color: var(--primary-yellow-hover);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-spinner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.buttons {
    display: flex;
    justify-content: flex-end;
}

.nameAffiliation {
    width: 85% !important;
}

.email-field-group {
    margin-top: 15px;
}

.email-field-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0px;
}

.email-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0px;
    height: 40px;
}

.email-upload-wrapper input[type="email"] {
    flex: 1;
    font-size: 1rem;
    height: 35px;
}

.inFile {
    display: flex;
    align-items: center;
    margin-top: 6px;
    gap: 35px;
}

.upload-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border: 2px solid var(--primary-blue);
    border-radius: 6px;
    background-color: white;
    color: var(--primary-blue);
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.upload-btn:hover {
    background-color: var(--primary-yellow-hover);
    border: 2px solid var(--primary-yellow-hover);
    color: white;
}

.upload-btn .material-icons {
    font-size: 19px;
}

.card-tooltip {
    position: absolute;
    top: 20px;
    right: 20px;
    cursor: pointer;
    display: inline-block;
}

.card-tooltip .material-icons {
    font-size: 22px;
    color: var(--primary-blue);
    transition: color 0.3s ease;
}

.card-tooltip:hover .material-icons {
    color: var(--primary-yellow-hover);
}

.card-tooltip .tooltiptext {
    visibility: hidden;
    width: 375px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 5px;
    padding: 10px;
    position: absolute;
    z-index: 10;
    top: 100%;
    right: 0;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    transition-delay: 0s;
}

/* Add invisible bridge area to make hovering easier */
.card-tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: -13px;
    right: 0;
    left: 0;
    height: 13px;
    background: transparent;
}

/* Add arrow pointing up to the tooltip */
.card-tooltip .tooltiptext::before {
    content: "";
    position: absolute;
    top: -5px;
    right: 10px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #333;
}

.card-tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
    transition-delay: 0.1s;
}

/* Keep tooltip visible when hovering over it */
.card-tooltip .tooltiptext:hover {
    visibility: visible;
    opacity: 1;
}

.bib-tooltip {
    position: relative;
    display: inline-block;
}

.bib-tooltip .tooltiptext {
    visibility: hidden !important;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 5px;
    padding: 10px;
    position: absolute;
    z-index: 10;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    opacity: 0 !important;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    transition-delay: 0s;
}

/* Add invisible bridge area to make hovering easier */
.bib-tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 8px;
    background: transparent;
}

/* Add arrow pointing down to the tooltip */
.bib-tooltip .tooltiptext::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #333;
}

.bib-tooltip:hover .tooltiptext {
    visibility: visible !important;
    opacity: 1 !important;
    transition-delay: 0.1s;
}

/* Keep tooltip visible when hovering over it */
.bib-tooltip .tooltiptext:hover {
    visibility: visible !important;
    opacity: 1 !important;
}

.disclaimer-footer {
    background-color: var(--primary-blue);
    color: #ffffff;
    text-align: center;
    padding: 15px 20px;
    font-size: 16px;
    width: 100%;
    margin-top: auto;
}
