/* PokéRogue Fusion Calculator - BSD 3-Clause License */
/* Copyright (c) 2024 */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #2a2a2a;
    color: #e0e0e0;
    min-height: 100vh;
    padding-bottom: 40px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #ff6b6b;
    margin-bottom: 20px;
}

h3 {
    color: #4ecdc4;
    margin-bottom: 10px;
}

h4 {
    color: #ffe66d;
    margin-bottom: 8px;
}

/* Controls Bar */
.controls-bar {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #3a3a3a;
    border-radius: 8px;
    flex-wrap: wrap;
}

.controls-bar label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    position: relative;
}

.controls-bar label[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 100;
    margin-bottom: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    pointer-events: none;
}

.controls-bar button {
    padding: 8px 16px;
    background: #4ecdc4;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.controls-bar button:hover {
    background: #45b7af;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    align-items: start;
}

.main-content.three-panel {
    margin-bottom: 20px;
}

.pokemon-column {
    background: #3a3a3a;
    padding: 15px;
    border-radius: 8px;
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.pokemon-column h3 {
    text-align: center;
    margin-bottom: 10px;
}

.fusion-column {
    background: #3a3a3a;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.fusion-top {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.fusion-top h3 {
    text-align: center;
    margin-bottom: 10px;
    flex: 0 0 auto;
}

.fusion-notes {
    background: #2a2a2a;
    padding: 12px;
    border-radius: 4px;
    margin-top: 10px;
    border-top: 1px solid #555;
    flex: 0 0 auto;
}

.pokemon-details.fusion-details {
    flex: 1 1 auto;
}

.notes-section {
    margin-bottom: 12px;
}

.notes-section:last-child {
    margin-bottom: 0;
}

.notes-section h4 {
    color: #ffe66d;
    margin-bottom: 6px;
    font-size: 13px;
}

.notes-section ul {
    margin: 0;
    padding-left: 16px;
}

.notes-section li {
    margin-bottom: 4px;
    font-size: 11px;
    line-height: 1.4;
    color: #bbb;
}

.contrib {
    display: flex;
    flex-direction: column;
    margin-bottom: 6px;
    font-size: 11px;
}

.contrib strong {
    color: #4ecdc4;
}

.contrib span {
    color: #bbb;
    padding-left: 8px;
}

.notes-section small {
    color: #888;
    font-size: 10px;
}

.pokemon-id {
    color: #888;
    font-size: 12px;
    text-align: center;
    padding-top: 10px;
    border-top: 1px solid #555;
    margin-top: 10px;
}

.ability-selector, .nature-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
}

.ability-selector label, .nature-selector label {
    color: #4ecdc4;
    white-space: nowrap;
}

.ability-selector select, .nature-selector select {
    flex: 1;
    padding: 6px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #2a2a2a;
    color: #e0e0e0;
    font-size: 12px;
}

.search-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #2a2a2a;
    color: #e0e0e0;
    margin-bottom: 10px;
}

.pokemon-list {
    max-height: 250px;
    overflow-y: auto;
    background: #2a2a2a;
    border-radius: 4px;
    margin-bottom: 15px;
}

.pokemon-list-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #444;
    transition: background 0.2s;
}

.pokemon-list-item:hover {
    background: #4a4a4a;
}

.pokemon-list-item.selected {
    background: #4ecdc4;
    color: #2a2a2a;
}

.pokemon-details {
    background: #2a2a2a;
    padding: 15px;
    border-radius: 4px;
    min-height: 150px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
    padding: 20px;
}

/* Top Buttons Bar */
.top-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.btn-primary, .btn-secondary, .btn-danger {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    min-width: 100px;
}

.btn-primary {
    background: #ff6b6b;
    color: white;
}

.btn-primary:hover {
    background: #ff5252;
}

.btn-secondary {
    background: #4ecdc4;
    color: #2a2a2a;
}

.btn-secondary:hover {
    background: #45b7af;
}

.btn-danger {
    background: #666;
    color: white;
}

.btn-danger:hover {
    background: #555;
}

/* Fusion Details */
.fusion-details {
    background: #2a2a2a;
    padding: 15px;
    border-radius: 4px;
    min-height: 150px;
}

