/* Import futuristic font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');

:root {
    /* Light Theme (Default) */
    --bg-color: #f4f4f9;
    --surface-color: #ffffff;
    --text-color: #333333;
    --primary-color: #007bff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 5px rgba(0,0,0,0.1);
    --header-bg: #ffffff;
    --header-height: 60px;
    --nav-height: 60px;
    --font-main: 'Orbitron', sans-serif;
}

[data-theme="dark"] {
    /* Spartan Dark Theme */
    --bg-color: #0f1115;
    --surface-color: #1a2533; /* Spartan Navy */
    --text-color: #b0b3b8;
    --primary-color: #4c8c4a; /* Spartan Green */
    --border-color: #2d3846;
    --header-bg: #1a2533;
    --shadow: 0 2px 5px rgba(0,0,0,0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    padding-bottom: var(--nav-height); /* Space for bottom nav */
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between; /* Changed for hamburger menu */
    padding: 0 1rem;
    z-index: 100;
    box-shadow: var(--shadow);
}

.app-header h1 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

h1, h2, h3 {
    font-family: var(--font-main);
    letter-spacing: 1px;
}

#hamburger-btn {
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
}

.resource-display {
    position: absolute;
    top: 60px;
    left: 1rem;
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: var(--font-main);
    font-size: 0.9rem;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 200px;
}

/* Outer wrapper for each line */
.resource-display span {
    display: flex;
    justify-content: space-between; 
    align-items: center;
}

/* Inner wrapper for Icon + Text */
.res-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.res-label i {
    font-style: normal;
    width: 20px;
    display: inline-block;
    text-align: center;
}

.resource-display strong {
    font-variant-numeric: tabular-nums;
    color: #00ffcc;
}

/* Sidenav Styles */
.sidenav {
    height: 100%;
    width: 0; /* Start hidden */
    position: fixed;
    z-index: 200;
    top: 0;
    left: 0;
    background-color: var(--surface-color);
    overflow-x: hidden;
    transition: 0.3s;
    padding-top: 60px;
    box-shadow: 3px 0 6px rgba(0,0,0,0.2);
}

.sidenav a.closebtn {
    position: absolute;
    top: 0;
    right: 25px;
    font-size: 36px;
    margin-left: 50px;
    color: var(--text-color);
    text-decoration: none;
}

.sidenav h2 {
    padding: 8px 8px 8px 32px;
}

.sidenav-item {
    padding: 8px 32px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidenav-item input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.overlay {
    position: fixed;
    display: none;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 150;
    transition: opacity 0.3s;
}

.header-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Main Layout */
main {
    padding: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

/* Components */
.card {
    background-color: var(--surface-color);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-top: 1rem;
}

button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    font-size: 1rem;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-btn {
    background: none;
    color: var(--text-color);
    opacity: 0.6;
}

.nav-btn.active {
    opacity: 1;
    font-weight: bold;
    color: var(--primary-color);
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 300;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: var(--surface-color);
    margin: auto;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    color: var(--text-color);
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--primary-color);
    text-decoration: none;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Spartan Theme Components */
.spartan-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: var(--header-bg);
    color: var(--text-color);
    font-size: 0.9rem;
}
.spartan-table th, .spartan-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.spartan-table th {
    background-color: rgba(76, 140, 74, 0.2); /* Green tint */
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-main);
}
.gamertag-tag {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-color);
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
}
.gamertag-tag button {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-weight: bold;
    padding: 0 0.5rem;
}
.report-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.info-btn {
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    padding: 0;
    font-size: 0.9rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}
.info-btn:hover {
    opacity: 1;
    background-color: rgba(128, 128, 128, 0.2);
}