:root {
    --top-bar-height: 80px;
    --footer-height: 60px;
    --footer-gap: 20px;
    --sidebar-toggle-height: 40px;
    --sidebar-toggle-gap: 20px;
    --content-chevron-gap: 20px;
    --site-bg: url('https://images.lucande.io/galleries//background/bg_night.png');
}

@font-face {
    font-family: 'FFXIV_Lodestone_SSF';
    src: url('/static/fonts/FFXIV_Lodestone_SSF.woff') format('woff'),
         url('/static/fonts/FFXIV_Lodestone_SSF.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.ffxiv-glyph {
    font-family: 'FFXIV_Lodestone_SSF', sans-serif;
    font-weight: normal;
    font-style: normal;
    line-height: 1;
}

html, body {
    font-family: "Montserrat", sans-serif;
    font-optical-sizing: auto;
    margin: 0;
    padding: 0;
    background: var(--site-bg) no-repeat center center fixed;
    background-size: cover;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.top-bar {
    background: linear-gradient(150deg, rgba(14, 24, 40, 0.82), rgba(8, 14, 26, 0.88));
    backdrop-filter: blur(18px) saturate(140%);
    color: white;
    padding: 10px 20px;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    gap: 20px;
    box-shadow:
        0 16px 34px rgba(4, 10, 24, 0.4),
        inset 0 1px 0 rgba(210, 235, 255, 0.18),
        inset 0 -1px 0 rgba(4, 10, 24, 0.6);
}

.logo {
    flex: 0 0 auto;
    text-align: left;
    font-size: 24px;
}

.logo img {
    height: 50px;
}

.dropdown {
    position: relative;
}

.dropbtn {
    background: linear-gradient(180deg, rgba(12, 18, 30, 0.92), rgba(8, 12, 20, 0.95));
    color: rgba(236, 242, 255, 0.95);
    width: 260px;
    padding: 10px 44px; /* Explicit padding */
    border: 1px solid rgba(140, 190, 255, 0.4);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-family: "Tomorrow", sans-serif;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.2s ease, background 0.2s ease;
}

.admin-dropbtn {
    justify-content: flex-start;
    gap: 10px;
}

.dropdown-text {
    font-family: "Tomorrow", sans-serif;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-align: center;
    display: block;
    width: 100%;
}

.dropbtn .fa-user {
    position: absolute;
    left: 20px; /* Adjust this value as needed */
}


.dropdown-content {
    display: none;
    position: absolute;
    width: 260px;
    background: rgba(12, 16, 22, 0.95);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    border-radius: 12px;
    z-index: 1200;
    right: 0; /* Adjusted to ensure it stays within the page */
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 0;
}

.dropdown-content a {
    color: rgba(236, 242, 255, 0.9);
    padding: 10px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown:hover .dropbtn {
    border-color: rgba(160, 210, 255, 0.7);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(160, 210, 255, 0.25);
    transform: translateY(-1px);
}

.main-container {
    display: flex;
    margin-top: var(--top-bar-height);
    padding: 20px;
    box-sizing: border-box;

    flex: 1;
    flex-direction: row;
    align-items: flex-start; /* Ensure children don't stretch to each other's height */
}

/* Wrapper for the left side (sidebar) */
.left-side {
    width: 25%;
    padding-right: 20px;
    position: relative;
}

/* Wrapper for the right side (menu + content) */
.right-side {
    width: 75%;
    display: flex;
    flex-direction: column; /* Stack content */
    gap: 0;
}

.content {
    width: 100%;
    padding: 20px;
    background: linear-gradient(145deg, rgba(14, 24, 40, 0.78), rgba(8, 14, 26, 0.82));
    backdrop-filter: blur(18px) saturate(140%);
    color: white;
    box-sizing: border-box;
    border-radius: 10px;
    box-shadow:
        0 18px 40px rgba(4, 10, 24, 0.45),
        inset 0 1px 0 rgba(210, 235, 255, 0.18),
        inset 0 -1px 0 rgba(4, 10, 24, 0.5),
        inset 0 0 24px rgba(90, 150, 230, 0.18);
}

.sidebar {
    width: 100%;
    position: fixed;
    top: calc(var(--top-bar-height) + 20px);
    left: 20px;
    width: calc(25% - 20px);
    max-height: calc(100vh - var(--top-bar-height) - var(--footer-height) - 40px);
    overflow-y: auto;
    overflow-x: visible;
}

footer {
    background: linear-gradient(150deg, rgba(14, 24, 40, 0.78), rgba(8, 14, 26, 0.82));
    backdrop-filter: blur(18px) saturate(140%);
    color: white;
    padding: 10px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow:
        0 -12px 28px rgba(4, 10, 24, 0.35),
        inset 0 1px 0 rgba(210, 235, 255, 0.16),
        inset 0 -1px 0 rgba(4, 10, 24, 0.6);
}

footer.footer--console {
    padding: 10px;
}

footer.footer--no-console {
    padding: 20px !important;
}

.footer-left,
.footer-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-right {
    padding-right: 10px;
}

.footer--no-console .footer-right {
    padding-right: 20px;
}

.login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 10, 0.7);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.login-overlay.is-open {
    display: flex;
}

.login-panel {
    width: min(640px, 92vw);
    background: rgba(10, 16, 26, 0.96);
    border: 1px solid rgba(120, 160, 255, 0.35);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.login-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(8, 12, 20, 0.9);
}

.login-panel-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(235, 245, 255, 0.95);
}

.login-panel-close {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(120, 160, 255, 0.4);
    background: rgba(12, 18, 30, 0.85);
    color: rgba(230, 240, 255, 0.9);
    text-decoration: none;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
}

.login-panel-body {
    padding: 20px;
}

.footer-console-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
}