/* Pokemon Details Styling */
.pokemon-sprite {
    text-align: center;
    margin-bottom: 10px;
}

.pokemon-sprite img {
    image-rendering: pixelated;
}

.pokemon-sprite.no-sprite {
    width: 96px;
    height: 96px;
    margin: 0 auto 10px;
    background: #444;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pokemon-sprite.no-sprite::after {
    content: '?';
    font-size: 48px;
    color: #888;
}

.pokemon-details .type-line {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.type-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
}

.type-badge.normal { background: #A8A77A; }
.type-badge.fire { background: #EE8130; }
.type-badge.water { background: #6390F0; }
.type-badge.electric { background: #F7D02C; }
.type-badge.grass { background: #7AC74C; }
.type-badge.ice { background: #96D9D6; }
.type-badge.fighting { background: #C22E28; }
.type-badge.poison { background: #A33EA1; }
.type-badge.ground { background: #E2BF65; }
.type-badge.flying { background: #A98FF3; }
.type-badge.psychic { background: #F95587; }
.type-badge.bug { background: #A6B91A; }
.type-badge.rock { background: #B6A136; }
.type-badge.ghost { background: #735797; }
.type-badge.dragon { background: #6F35FC; }
.type-badge.dark { background: #705746; }
.type-badge.steel { background: #B7B7CE; }
.type-badge.fairy { background: #D685AD; }

.stat-line {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-family: 'Consolas', monospace;
}

.stat-label {
    color: #4ecdc4;
}

.stat-value {
    color: #ffe66d;
}

.total-bst {
    font-weight: bold;
    color: #ff6b6b;
    padding-top: 5px;
    border-top: 1px solid #555;
    margin-top: 5px;
}

.ability-line, .passive-line {
    margin: 8px 0;
}

.ability-label {
    color: #4ecdc4;
}

.evo-line {
    margin: 10px 0;
    color: #4ecdc4;
}

.evo-species {
    color: #64b5f6;
    cursor: pointer;
    text-decoration: underline;
}

/* Damage Table */
.damage-table {
    margin-top: 15px;
}

.damage-row {
    display: flex;
    align-items: flex-start;
    padding: 3px 0;
    font-family: 'Consolas', monospace;
    min-height: 26px;
}

.damage-label {
    width: 70px;
    font-weight: bold;
    text-align: right;
    padding-right: 10px;
    flex-shrink: 0;
    padding-top: 2px;
}

.damage-types {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.immune { color: #ff6b6b; }
.half { color: #4ecdc4; }
.double { color: #ffe66d; }
.normal-dmg { color: #e0e0e0; }

/* Status Bar */
.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a1a;
    color: #888;
    padding: 8px 20px;
    font-size: 12px;
    border-top: 1px solid #444;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #3a3a3a;
    padding: 30px;
    border-radius: 8px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h2 {
    color: #ffe66d;
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.options-column {
    background: #2a2a2a;
    padding: 15px;
    border-radius: 4px;
}

.options-column label {
    display: block;
    padding: 5px 0;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: row;
        justify-content: center;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #2a2a2a;
}

::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Filters Modal */
.filter-section {
    background: #2a2a2a;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.filter-section h4 {
    color: #ffe66d;
    margin-bottom: 8px;
    font-size: 14px;
}

.filter-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4ecdc4;
}

.filter-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-row select,
.filter-row input[type="number"] {
    padding: 6px 10px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #3a3a3a;
    color: #e0e0e0;
    font-size: 12px;
}

.filter-row input[type="number"] {
    width: 70px;
}

.type-help {
    font-size: 11px;
    color: #888;
    margin-top: 6px;
}

.damage-filter-row {
    margin-bottom: 6px;
}

.damage-filter-row select,
.damage-filter-row input {
    padding: 4px 8px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #3a3a3a;
    color: #e0e0e0;
    font-size: 11px;
}

.damage-filter-row input[type="number"] {
    width: 60px;
}

.damage-filter-row select.damage-filter-type {
    min-width: 100px;
}

.stat-filters {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.stat-filter-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.stat-filter-row label {
    min-width: 70px;
}

.stat-filter-row input[type="checkbox"] {
    width: auto;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.filter-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
}
