/* styles.css */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

/* THEME: Copied directly from the Astroneer stylesheet */
:root {
    --primary-bg: #000000;
    --secondary-bg: #1e1e1e;
    --text-color: #ffffff;
    --accent-color: #8b0000;
    --hover-accent: #333333;
    --border-color: #333333;
    --header-color: #ffffff;
    --search-border: #8b0000;
    --search-border-focus: #f44336;
    --transition-speed: 0.3s;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family), serif;
    background-color: var(--primary-bg);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* THEME: Title styled to match Astroneer's H1 */
.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--header-color); /* Changed from accent-color to white */
    margin-bottom: 20px;
}

/* THEME: Search bar styled to match Astroneer (including red glow) */
.search-container {
    max-width: 600px;
    margin: 0 auto 40px auto;
}

#search-box {
    width: 100%;
    padding: 10px 15px;
    border-radius: 5px;
    border: 1px solid var(--search-border);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5); /* Red glow effect */
    background-color: var(--secondary-bg);
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color var(--transition-speed);
}

#search-box:focus {
    outline: none;
    border-color: var(--search-border-focus);
}

/* Main Content */
main {
    padding: 40px 0;
}

h3 {
    font-size: 1.5rem;
    color: var(--text-color);
}

/* THEME: Accordion styles matched to Astroneer */
.accordion {
    background-color: var(--secondary-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin-bottom: 10px;
    padding: 15px;
    width: 100%;
    text-align: left;
    outline: none;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.accordion:hover {
    background-color: var(--hover-accent);
}

.accordion::after {
    content: '\25BC'; /* Downward arrow like Astroneer */
    font-size: 1rem;
    float: right;
    transition: transform var(--transition-speed);
}

.accordion.active::after {
    transform: rotate(180deg);
}

/* THEME: Panel styles matched to Astroneer (red left border) */
.panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    padding: 0 18px;
    background-color: var(--primary-bg);
    margin-bottom: 10px;
}

.panel.show {
    padding: 18px;
    border-left: 4px solid var(--accent-color);
}

/* Item Card Styles */
.item-card {
    background-color: var(--secondary-bg); /* THEME: Matched to Astroneer's item cards */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    transition: background-color var(--transition-speed);
}

.item-card:hover {
    background-color: var(--hover-accent); /* THEME: Matched hover effect */
}

/* The grid layout for the cards inside a panel */
.panel.show {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 15px;
}

.item-card h4 {
    color: var(--accent-color);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.item-card p {
    font-size: 0.95rem;
    margin-bottom: 5px;
    color: #cccccc;
}

.item-card p strong {
    color: var(--text-color);
}

/* All the specific card styles for creatures, weapons, etc. can remain the same */
/* ... (all .combat-card, .creature-card, .weapon-card styles etc. are here) ... */
.combat-card, .creature-card, .weapon-card, .armor-card {
    min-height: 200px;
}

.combat-header, .creature-header, .weapon-header, .armor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.combat-header h4, .creature-header h4, .weapon-header h4, .armor-header h4 {
    margin-bottom: 0;
    flex: 1;
}

.strategy-badge, .threat-badge, .tier-badge {
    font-size: 0.75rem !important;
    padding: 3px 8px !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.strategy-badge.offensive {
    background-color: #e74c3c;
    color: white;
}

.strategy-badge.defensive {
    background-color: #3498db;
    color: white;
}

.strategy-badge.balanced {
    background-color: #f39c12;
    color: white;
}

.strategy-badge.unknown {
    background-color: #95a5a6;
    color: white;
}

.combat-stats, .creature-stats, .weapon-stats, .armor-stats {
    margin-bottom: 12px;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.weakness-combat {
    color: #e67e22 !important;
    font-weight: 600;
}

.resistance-combat {
    color: #3498db !important;
    font-weight: 600;
}

.combat-strategy {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.combat-strategy p {
    font-size: 0.9rem;
    font-style: italic;
    color: #cccccc;
    line-height: 1.4;
}

.behavior-aggressive {
    color: #e74c3c !important;
    font-weight: 600;
}

.behavior-passive {
    color: #27ae60 !important;
    font-weight: 600;
}

.behavior-neutral {
    color: #f39c12 !important;
    font-weight: 600;
}

.behavior-boss {
    color: #8b0000 !important;
    font-weight: 600;
}

.health-value {
    color: #e74c3c !important;
    font-weight: 600;
}

.damage-type {
    color: #9b59b6 !important;
    font-weight: 600;
}

.weakness-value {
    color: #e67e22 !important;
    font-weight: 600;
}

.resistance-value {
    color: #3498db !important;
    font-weight: 600;
}

.tameable {
    color: #27ae60 !important;
    font-weight: 600;
}

.not-tameable {
    color: #95a5a6 !important;
}

.creature-details {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.creature-details p, .weapon-details p, .armor-details p {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.creature-details p:last-child, .weapon-details p:last-child, .armor-details p:last-child {
    margin-bottom: 0;
}

.damage-value {
    color: #e74c3c !important;
    font-weight: 600;
}

.high-crit {
    color: #f1c40f !important;
    font-weight: 600;
    text-shadow: 0 0 3px rgba(241, 196, 64, 0.3);
}

.normal-crit {
    color: #95a5a6 !important;
    font-weight: 600;
}

.fast-speed {
    color: #2ecc71 !important;
    font-weight: 600;
}

.slow-speed {
    color: #e67e22 !important;
    font-weight: 600;
}

.normal-speed {
    color: #3498db !important;
    font-weight: 600;
}

.durability-value {
    color: #9b59b6 !important;
    font-weight: 600;
}

.station-value {
    color: #1abc9c !important;
    font-weight: 600;
}

.weapon-details {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.stat-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 4px;
}

.stat-row:last-child {
    margin-bottom: 0;
}

.stat-row p {
    margin-bottom: 2px;
    font-size: 0.9rem;
}

.stat-value {
    color: #4a90e2 !important;
    font-weight: 600;
}

.armor-details {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.positive-stat {
    color: #27ae60 !important;
}

.negative-stat {
    color: #e74c3c !important;
}

.upgrade-value {
    color: #ffa500 !important;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 900px) {
    .panel.show {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 600px) {
    .panel.show {
        grid-template-columns: 1fr;
    }

    .accordion {
        font-size: 1rem;
        padding: 10px;
    }

    .page-title {
        font-size: 2rem;
    }
}