/* PokéRogue Stats Calculator */

* {
    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: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

.top-links {
    position: absolute;
    top: 20px;
    right: 20px;
}

.external-link {
    color: #4ecdc4;
    font-size: 14px;
    text-decoration: none;
    padding: 6px 12px;
    background: #3a3a3a;
    border-radius: 4px;
    transition: background 0.2s;
}

.external-link:hover {
    background: #4a4a4a;
}

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

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

h4 {
    color: #ffe66d;
    margin-bottom: 10px;
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h4 small {
    font-weight: normal;
    color: #888;
    font-size: 12px;
}

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

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

.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;
}

/* Top Buttons */
.top-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    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;
}

.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;
}

/* Main Content - Two Column Equal Height */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    align-items: stretch;
}

.left-panel, .right-panel {
    background: #3a3a3a;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.left-panel h3 {
    text-align: center;
    padding: 10px;
    background: #4a4a4a;
    border-radius: 4px;
    margin-bottom: 12px;
}

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

.search-input.error-highlight {
    border-color: #ff6b6b;
    background: #4a2a2a;
}

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

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

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

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

/* Pokemon Details - Stats + Pentagon */
.pokemon-details {
    background: #2a2a2a;
    padding: 10px;
    border-radius: 4px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    min-height: 80px;
}

.pokemon-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 5px;
    min-height: 80px;
}

.stat-column {
    width: 100px;
}

.sprite-column {
    width: 80px;
}

.pentagon-column {
    width: 160px;
}

.sprite-column .pokemon-sprite {
    margin: 0;
}

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

.sprite-column .pokemon-sprite.no-sprite {
    width: 64px;
    height: 64px;
}

.sprite-column .pokemon-sprite.no-sprite::after {
    font-size: 32px;
}

.stat-column .stat-line-container {
    margin: 0;
}

.stat-column .stat-line {
    padding: 1px 0;
}

.stat-column .stat-label {
    color: #4ecdc4;
    margin-right: 4px;
}

.stat-column .stat-value {
    color: #ffe66d;
}

.stat-column .total-bst {
    font-weight: bold;
    color: #ff6b6b;
    font-size: 13px;
    margin-top: 4px;
}

.stat-column .type-line {
    color: #888;
    font-size: 12px;
    margin-top: 4px;
}

/* Pokemon Sprite */
.pokemon-sprite {
    text-align: center;
    margin-bottom: 8px;
}

.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;
}

/* Terminal Section */
.terminal-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.terminal {
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #00ff00;
    flex: 1;
    overflow-y: auto;
    min-height: 150px;
}

.terminal-line {
    margin-bottom: 3px;
    white-space: pre-wrap;
    word-break: break-all;
}

.terminal-line::before {
    content: '$ ';
    color: #ff00ff;
}

.terminal .label {
    color: #ffff00;
}

.terminal .value {
    color: #00ffff;
}

.terminal .formula {
    color: #888;
}

.terminal .result {
    color: #00ff00;
    font-weight: bold;
}

.terminal .error {
    color: #ff6b6b;
    font-weight: bold;
}

.terminal .warning {
    color: #ffaa00;
    font-style: italic;
}

/* Settings Row */
.settings-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.filter-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.filter-section.small {
    flex: 0 0 65px;
}

.filter-section label {
    font-size: 11px;
    color: #888;
}

.filter-section select,
.filter-section input {
    padding: 4px 5px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #2a2a2a;
    color: #e0e0e0;
    font-size: 12px;
    width: 100%;
    box-sizing: border-box;
}

.filter-section.small {
    flex: 0 0 100px;
}

.filter-section label {
    font-size: 12px;
    color: #888;
}

.filter-section select,
.filter-section input {
    padding: 8px 10px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #2a2a2a;
    color: #e0e0e0;
    font-size: 14px;
}

/* Panel Sections */
.panel-section {
    background: #2a2a2a;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 8px;
}

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

/* Right Panel - Stats Input Sections */
.compact-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.stat-input {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-input label {
    font-size: 13px;
    color: #888;
    text-align: center;
}

.stat-input input {
    padding: 10px 6px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #3a3a3a;
    color: #e0e0e0;
    text-align: center;
    font-size: 14px;
    width: 100%;
}

.stat-input input.default-value {
    color: #888;
}

.stat-input input:focus {
    border-color: #4ecdc4;
    outline: none;
}

.stat-input input.error-highlight {
    border-color: #ff6b6b;
    background: #4a2a2a;
}

/* Items Compact */
.items-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-row-single {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 8px;
}

.item-input {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.item-input label {
    font-size: 13px;
    white-space: nowrap;
}

.item-input input {
    width: 55px;
    padding: 5px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #3a3a3a;
    color: #e0e0e0;
    text-align: center;
    font-size: 13px;
}

.item-checks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.item-checks label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    white-space: nowrap;
}
    cursor: pointer;
    padding: 5px 8px;
    background: #3a3a3a;
    border-radius: 4px;
    justify-content: center;
}

.item-checks input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.item-input label {
    font-size: 13px;
    white-space: nowrap;
}

/* 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;
}

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

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

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

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

/* Responsive */
@media (max-width: 700px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .left-panel, .right-panel {
        min-height: auto;
        height: auto;
    }
}
