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

@font-face {
    font-family: 'Fontin Sans';
    src: url('/static/fonts/Fontin-Sans-Small-Caps.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}



body {
    font-family: 'Fontin Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
}

.header {
    background: #16213e;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #0f3460;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: transform 0.3s ease-in-out;
}

.header.header-hidden {
    transform: translateY(-100%);
}

.header h1 {
    font-size: 1.5rem;
    color: #e94560;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-left h1 {
    white-space: nowrap;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 500;
}

.breadcrumb-back {
    color: #e94560;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-back:hover {
    text-decoration: underline;
    color: #ff6b8a;
}

.breadcrumb-separator {
    color: #555;
}

.breadcrumb-current {
    color: #e94560;
}

.nav {
    display: flex;
    gap: 1rem;
}

.nav a {
    color: #eee;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.nav a:hover {
    background: #0f3460;
}

.container {
    padding: 2rem;
    padding-top: 1rem;
    max-width: 1900px;
    margin: 0 auto;
}

.timestamps {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.75rem;
}

.timestamp-item {
    display: flex;
    gap: 0.5rem;
}

.timestamp-label {
    color: #888;
}

.timestamp-value {
    color: #4ade80;
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-1x1 { grid-template-columns: 1fr; }
.grid-1x2 { grid-template-columns: repeat(1, 1fr); }
.grid-1x3 { grid-template-columns: repeat(1, 1fr); }
.grid-2x1 { grid-template-columns: repeat(2, 1fr); }
.grid-2x2 { grid-template-columns: repeat(2, 1fr); }
.grid-2x3 { grid-template-columns: repeat(2, 1fr); }
.grid-3x1 { grid-template-columns: repeat(3, 1fr); }
.grid-3x2 { grid-template-columns: repeat(3, 1fr); }
.grid-3x3 { grid-template-columns: repeat(3, 1fr); }
.grid-4x1 { grid-template-columns: repeat(4, 1fr); }
.grid-4x2 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-1x1, .grid-1x2, .grid-1x3, .grid-2x1, .grid-2x2, .grid-2x3, .grid-3x1, .grid-3x2, .grid-3x3, .grid-4x1, .grid-4x2 {
        grid-template-columns: 1fr;
    }
}

.chart-container {
    background: #16213e;
    border-radius: 8px;
    padding: 1rem;
    /* border: 1px solid #0f3460; */
}

.chart-container h3 {
    margin-bottom: 0.5rem;
    color: #e94560;
    text-transform: capitalize;
    font-family: 'Fontin Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chart-wrapper {
    position: relative;
    max-height: 300px;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #888;
}

.latest-value {
    font-size: 1.2rem;
    color: #4ade80;
    margin-bottom: 0.5rem;
    font-weight: bold;
    font-family: 'Fontin Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* PoeNinja timestamps */
.poe-ninja-timestamps {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.poe-ninja-timestamps span {
    display: block;
    font-family: 'Fontin Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Pages list styles */
.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: #e94560;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

h2 {
    margin-bottom: 1.5rem;
    color: #e94560;
}

.pages-grid, .keys-grid, .items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.page-card, .key-card, .item-card {
    background: #16213e;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #0f3460;
    transition: transform 0.2s, border-color 0.2s;
    text-decoration: none;
    color: inherit;
}

.page-card:hover, .key-card:hover, .item-card:hover {
    transform: translateY(-2px);
    border-color: #e94560;
}

.page-card h3, .key-card h3, .item-card h3 {
    color: #e94560;
}

.grid-info {
    color: #888;
    font-size: 0.875rem;
}

.keys-list {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.key-tag {
    background: #0f3460;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #4ade80;
}

/* Stats styles */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-box {
    background: #16213e;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #0f3460;
    text-align: center;
}

.stat-label {
    color: #888;
    font-size: 0.875rem;
}

.stat-value {
    font-size: 1.25rem;
    color: #eee;
    margin-top: 0.25rem;
}

/* Settings controls */
.settings-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.settings-controls label {
    color: #888;
    font-size: 0.875rem;
}

.settings-controls select {
    background: #0f3460;
    color: #eee;
    border: 1px solid #16213e;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
}

.settings-controls select:hover {
    border-color: #e94560;
}

/* Chart navigation buttons */
.chart-nav-btn {
    font-family: 'Fontin Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f3460;
    color: #eee;
    border: 1px solid #16213e;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.chart-nav-btn:hover {
    background: #16213e;
    border-color: #e94560;
}

.chart-nav-btn-small {
    font-family: 'Fontin Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f3460;
    color: #eee;
    border: 1px solid #16213e;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.2s;
}

.chart-nav-btn-small:hover {
    background: #16213e;
    border-color: #e94560;
}

a:link, a:visited, a:hover, a:active {
  color: inherit;
  text-decoration: none;
}

/* Table view styles */
.table-container {
    max-width: 600px;
    margin: 0 auto;
}

.price-table {
    width: 100%;
    border-collapse: collapse;
    background: #16213e;
    border-radius: 8px;
    overflow: hidden;
}

.price-table th,
.price-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #0f3460;
}

.price-table th {
    background: #0f3460;
    color: #e94560;
    font-weight: normal;
}

.price-table td {
    color: #eee;
}

.price-table tr:last-child td {
    border-bottom: none;
}

.price-table tr:hover {
    background: #1a2a4a;
}

.price-table .item-name {
    font-weight: 500;
}

.price-table .price-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-table .price-value.chaos {
    color: rgb(250, 204, 21);
}

.price-table .price-value.divine {
    color: rgb(236, 72, 153);
}

.price-table .price-icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

/* Hide divine column by default, show only for stash items */
.price-table .divine-col {
    display: none;
}

/* Show divine column when table has stash items */
.price-table.show-divine .divine-col {
    display: table-cell;
}