/* style-monster-picker.css */

/* Basic Reset within the tool */
.beast-feast-monster-tool * {
    box-sizing: border-box;
}

/* Remove margin/padding conflicts */
.beast-feast-monster-tool .container,
.beast-feast-monster-tool .header,
.beast-feast-monster-tool .controls,
.beast-feast-monster-tool .stats,
.beast-feast-monster-tool .monsters-grid,
.beast-feast-monster-tool .stat-card,
.beast-feast-monster-tool .monster-card,
.beast-feast-monster-tool .feature {
    margin: 0;
    padding: 0;
}

/* Apply styles only inside the tool container */
.beast-feast-monster-tool {
    --mp-bg-dark: #1a1a2e;
    --mp-bg-mid: #16213e;
    --mp-bg-light: #0f3460;
    --mp-text-light: #e0e0e0;
    --mp-text-subtle: #b0b0b0;
    --mp-accent-teal: #4ecdc4;
    --mp-accent-red: #ff6b6b;
    --mp-accent-blue: #45b7d1;
    --mp-panel-bg: rgba(255, 255, 255, 0.1);
    --mp-panel-border: rgba(255, 255, 255, 0.2);
    --mp-input-bg: rgba(255, 255, 255, 0.1);
    --mp-input-border: rgba(255, 255, 255, 0.3);

    color: var(--mp-text-light);
    padding: 15px;
    border-radius: 8px;
    width: 100%;
}

.beast-feast-monster-tool .header {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--mp-panel-bg);
    border-radius: 10px;
    border: 1px solid var(--mp-panel-border);
}

.beast-feast-monster-tool .header h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    background: linear-gradient(45deg, var(--mp-accent-red), var(--mp-accent-teal), var(--mp-accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.beast-feast-monster-tool .header p {
    font-size: 0.9rem;
    color: var(--mp-text-subtle);
}

.beast-feast-monster-tool .controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.beast-feast-monster-tool .control-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.beast-feast-monster-tool .control-group label {
    font-size: 0.8rem;
    color: var(--mp-text-subtle);
}

.beast-feast-monster-tool select,
.beast-feast-monster-tool input,
.beast-feast-monster-tool button {
    padding: 8px 12px;
    border: 1px solid var(--mp-input-border);
    border-radius: 6px;
    background: var(--mp-input-bg);
    color: var(--mp-text-light);
    font-size: 0.9rem;
}

.beast-feast-monster-tool select option {
    background: var(--mp-bg-mid);
    color: var(--mp-text-light);
}

.beast-feast-monster-tool select:focus,
.beast-feast-monster-tool input:focus {
    outline: none;
    border-color: var(--mp-accent-teal);
    box-shadow: 0 0 8px rgba(78, 205, 196, 0.3);
}

.beast-feast-monster-tool button {
    background: linear-gradient(45deg, var(--mp-accent-red), var(--mp-accent-teal));
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
    min-width: 100px;
}

.beast-feast-monster-tool button:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.beast-feast-monster-tool .stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.beast-feast-monster-tool .stat-card {
    background: var(--mp-panel-bg);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--mp-panel-border);
}

.beast-feast-monster-tool .stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--mp-accent-teal);
}

.beast-feast-monster-tool .stat-label {
    font-size: 0.8rem;
    color: var(--mp-text-subtle);
    margin-top: 3px;
}

.beast-feast-monster-tool .monsters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.beast-feast-monster-tool .monster-card {
    background: var(--mp-panel-bg);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid var(--mp-panel-border);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.beast-feast-monster-tool .monster-card.selected::after {
    content: "★";
    position: absolute;
    top: 8px;
    right: 8px;
    color: gold;
    font-size: 1.2em;
    opacity: 0.8;
}

.beast-feast-monster-tool .monster-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--mp-accent-teal);
}

.beast-feast-monster-tool .monster-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.beast-feast-monster-tool .monster-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--mp-text-light);
    margin-bottom: 3px;
}

.beast-feast-monster-tool .monster-type {
    font-size: 0.8rem;
    color: var(--mp-accent-teal);
    font-style: italic;
}

