/* ============================================
   CHARACTERS.CSS - Character Page Styles
   ACKS II Campaign Character Pages
   ============================================ */

/* ============================================
   Character Grid Layout
   ============================================ */
.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .characters-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Character Cards - Build on base .card
   ============================================ */
.card.pc,
.card.npc {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    overflow: hidden;
}

.card.pc {
    cursor: pointer;
    transition: all 0.3s ease;
}

.card.pc:hover {
    transform: translateY(-2px);
}

/* Expanded PC card */
.card.pc.expanded {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2rem;
    cursor: default;
    transform: none;
}

.card.pc.expanded .character-body-image {
    width: 400px;
    height: auto;
    border: 2px solid var(--text-primary, #333);
    object-fit: cover;
}

.card.pc.expanded .character-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card.pc.expanded .character-header {
    position: relative;
}

.card.pc.expanded .character-portrait {
    display: none;
}

.card.pc.expanded .close-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--text-primary, #333);
    color: var(--bg-primary, #fff);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.card.pc.expanded .close-btn:hover {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .card.pc.expanded {
        grid-template-columns: 1fr;
    }

    .card.pc.expanded .character-body-image {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
}

/* ============================================
   Character Card Content
   ============================================ */
.character-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    min-width: 0;
}

.character-header>div {
    flex: 1;
    min-width: 0;
}

.character-portrait {
    width: 80px;
    height: 80px;
    border: 2px solid var(--text-primary, #333);
    object-fit: cover;
    flex-shrink: 0;
}

.character-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary, #333);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.character-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.character-description {
    font-size: 0.9rem;
    opacity: 0.7;
    font-style: italic;
    line-height: 1.6;
    flex-grow: 1;
}

.character-notes {
    line-height: 1.6;
    border-top: 1px solid var(--text-primary, #333);
    padding-top: 0.75rem;
    margin-top: auto;
}

/* ============================================
   ACKS II Campaign-Specific Colors
   ============================================ */

/* Disposition colors for NPCs */
.disposition-hostile {
    background: #dd3333;
    color: #fff;
}

.disposition-unfriendly {
    background: #ee8833;
    color: #fff;
}

.disposition-neutral {
    background: #888;
    color: #fff;
}

.disposition-indifferent {
    background: #66a275;
    color: #fff;
}

.disposition-friendly {
    background: #41d146;
    color: #fff;
}

/* Status colors */
.status-active {
    background: #6b9b6b;
}

.status-inactive {
    background: #b8885c;
}

.status-deceased {
    background: #a85555;
}

.status-dead {
    background: #a85555;
}

.status-alive {
    background: #6b9b6b;
}

.status-unknown {
    background: #888;
}

/* ============================================
   Section Visibility (for PC/NPC toggle)
   ============================================ */
.section {
    display: none;
}

.section.active {
    display: block;
}

/* ============================================
   Character XP Display
   ============================================ */
.character-xp {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
}

.xp-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.xp-value {
    font-weight: 600;
    color: #22c55e;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.xp-bonus-tag {
    font-size: 0.7rem;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    font-weight: 500;
}

/* XP Offsets (collapsed by default) */
.xp-offsets-details {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.xp-offsets-details summary {
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem 0;
}

.xp-offsets-details summary:hover {
    color: var(--text-primary);
}

.xp-offsets-list {
    margin-top: 0.5rem;
    padding-left: 0.5rem;
    border-left: 2px solid var(--border-color);
}

.xp-offset-item {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.xp-offset-amount {
    font-weight: 600;
    min-width: 60px;
}

.xp-offset-amount:first-child {
    color: #22c55e;
}

.xp-offset-note {
    color: var(--text-secondary);
}

/* ============================================
   Inactive/Dead/Retired Characters
   ============================================ */
.card.pc.pc-inactive {
    position: relative;
    opacity: 0.7;
}

.card.pc.pc-inactive::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(0, 0, 0, 0.1) 100%);
    pointer-events: none;
    z-index: 1;
}

.inactive-banner {
    position: absolute;
    top: 1.5rem;
    right: -2rem;
    background: #a85555;
    color: white;
    padding: 0.25rem 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    transform: rotate(45deg);
    z-index: 2;
}