/* Scope variables to avrae-manager app to prevent conflicts with site navigation */
.avrae-manager-app {
    --bg: #2c2f33;
    --panel: #23272a;
    --text: #ffffff;
    --blur: #99aab5;
    --accent: #5865f2;
    --danger: #ed4245;
    --success: #57f287;
    --input-bg: #40444b;

    /* Global variables for auth component */
    --font-header: 'Segoe UI', sans-serif;
    --color-text-secondary: #99aab5;
    --color-bg-light: #23272a;
    --color-border: #444;
    --color-primary: #5865f2;
    --color-text: #ffffff;

    /* Apply styles directly to the app container */
    font-family: 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.header {
    background: var(--panel);
    padding: 5px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
    height: 40px;
}

.header h3 {
    font-size: 0.9em;
    margin: 0;
    color: var(--accent);
}

.menu-container {
    position: relative;
}

.hamburger {
    cursor: pointer;
    font-size: 1.5em;
    padding: 0 10px;
}

.menu-dropdown {
    position: absolute;
    right: 0;
    top: 35px;
    background: var(--panel);
    border: 1px solid #444;
    border-radius: 4px;
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    z-index: 100;
    min-width: 180px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.menu-dropdown.active {
    display: flex;
}

.menu-dropdown button {
    text-align: left;
    width: 100%;
    font-size: 0.8em;
    padding: 8px;
    background: #40444b;
    color: white;
    margin-bottom: 2px;
    border: none;
    cursor: pointer;
}

.menu-dropdown button:hover {
    background: #4f545c;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 500px;
    background: var(--panel);
    overflow-y: auto;
    padding: 15px;
    border-right: 1px solid #444;
    display: flex;
    flex-direction: column;
}

.map-area {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    background: #1a1c1e;
    overflow: scroll !important;
    padding: 10px;
}

.tab-bar {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    border-bottom: 1px solid #444;
}

.tab {
    padding: 6px 10px;
    cursor: pointer;
    background: #40444b;
    border-radius: 4px 4px 0 0;
    font-size: 0.75em;
    font-weight: bold;
}

.tab.active {
    background: var(--accent);
}

.tab-content {
    display: none;
    flex: 1;
}

.tab-content.active {
    display: block;
}

.control-strip {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    align-items: center;
    background: #2f3136;
    padding: 8px;
    border-radius: 4px;
}

.control-strip button {
    flex: 1;
    padding: 6px;
    font-size: 0.75em;
    background: #4f545c;
    color: white;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

.control-strip button:hover {
    background: #5d6269;
}

.grid-row {
    display: grid;
    grid-template-columns: 25px 1fr 1.5fr 1fr 0.6fr 90px;
    gap: 8px;
    margin-bottom: 6px;
    padding: 8px;
    background: #2f3136;
    border-radius: 4px;
    border-left: 3px solid transparent;
    align-items: end;
    position: relative;
}

.npc-row,
.monster-row {
    grid-template-columns: 25px 1fr 1.5fr 1fr 0.6fr 90px;
}

.player-row {
    grid-template-columns: 25px 0.8fr 1.5fr 0.8fr 90px;
    border-left-color: var(--accent);
}

.npc-row {
    border-left-color: #fee75c;
}

.monster-row {
    border-left-color: var(--danger);
}

input[type="text"],
input[type="number"] {
    background: var(--input-bg);
    border: 1px solid #222;
    color: white;
    padding: 4px;
    border-radius: 3px;
    width: 100%;
    font-size: 0.85em;
    box-sizing: border-box;
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin-bottom: 6px;
}

.select-all-box {
    margin-bottom: 0 !important;
}

label {
    font-size: 0.6em;
    color: var(--blur);
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
}

/* AUTOCOMPLETE STYLES */
.autocomplete-list {
    position: absolute;
    border: 1px solid #444;
    border-bottom: none;
    border-top: none;
    z-index: 999;
    top: 100%;
    left: 5px;
    right: 0;
    background-color: var(--panel);
    max-height: 200px;
    overflow-y: auto;
    border-radius: 0 0 4px 4px;
    width: 95%;
}

.autocomplete-item {
    padding: 8px;
    cursor: pointer;
    background-color: #2f3136;
    border-bottom: 1px solid #444;
    font-size: 0.85em;
    color: #ccc;
}

.autocomplete-item:hover {
    background-color: var(--accent);
    color: white;
}

.autocomplete-item strong {
    color: white;
}

.output-box {
    background: #000;
    color: var(--success);
    padding: 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.75em;
    margin-top: 5px;
    border: 1px solid #333;
    cursor: pointer;
    word-break: break-all;
    position: relative;
    transition: background 0.2s;
}

.output-box:hover {
    background: #111;
}

.btn-group {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 5px;
}

.move-btn {
    background: #4f545c;
    color: white;
    padding: 6px 10px;
    font-size: 0.9em;
    border-radius: 4px;
    width: 40px;
    border: none;
    cursor: pointer;
}

canvas {
    background: #000;
}

@keyframes flash-white {
    0% {
        background-color: rgba(255, 255, 255, 0.6);
    }

    100% {
        background-color: transparent;
    }
}

.clicked-flash {
    animation: flash-white 0.3s ease-out;
}

/* MODAL STYLES */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--panel);
    padding: 20px;
    border-radius: 5px;
    border: 1px solid #444;
    width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.modal-header {
    font-size: 1.2em;
    color: var(--accent);
    margin-bottom: 15px;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
}

.modal-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.modal-table th {
    text-align: left;
    color: var(--blur);
    font-size: 0.7em;
    text-transform: uppercase;
    padding: 5px;
    border-bottom: 1px solid #444;
}

.modal-table td {
    padding: 5px;
    vertical-align: middle;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #444;
    padding-top: 10px;
}

.action-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
}

.close-btn {
    background: #4f545c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 3px;
    cursor: pointer;
}

/* Map Search & Toggle Styles */
.toggle-group {
    display: flex;
    background: #2f3136;
    padding: 4px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.toggle-btn {
    flex: 1;
    padding: 6px;
    font-size: 0.75em;
    background: transparent;
    color: var(--blur);
    border: none;
    cursor: pointer;
    border-radius: 3px;
    font-weight: bold;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: var(--accent);
    color: white;
}

.map-search-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-results {
    max-height: 300px;
    overflow-y: auto;
    background: #1e1f22;
    border-radius: 4px;
    border: 1px solid #444;
}

.map-result {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-bottom: 1px solid #333;
    cursor: pointer;
    transition: background 0.2s;
}

.map-result:hover {
    background: #2b2d31;
}

.map-result-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    background: #000;
}

.map-result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.map-result-name {
    font-size: 0.9em;
    font-weight: bold;
    color: white;
}

.map-result-meta {
    font-size: 0.75em;
    color: var(--blur);
}

/* Config Section Styles (Sidebar) */
.config-section {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.section-label {
    font-size: 0.8em;
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 10px;
    display: block;
    letter-spacing: 0.5px;
}

#mapPPC {
    background: var(--input-bg);
    border: 1px solid #444;
    color: var(--success);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: bold;
    text-align: right;
    width: 60px;
}

/* Info Accordion */
.info-accordion {
    background: rgba(88, 101, 242, 0.05);
    border: 1px solid rgba(88, 101, 242, 0.3);
    border-radius: 4px;
    margin-bottom: 15px;
    overflow: hidden;
}

.info-accordion summary {
    padding: 10px;
    cursor: pointer;
    font-weight: bold;
    color: var(--accent);
    font-size: 0.8em;
    text-transform: uppercase;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-accordion summary::before {
    content: "ℹ️";
    font-size: 1.2em;
}

.info-accordion .info-content {
    padding: 0 10px 10px 10px;
    font-size: 0.85em;
    color: #ccc;
    text-align: left;
    line-height: 1.5;
}

.info-accordion .info-content p {
    margin: 5px 0;
}

.info-accordion[open] {
    background: rgba(88, 101, 242, 0.1);
    border-color: var(--accent);
}

/* Session list item styles */
.session-item {
    transition: all 0.2s ease;
}

.session-item:hover {
    background: #40444b !important;
    transform: translateX(4px);
}