.console-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 10, 0.7);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.console-overlay.is-open {
    display: flex;
}

.console-panel {
    width: min(1100px, 92vw);
    height: min(720px, 84vh);
    background: rgba(10, 16, 26, 0.96);
    border: 1px solid rgba(120, 160, 255, 0.35);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.console-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(8, 12, 20, 0.9);
}

.console-panel-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(235, 245, 255, 0.95);
}

.console-panel-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.console-panel-link,
.console-panel-close {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(120, 160, 255, 0.4);
    background: rgba(12, 18, 30, 0.85);
    color: rgba(230, 240, 255, 0.9);
    text-decoration: none;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
}

.console-panel-close {
    background: rgba(24, 12, 16, 0.9);
    border-color: rgba(255, 140, 140, 0.5);
}

.console-panel-body {
    flex: 1;
    width: 100%;
    overflow: auto;
    padding: 16px;
    background: rgba(6, 10, 18, 0.95);
    box-sizing: border-box;
}

.console-panel-error {
    color: rgba(255, 190, 190, 0.9);
    font-size: 13px;
}


.fancy-header {
    font-family: 'Jacquard 24', system-ui;
    font-size: 3em; /* Adjusted font size */
    font-weight: bold; /* Added font weight */
    text-align: center;
    color: white;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7); /* Adjusted shadow */
    -webkit-font-smoothing: antialiased; /* Added anti-aliasing */
    -moz-osx-font-smoothing: grayscale; /* Added anti-aliasing */
    position: relative;
    margin-top: 0px;
    margin-bottom: 40px;
    padding: 20px 0;
    background:
        linear-gradient(to right, transparent, rgba(0, 0, 255, 0.5) 25%, rgba(0, 0, 255, 0.5) 75%, transparent),
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 10 10"><rect width="5" height="5" fill="rgba(0,0,255,0.2)"/><rect x="5" y="5" width="5" height="5" fill="rgba(0,0,255,0.2)"/></svg>');
    background-size: cover, 10px 10px;
    background-repeat: no-repeat, repeat;
    border-top: 2px solid white;
    border-bottom: 2px solid white;
    border-image: linear-gradient(to right, transparent, white, white, transparent) 1; /* Adjusted gradient */
}

.fancy-header::before, .fancy-header::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, transparent, white, white, transparent); /* Adjusted gradient */
}

.fancy-header::before {
    top: -2px;
}

.fancy-header::after {
    bottom: -2px;
}


/* General button styles */
button {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    padding: 10px 20px;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: rgba(0, 0, 0, 1);
}


/* Table styles */
.actions {
    text-align: right;
}

/* Darker header background with rounded corners on top */
.dark-table thead {
    background-color: rgba(0, 0, 0, 0.9); /* Darker background for the heading */
}

.dark-table table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden; /* Ensure rounded corners are applied */
    margin-top: 20px;
}

.dark-table th, td {
    text-align: left;
    padding: 12px;
}

.dark-table {
    color: white;
}

.dark-table tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.8);
}

.dark-table tr:nth-child(odd) {
    background-color: rgba(0, 0, 0, 0.6);
}

.dark-table tr td:first-child,
.dark-table tr th:first-child {
    border-left: none;
}

