/**
 * Character Profile Panel Styles
 *
 * Styles for the CharacterProfilePanel component that displays
 * individual character profiles with full editing capabilities.
 */

/* =============================================================================
   PROFILE HEADER
   ============================================================================= */

.character-profile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(var(--node-accent-rgb, 229, 57, 53), 0.08);
    border-bottom: 1px solid rgba(var(--node-accent-rgb, 229, 57, 53), 0.15);
}

.character-profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 -2px 4px rgba(0, 0, 0, 0.1);
}

.character-profile-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.character-profile-name-input,
.character-profile-actor-input {
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    margin: -4px -8px;
    font-family: inherit;
    transition: background-color 0.15s ease;
}

.character-profile-name-input {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #fff);
}

.character-profile-actor-input {
    font-size: 13px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
}

.character-profile-name-input:hover,
.character-profile-actor-input:hover {
    background: rgba(255, 255, 255, 0.05);
}

.character-profile-name-input:focus,
.character-profile-actor-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 1px var(--node-accent, #E53935);
}

.character-profile-name-input::placeholder,
.character-profile-actor-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}


/* =============================================================================
   COLOR PICKER
   ============================================================================= */

.character-color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.character-color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.character-color-swatch:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.character-color-swatch.is-selected {
    border-color: white;
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.3),
        0 2px 6px rgba(0, 0, 0, 0.3);
    transform: scale(1.1);
}


/* =============================================================================
   ROLE BUTTONS
   ============================================================================= */

.character-role-buttons {
    display: flex;
    gap: 4px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.character-role-btn {
    flex: 1;
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.character-role-btn:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.character-role-btn.is-selected {
    color: white;
    background: var(--node-accent, #E53935);
    border-color: var(--node-accent, #E53935);
    box-shadow: 0 2px 6px rgba(var(--node-accent-rgb, 229, 57, 53), 0.3);
}


/* =============================================================================
   COLLAPSIBLE SECTIONS
   ============================================================================= */

.character-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.character-section:last-child {
    border-bottom: none;
}

.character-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
    user-select: none;
    background: rgba(0, 0, 0, 0.05);
    transition: background-color 0.15s ease;
}

.character-section__header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.character-section__title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.7);
}

.character-section__chevron {
    transition: transform 0.2s ease;
    color: rgba(255, 255, 255, 0.4);
}

.character-section[open] .character-section__chevron {
    transform: rotate(180deg);
}

.character-section__body {
    padding: 8px 16px 16px;
}

/* Adjust nested node-field styles within sections */
.character-section__body .node-field {
    margin-bottom: 12px;
}

.character-section__body .node-field:last-child {
    margin-bottom: 0;
}


/* =============================================================================
   DEPARTMENT-COLORED FIELDS
   ============================================================================= */

.node-field--dept {
    position: relative;
    padding-left: 12px;
}

.node-field--dept::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--field-accent, #888);
    border-radius: 1.5px;
    opacity: 0.8;
}

.node-field--dept .node-field__label {
    color: var(--field-accent, #888);
}


/* =============================================================================
   FIELD INPUTS & TEXTAREAS
   ============================================================================= */

.node-field__input,
.node-field__textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-primary, #fff);
    transition: border-color 0.15s ease, background-color 0.15s ease;
    resize: vertical;
}

.node-field__input::placeholder,
.node-field__textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.node-field__input:hover,
.node-field__textarea:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.node-field__input:focus,
.node-field__textarea:focus {
    outline: none;
    border-color: var(--node-accent, #E53935);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 2px rgba(var(--node-accent-rgb, 229, 57, 53), 0.15);
}

.node-field__textarea {
    min-height: 60px;
    line-height: 1.5;
}


/* =============================================================================
   CHARACTER PROFILE PANEL SPECIFIC
   ============================================================================= */

/* Override panel content padding for character profiles */
.node-panel--character-profile .node-panel__content,
.node-panel[data-node-id^="character-profile-"] .node-panel__content {
    padding: 0;
}

/* Custom scrollbar for character panels */
.node-panel--character-profile .node-panel__content::-webkit-scrollbar,
.node-panel[data-node-id^="character-profile-"] .node-panel__content::-webkit-scrollbar {
    width: 6px;
}

.node-panel--character-profile .node-panel__content::-webkit-scrollbar-track,
.node-panel[data-node-id^="character-profile-"] .node-panel__content::-webkit-scrollbar-track {
    background: transparent;
}

.node-panel--character-profile .node-panel__content::-webkit-scrollbar-thumb,
.node-panel[data-node-id^="character-profile-"] .node-panel__content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.node-panel--character-profile .node-panel__content::-webkit-scrollbar-thumb:hover,
.node-panel[data-node-id^="character-profile-"] .node-panel__content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
