/* Character sheet core styles: stats grid, skills, resources, paths/talents, expertises, trackers, validation, equipment, portrait, injuries/conditions/connections. */

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

.stat-column {
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

.stat-column.physical {
    border-color: var(--physical-color);
    background-color: rgba(196, 68, 68, 0.05);
}

.stat-column.cognitive {
    border-color: var(--cognitive-color);
    background-color: rgba(68, 114, 196, 0.05);
}

.stat-column.spiritual {
    border-color: var(--spiritual-color);
    background-color: rgba(112, 173, 71, 0.05);
}

.stat-column h3 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.3em;
    padding-bottom: 10px;
    border-bottom: 2px solid currentColor;
}

.stat-column.physical h3 {
    color: var(--physical-color);
}

.stat-column.cognitive h3 {
    color: var(--cognitive-color);
}

.stat-column.spiritual h3 {
    color: var(--spiritual-color);
}

.attribute-box,
.defense-box {
    background: white;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.attribute-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
    align-items: center;
}

.attribute-label {
    font-weight: 600;
    font-size: 1.1em;
}

.attribute-value {
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    background-color: var(--bg-primary);
    padding: 10px;
    border-radius: 4px;
}

.defense-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: var(--bg-primary);
    border-radius: 4px;
}

.defense-label {
    font-weight: 600;
}

.defense-value {
    font-size: 1.3em;
    font-weight: bold;
}

.skills-section {
    margin-bottom: 20px;
}

.skill-row {
    display: grid;
    grid-template-columns: 2fr 80px 80px;
    gap: 10px;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
}

.skill-row:hover {
    background-color: var(--bg-primary);
}

.skill-name {
    font-weight: 500;
}

.skill-attr {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.skill-rank {
    width: 70px;
    padding: 6px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.skill-modifier {
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
    padding: 6px;
    background-color: var(--bg-primary);
    border-radius: 4px;
}

.resources-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.resource-box {
    background: white;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.resource-label {
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
    color: var(--text-secondary);
}

.resource-values {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.resource-current,
.resource-max {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
}

.resource-current {
    width: 80px;
}

.resource-max {
    width: 80px;
    background-color: var(--bg-primary);
}

.paths-section {
    margin-bottom: 30px;
}

.path-selector {
    background: white;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.path-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.path-card {
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.path-card:hover {
    border-color: var(--primary-color);
}

.path-card.selected {
    border-color: var(--primary-color);
    background-color: rgba(44, 90, 160, 0.1);
}

.path-card h4 {
    margin-bottom: 5px;
}

.path-card p {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.notes-section {
    margin-top: 30px;
}

.notes-area {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1em;
    resize: vertical;
}

.level-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
}

.level-display {
    font-size: 3em;
    font-weight: bold;
    margin-bottom: 10px;
}

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

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85em;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.auto-calc {
    color: var(--success-color);
    font-style: italic;
}

.validation-warning {
    background-color: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 4px;
    padding: 15px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.validation-warning.error {
    background-color: #f8d7da;
    border-color: #dc3545;
}

.validation-warning.success {
    background-color: #d4edda;
    border-color: #28a745;
}

.validation-icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

.validation-message {
    flex-grow: 1;
}

.point-tracker {
    background: white;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.point-tracker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.point-tracker-title {
    font-weight: 600;
    font-size: 1.1em;
}

.point-tracker-values {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 1.2em;
    font-weight: bold;
}

.points-used {
    color: var(--primary-color);
}

.points-total {
    color: var(--text-secondary);
}

.points-remaining {
    padding: 5px 15px;
    border-radius: 20px;
    background-color: var(--bg-primary);
}

.points-remaining.over {
    background-color: #f8d7da;
    color: #dc3545;
}

.points-remaining.complete {
    background-color: #d4edda;
    color: #28a745;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s ease;
}

.progress-fill.over {
    background: linear-gradient(90deg, #dc3545, #ff6b6b);
}

.progress-fill.complete {
    background: linear-gradient(90deg, #28a745, #4caf50);
}

.validation-summary {
    margin-bottom: 20px;
}

.character-complete-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
    margin-left: 10px;
}

.character-complete-badge.incomplete {
    background-color: #fff3cd;
    color: #856404;
}

.character-complete-badge.complete {
    background-color: #d4edda;
    color: #155724;
}

.help-text {
    font-size: 0.85em;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 5px;
}

.expertises-section {
    margin-bottom: 20px;
}

.expertise-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.expertise-tag {
    padding: 8px 15px;
    background-color: var(--accent-color);
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.expertise-tag.from-culture {
    background-color: #4a5fa6;
    color: white;
}
.expertise-tag.from-talent {
    background-color: #7d3c3c;
    color: white;
}
.expertise-tag.from-kit {
    background-color: #5b8c5a;
    color: white;
}
.expertise-source-label {
    font-size: 0.7em;
    opacity: 0.85;
    font-style: italic;
    margin-left: 4px;
}

.expertise-remove {
    background: none;
    border: none;
    color: white;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    font-size: 1.2em;
    width: 20px;
    height: 20px;
}

.add-expertise {
    padding: 8px 15px;
    border: 2px dashed var(--border-color);
    border-radius: 20px;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9em;
}

.add-expertise:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.expertise-tag.from-expertise-catalog {
    background-color: #6b4f8c;
    color: white;
}
.expertise-tag.is-custom {
    background-color: #777;
    color: white;
}

.expert-trait-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(107, 79, 140, 0.15);
    color: #6b4f8c;
    font-size: 0.78em;
    font-weight: 600;
    margin-left: 4px;
}
.item-trait[data-glossary] {
    cursor: help;
    border-bottom: 1px dotted currentColor;
}

.talent-card, .talent-card-inline {
    transition: all 0.2s ease;
}

.talent-card:hover:not([style*="cursor: not-allowed"]),
.talent-card-inline:hover:not([style*="cursor: not-allowed"]) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
    border-color: var(--primary-color) !important;
}

/* Equipment & Combat Styles - now handled by section-content wrapper */
.equipment-section, .injuries-section, .connections-section, .character-details-section {
    /* Background and padding removed - unified collapsible sections now */
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-card {
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 15px;
}

.item-details {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    font-size: 0.9em;
}

.item-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-stat-label {
    font-size: 0.8em;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.item-stat-value {
    font-weight: bold;
    color: var(--text-primary);
}

.item-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.currency-input {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.currency-input label {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-secondary);
}

.currency-input input {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 100px;
}

.portrait-container {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 15px;
}

.portrait-frame {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    border: 2px dashed var(--border-color);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    cursor: pointer;
    position: relative;
    transition: border-color 0.3s;
}

.portrait-frame:hover {
    border-color: var(--primary-color);
}

.portrait-frame.has-image {
    border-style: solid;
    border-color: var(--accent-color);
}

.portrait-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portrait-placeholder {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8em;
    padding: 10px;
}

.portrait-placeholder-icon {
    font-size: 2em;
    display: block;
    margin-bottom: 4px;
}

.portrait-actions {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.portrait-actions button {
    font-size: 0.75em;
    padding: 4px 8px;
}

.play-portrait {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-color);
    flex-shrink: 0;
    cursor: pointer;
}

.injuries-list, .conditions-list, .connections-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.injury-card, .condition-card, .connection-card {
    padding: 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.condition-card {
    background: #f8d7da;
    border-color: #dc3545;
}

.connection-card {
    background: #d1ecf1;
    border-color: #0c5460;
}

.armor-selector select {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1em;
}