.dark-table tr td:last-child,
.dark-table tr th:last-child {
    border-right: none;
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.page-link {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    padding: 10px 20px;
    margin: 0 5px;
    text-decoration: none;
}

.page-link:hover {
    background-color: rgba(0, 0, 0, 1);
}

.admin-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.admin-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    inline-size: 56px;
    block-size: 46px;
    margin: 0;
    padding: 0;
    border-radius: 10px;
    border: 1px solid rgba(103, 144, 244, 0.22);
    background: linear-gradient(180deg, rgba(20, 28, 43, 0.98), rgba(10, 15, 25, 0.98));
    color: rgba(239, 245, 255, 0.95);
    font-family: "Michroma", sans-serif;
    font-size: 18px;
    line-height: 1;
    text-decoration: none;
    transition: transform 0.16s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.admin-page-link:hover {
    background: linear-gradient(180deg, rgba(31, 46, 74, 1), rgba(15, 22, 36, 1));
    border-color: rgba(127, 176, 255, 0.48);
    box-shadow: 0 8px 18px rgba(26, 83, 190, 0.34);
    transform: translateY(-1px);
}

.admin-page-link.active {
    background: linear-gradient(180deg, rgba(67, 136, 252, 0.95), rgba(40, 102, 224, 0.92));
    border-color: rgba(186, 218, 255, 0.75);
    box-shadow: 0 0 0 2px rgba(100, 156, 255, 0.24), 0 10px 20px rgba(34, 81, 166, 0.38);
    color: #ffffff;
}

.admin-page-link.nav-link {
    inline-size: auto;
    min-width: 92px;
    padding: 0 14px;
    font-family: "Montserrat", sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .admin-pagination {
        gap: 6px;
    }

    .admin-page-link {
        inline-size: 44px;
        block-size: 36px;
        border-radius: 8px;
        font-size: 12px;
    }

    .admin-page-link.nav-link {
        min-width: 78px;
        padding: 0 10px;
        font-size: 11px;
    }
}

.sidebar-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.admin-nav-button {
    width: 100%;
    margin: 0;
    justify-content: center;
    text-align: center;
    padding: 10px 18px;
    border-radius: 12px;
    color: rgba(236, 242, 255, 0.95);
    text-decoration: none;
    box-sizing: border-box;
    min-width: 0;
}

.admin-panel {
    font-family: "Tomorrow", sans-serif;
    text-align: center;
}

.admin-panel-title {
    font-family: "Tomorrow", sans-serif;
    text-align: center;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-panel .nunito {
    font-family: "Tomorrow", sans-serif;
    text-align: center;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin_data {
    width: 100%;
}

.admin-nav-button:hover {
    transform: translateY(-1px);
}

.main-menu {
    display: flex;
    gap: 20px;
    height: 50px;
    flex: 1;
    justify-content: center;
    align-items: center;
    min-width: 0;
}

.main-menu-button,
.footer-console-btn {
    position: relative;
    background: linear-gradient(180deg, rgba(12, 18, 30, 0.92), rgba(8, 12, 20, 0.95));
    color: rgba(236, 242, 255, 0.95);
    border: 1px solid rgba(140, 190, 255, 0.4);
    border-radius: 12px;
    cursor: pointer;
    padding: 10px 20px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.2s ease, background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Tomorrow", sans-serif;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(140, 190, 255, 0.18);
    backdrop-filter: blur(8px);
}

.main-menu-button {
    width: 15%;
    min-width: 120px;
}

.main-menu-button .fa-caret-down {
    margin-left: 6px;
}

.main-menu-button:hover,
.footer-console-btn:hover {
    border-color: rgba(160, 210, 255, 0.7);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(160, 210, 255, 0.25);
    transform: translateY(-1px);
}

.main-menu-button:hover .main-menu-dropdown {
    display: block;
}

.admin-nav-button {
    text-decoration: none;
}

.main-menu-dropdown {
    display: none;
    position: absolute;
    background: rgba(12, 16, 22, 0.95);
    width: 100%;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    border-radius: 12px;
    z-index: 999; /* Ensure it appears above other content */
    top: 100%; /* Position just below the button */
    left: 0; /* Align with the button */
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 0;
}

.main-menu-dropdown a {
    display: block;
    color: rgba(236, 242, 255, 0.9);
    padding: 10px 12px;
    text-decoration: none;
    text-align: center;
}

.main-menu-dropdown a:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.button-margin {
    margin-right: 10px; /* Adjust the margin as needed */
}

.sidebar-toggle {
    display: none;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 0;
    padding: 12px;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    margin-top: 20px;
    margin-bottom: 10px;
    position: relative;
    height: 40px;
}

.animal-icon-composite {
    --animal-icon-size: 48px;
    --animal-icon-bg-scale: 0.1875; /* 48 / 256 */
    position: relative;
    display: inline-block;
    width: var(--animal-icon-size);
    height: var(--animal-icon-size);
    overflow: hidden;
    vertical-align: middle;
    line-height: 0;
    flex: 0 0 var(--animal-icon-size);
}

.animal-icon-composite-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 256px;
    height: 256px;
    object-fit: none;
    object-position: center center;
    transform: translate(-50%, -50%) scale(var(--animal-icon-bg-scale));
    transform-origin: center center;
    pointer-events: none;
    user-select: none;
}

.animal-icon-composite-fg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.animal-icon-composite.party-animal-icon {
    --animal-icon-size: 48px;
    --animal-icon-bg-scale: 0.1875;
    border-radius: 50%;
}

.animal-icon-composite.table-animal-icon {
    --animal-icon-size: 32px;
    --animal-icon-bg-scale: 0.125;
}

.animal-icon-composite.map-animal-icon {
    --animal-icon-size: 50px;
    --animal-icon-bg-scale: 0.1953125;
}

.animal-icon-composite.encounter-animal-icon {
    --animal-icon-size: 56px;
    --animal-icon-bg-scale: 0.21875;
    border-radius: 50%;
}

.animal-icon-composite.node-slot-icon {
    --animal-icon-size: 70px;
    --animal-icon-bg-scale: 0.2734375;
    border-radius: 50%;
}

.animal-icon-composite.node-creature-image {
    --animal-icon-size: 48px;
    --animal-icon-bg-scale: 0.1875;
}

/* Media query for tablets/smaller devices and narrow viewports by aspect ratio */
@media (max-width: 1024px), (max-aspect-ratio: 1430 / 1020) {
    :root {
        --top-bar-height: 120px;
    }

    .main-container {
        flex-direction: column;
        position: sticky;
        margin-top: 70px;
        padding-top: 0;
        padding-bottom: calc(var(--footer-height) + var(--footer-gap) + var(--sidebar-toggle-height) + var(--content-chevron-gap));
        gap: 0;
    }

    .sidebar {
        width: 100%;
        margin-left: 0;
        margin-bottom: 0;
    }

    .content {
        width: 100%;
    }

    .main-menu-button {
        margin-bottom: 10px;
        width: auto;
        min-width: 0;
    }

    .left-side {
        width: 100%;
        order: 2;
        display: none;
    }

    .right-side {
        width: 100%;
        order: 1;
        gap: 0;
        flex: 1;
        margin-bottom: 0;
    }

    body.sidebar-open .left-side {
        display: block;
        position: fixed;
        top: calc(var(--top-bar-height) + 70px);
        left: 20px;
        right: 20px;
        bottom: calc(var(--footer-height) + var(--footer-gap) + var(--sidebar-toggle-height) + var(--sidebar-toggle-gap));
        width: auto;
        padding: 0;
        z-index: 3;
        height: auto;
        max-height: calc(100vh - var(--top-bar-height) - var(--footer-height) - 140px);
        overflow-y: auto;
        overflow-x: visible;
    }

    body.sidebar-open .sidebar {
        position: static;
        top: auto;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        gap: 20px;
        height: 100%;
    }

    .sidebar-toggle {
        display: flex;
        z-index: 1001;
        margin-top: 0;
        margin-bottom: 0;
        order: 3;
        position: fixed;
        left: 20px;
        right: auto;
        width: calc(100% - 40px);
        bottom: calc(var(--footer-height) + var(--footer-gap));
    }

    .top-bar {
        flex-wrap: wrap;
        row-gap: 10px;
    }

    .main-menu {
        width: 100%;
        order: 2;
        justify-content: center;
        flex-wrap: wrap;
        height: auto;
    }

    .main-menu-button {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 92px;
        width: auto;
        flex: 0 0 auto;
    }

    .content {
        order: 2;
    }

    .right-side > .explore-container {
        order: 2;
    }


    body.sidebar-open::before {
        content: "";
        position: fixed;
        left: 0;
        top: auto;
        bottom: var(--footer-height);
        width: 100%;
        height: calc(87.5vh - var(--footer-height));
        background: linear-gradient(0deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.75) 55%, rgba(0, 0, 0, 0) 100%);
        z-index: 1;
        pointer-events: none;
    }

    footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: var(--footer-height);
        padding: 0 20px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        z-index: 1000;
    }

    .main-container {
        position: relative;
        z-index: 2;
    }

    .top-bar {
        z-index: 1100;
    }

    .sidebar-toggle i {
        position: absolute;
        left: 50%;
        transform: translateX(-50%) scaleX(8);
        font-size: 18px;
    }

    .sidebar-toggle i:first-child {
        top: 8px;
    }

    .sidebar-toggle i:last-child {
        top: 18px;
    }

    .animal-icon-composite.party-animal-icon {
        --animal-icon-size: 32px;
        --animal-icon-bg-scale: 0.125;
    }
}
