/* Custom Character Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal--active {
    display: flex;
}

.modal-content {
    background: var(--panel);
    border: 1px solid var(--primary);
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow);
}

.modal-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.modal-header h2 {
    color: var(--accent);
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-main);
    font-family: inherit;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-submit {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.2s;
}

.form-submit:hover {
    background: var(--primary-dark);
}

.character-card--add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(230, 190, 96, 0.3);
    background: rgba(230, 190, 96, 0.05) !important;
}

.character-card--add:hover {
    border-color: var(--accent);
    background: rgba(230, 190, 96, 0.1) !important;
}

/* Delete Button for Custom Characters */
.character-card {
    position: relative;
}

.delete-custom-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(255, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s, background 0.2s;
}

.delete-custom-btn:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

.edit-custom-btn {
    position: absolute;
    top: 5px;
    right: 44px; /* delete-custom-btn (24px) + margin (15px) + its own right (5px) */
    width: 24px;
    height: 24px;
    background: rgba(0, 122, 255, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s, background 0.2s;
}

.edit-custom-btn:hover {
    background: rgba(0, 122, 255, 1);
    transform: scale(1.1);
}

.character-card--add .add-icon {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.character-card--add .add-text {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: bold;
}

/* Image preview */
.image-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    display: block;
    border: 2px solid var(--accent);
    background: #333;
}

/* ── Tag Chips (해시태그 입력) ── */
.tag-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    min-height: 0;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(139, 91, 255, 0.15);
    color: rgba(139, 91, 255, 0.95);
    border: 1px solid rgba(139, 91, 255, 0.3);
    border-radius: 20px;
    padding: 0.25rem 0.55rem;
    font-size: 0.8rem;
    line-height: 1.3;
    white-space: nowrap;
    animation: tagChipIn 0.2s ease;
}

@keyframes tagChipIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

.tag-chip__label {
    pointer-events: none;
}

.tag-chip__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(139, 91, 255, 0.8);
    border-radius: 50%;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}

.tag-chip__remove:hover {
    background: rgba(255, 80, 80, 0.6);
    color: #fff;
}

.tag-input-wrap {
    display: flex;
    gap: 0.4rem;
    align-items: stretch;
}

.tag-input-wrap .tag-input {
    flex: 1;
    min-width: 0;
}

.tag-add-btn {
    flex-shrink: 0;
    width: 42px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1.15rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.tag-add-btn:hover {
    background: var(--primary-dark);
}

.tag-add-btn:active {
    transform: scale(0.93);
}
