/* Steal an Egg Tools - Pixel Art Style */
@font-face {
    font-family: 'VT323';
    src: url('/fonts/VT323-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'VT323', monospace;
    background-color: #1a1a2e;
    color: #eee;
    line-height: 1.6;
    font-size: 18px;
}

/* Remove underline from all links globally */
a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background-color: #16213e;
    border-bottom: 4px solid #0f3460;
    padding: 20px 0;
    margin-bottom: 30px;
}

header h1 {
    color: #e94560;
    font-size: 2.5rem;
    text-align: center;
    text-shadow: 2px 2px 0 #0f3460;
}

nav {
    text-align: center;
    margin-top: 20px;
}

nav a {
    color: #eee;
    text-decoration: none;
    margin: 0 15px;
    font-size: 1.3rem;
    border: 2px solid #0f3460;
    padding: 5px 15px;
    display: inline-block;
    transition: all 0.2s;
}

nav a:hover {
    background-color: #0f3460;
    color: #e94560;
}

/* Cards Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.card {
    background-color: #16213e;
    border: 4px solid #0f3460;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.3);
    border-color: #e94560;
}

.card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card a:visited {
    color: inherit;
}

.card a:active {
    transform: translateY(-2px);
}

.card-icon {
    margin: 10px 0;
}

.card h3 {
    color: #e94560;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.card .rarity {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.card .biome {
    font-size: 1rem;
    color: #888;
    margin-bottom: 5px;
}

.card .income {
    font-size: 1.2rem;
    color: #4ade80;
    font-weight: bold;
}

/* Detail Page */
.detail-header {
    text-align: center;
    margin-bottom: 30px;
}

.detail-icon {
    margin: 20px auto;
    text-align: center;
}

.detail-info {
    background-color: #16213e;
    border: 4px solid #0f3460;
    padding: 20px;
    margin: 20px 0;
}

.detail-info h2 {
    color: #e94560;
    margin-bottom: 15px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 2px solid #0f3460;
}

.stat-label {
    color: #888;
}

.stat-value {
    color: #4ade80;
    font-weight: bold;
}

/* Filters */
.filters {
    background-color: #16213e;
    border: 4px solid #0f3460;
    padding: 20px;
    margin: 20px 0;
}

.filter-group {
    margin-bottom: 15px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    color: #e94560;
}

.filter-group input {
    width: 100%;
    padding: 10px;
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    background-color: #1a1a2e;
    border: 2px solid #0f3460;
    color: #eee;
}

.filter-group input:focus {
    outline: none;
    border-color: #e94560;
}

/* Custom Dropdown Styles */
.custom-select {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    background-color: #1a1a2e;
    border: 2px solid #0f3460;
    color: #eee;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
}

.custom-select-trigger:hover {
    border-color: #e94560;
}

.custom-select-trigger.active {
    border-color: #e94560;
    border-bottom: 2px solid #0f3460;
}

.custom-select-options {
    position: absolute;
    display: block;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #1a1a2e;
    border: 2px solid #0f3460;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.custom-select-options.open {
    display: block;
}

.custom-select-option {
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
}

.custom-select-option:hover {
    background-color: #0f3460;
    color: #e94560;
}

.custom-select-option.selected {
    background-color: #0f3460;
    color: #e94560;
}

.custom-select-option.hidden {
    display: none;
}

.custom-select-arrow {
    transition: transform 0.2s;
}

.custom-select-arrow.rotate {
    transform: rotate(180deg);
}

/* Clear button for individual dropdowns */
.custom-select-clear {
    margin-left: 10px;
    cursor: pointer;
    color: #e94560;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.2s;
    display: none;
}

.custom-select-trigger.has-value .custom-select-clear {
    opacity: 1;
    display: block;
}

.custom-select-clear:hover {
    color: #ff6b8a;
}

/* Clear all filters button */
.clear-filters-btn {
    background-color: #e94560;
    color: white;
    border: none;
    padding: 10px 20px;
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 15px;
}

.clear-filters-btn:hover {
    background-color: #ff6b8a;
}

.clear-filters-btn:active {
    transform: translateY(1px);
}

/* Custom Select Search */
.custom-select-search {
    padding: 10px;
    border-bottom: 2px solid #0f3460;
    background-color: #1a1a2e;
}

.custom-select-search input {
    width: 100%;
    padding: 8px;
    font-family: 'VT323', monospace;
    font-size: 1rem;
    background-color: #16213e;
    border: 2px solid #0f3460;
    color: #eee;
    outline: none;
}

.custom-select-search input:focus {
    border-color: #e94560;
}

/* Scrollbar custom */
.custom-select-options::-webkit-scrollbar {
    width: 8px;
}

.custom-select-options::-webkit-scrollbar-track {
    background: #0f3460;
}

.custom-select-options::-webkit-scrollbar-thumb {
    background: #e94560;
    border-radius: 4px;
}

.custom-select-options::-webkit-scrollbar-thumb:hover {
    background: #ff6b8a;
}

/* Calculator */
.calculator {
    background-color: #16213e;
    border: 4px solid #0f3460;
    padding: 20px;
    margin: 20px 0;
}

.calculator h2 {
    color: #e94560;
    margin-bottom: 20px;
}

.calc-input {
    margin-bottom: 15px;
}

.calc-input label {
    display: block;
    margin-bottom: 5px;
    color: #e94560;
}

.calc-input input,
.calc-input select {
    width: 100%;
    padding: 10px;
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    background-color: #1a1a2e;
    border: 2px solid #0f3460;
    color: #eee;
}

.calc-result {
    background-color: #0f3460;
    padding: 15px;
    margin-top: 20px;
    border: 2px solid #e94560;
}

.calc-result h3 {
    color: #4ade80;
    margin-bottom: 10px;
}

.calc-result .value {
    font-size: 2rem;
    color: #e94560;
}

/* Footer */
footer {
    background-color: #16213e;
    border-top: 4px solid #0f3460;
    padding: 20px 0;
    margin-top: 50px;
    text-align: center;
    color: #888;
}

/* Charts */
.chart-container {
    background-color: #16213e;
    border: 4px solid #0f3460;
    padding: 20px;
    margin: 20px 0;
}

.chart-title {
    color: #e94560;
    font-size: 1.5rem;
    margin-bottom: 15px;
    text-align: center;
}

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.bar-chart-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bar-chart-label {
    width: 120px;
    text-align: right;
    font-size: 1rem;
    color: #888;
}

.bar-chart-bar-container {
    flex: 1;
    background-color: #0f3460;
    height: 30px;
    position: relative;
}

.bar-chart-bar {
    height: 100%;
    transition: width 0.3s;
}

.bar-chart-value {
    margin-left: 10px;
    min-width: 80px;
    color: #4ade80;
    font-weight: bold;
}

.pie-chart {
    width: 200px;
    height: 200px;
    margin: 20px auto;
    border-radius: 50%;
    position: relative;
}

.pie-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.pie-chart-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.pie-chart-legend-color {
    width: 15px;
    height: 15px;
    border-radius: 3px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stat-item {
    background-color: #0f3460;
    padding: 15px;
    text-align: center;
    border: 2px solid #16213e;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-label {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 5px;
    word-break: break-word;
}

.stat-value {
    color: #4ade80;
    font-size: 1.1rem;
    font-weight: bold;
    word-break: break-all;
    overflow-wrap: break-word;
    line-height: 1.2;
}

/* Responsive */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    nav a {
        display: block;
        margin: 5px 0;
    }
    
    .bar-chart-label {
        width: 80px;
        font-size: 0.8rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
}