.beast-feast-monster-tool .monster-level {
    background: linear-gradient(45deg, var(--mp-accent-red), #ffa500);
    color: white;
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: bold;
}

.beast-feast-monster-tool .monster-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.beast-feast-monster-tool .stat {
    text-align: center;
    background: var(--mp-input-bg);
    padding: 6px;
    border-radius: 6px;
}

.beast-feast-monster-tool .stat-value {
    font-weight: bold;
    color: var(--mp-accent-teal);
    font-size: 0.9rem;
}

.beast-feast-monster-tool .stat-name {
    font-size: 0.7rem;
    color: var(--mp-text-subtle);
}

.beast-feast-monster-tool .flavour-dice {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.beast-feast-monster-tool .flavour-die {
    background: var(--mp-input-bg);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    border: 1px solid var(--mp-input-border);
}

.beast-feast-monster-tool .features {
    margin-bottom: 10px;
}

.beast-feast-monster-tool .feature {
    background: rgba(78, 205, 196, 0.08);
    padding: 6px 10px;
    margin: 4px 0;
    border-radius: 6px;
    border-left: 3px solid var(--mp-accent-teal);
    font-size: 0.9rem;
}

.beast-feast-monster-tool .feature-name {
    font-weight: bold;
    color: var(--mp-accent-teal);
}

.beast-feast-monster-tool .monster-notes {
    font-size: 0.8rem;
    color: var(--mp-text-subtle);
    line-height: 1.4;
    font-style: italic;
}

.beast-feast-monster-tool .monster-description {
    font-size: 0.85rem;
    margin-bottom: 10px;
    color: var(--mp-text-subtle);
    line-height: 1.3;
}

.beast-feast-monster-tool .no-results,
.beast-feast-monster-tool .loading {
    text-align: center;
    color: var(--mp-text-subtle);
    font-size: 1rem;
    margin-top: 30px;
}

@media (max-width: 768px) {
    .beast-feast-monster-tool .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .beast-feast-monster-tool .monsters-grid {
        grid-template-columns: 1fr;
    }

    .beast-feast-monster-tool .header h1 {
        font-size: 1.5rem;
    }
}

/* Make specific tool wrapper span full width of grid */
.panel-content .full-width-box {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
    margin: 0;
}

/* Ensure the monster tool fills its parent */
.beast-feast-adversary-tool,
.beast-feast-monster-tool {
    width: 100%;
}

/* === Theme Overrides === */
body.theme-beast-feast .beast-feast-monster-tool {
    /* Use the page's light parchment colours */
    --mp-bg-dark: var(--panel-bg);
    --mp-bg-mid: var(--panel-bg);
    --mp-bg-light: var(--panel-bg);

    /* Text colours pulled from frame palette */
    --mp-text-light: var(--primary-purple); /* #a5500b */
    --mp-text-subtle: #5c4322; /* darker brown for secondary labels */

    /* Accent colours: use gold + brown of the frame */
    --mp-accent-teal: var(--secondary-gold); /* #f8b13c */
    --mp-accent-red: var(--primary-purple);   /* #a5500b */
    --mp-accent-blue: var(--secondary-gold);

    /* Panels/inputs match existing panel styling */
    --mp-panel-bg: var(--panel-bg);           /* #fffaf4 */
    --mp-panel-border: var(--panel-border);   /* #e6d2b8 */
    --mp-input-bg: var(--panel-bg);
    --mp-input-border: var(--panel-border);
}

/* Highlight selected monster cards */
.monster-card.selected {
    border-color: var(--mp-accent-teal);
    box-shadow: 0 0 6px rgba(78, 205, 196, 0.6);
}

/* Hidden state */
.monster-card.mp-hidden {
    display: none !important;
}

/* ===============================================================
   Motherboard Theme Overrides – higher contrast, light background
   ===============================================================*/
.motherboard-monster-tool {
    /* Light UI instead of dark */
    --mp-bg-dark: #f4f7fb;
    --mp-bg-mid: #e8eff9;
    --mp-bg-light: #d8e3f6;
    --mp-text-light: #1d1d1d;
    --mp-text-subtle: #555;
    --mp-accent-teal: #2196f3; /* blue */
    --mp-accent-blue: #00bcd4; /* cyan */
    --mp-accent-red: #ff5722; /* orange */
    --mp-panel-bg: rgba(0, 0, 0, 0.04);
    --mp-panel-border: rgba(0, 0, 0, 0.12);
    --mp-input-bg: rgba(255, 255, 255, 0.9);
    --mp-input-border: rgba(0, 0, 0, 0.2);
}

/* Ensure cards/buttons use new colour vars (they already reference vars) */ 