/* ============================================
   Custom Style Specific Styles
   ============================================ */

/* Компактный вид без лишних отступов */
#view-custom-style {
    padding-top: calc(var(--header-height) + 8px) !important; /* 64px + 8px = 72px вместо 80px */
}

/* Селектор профилей */
#view-custom-style .profiles-selector {
    margin: 0 auto 16px auto;
    padding: 0 16px;
    max-width: 600px;
}

/* Поле ввода промпта - обычный блок в потоке */
.prompt-section {
    position: relative;
    margin: 0 0 180px 0; /* Отступ под fixed селектор моделей */
    padding: 0 16px;
    background: transparent;
}

#view-custom-style .prompt-section {
    max-width: 600px;
    margin: 0 auto 180px auto;
}

/* Container для textarea с кнопками внутри */
.textarea-container {
    position: relative;
    background: #1a1a2e;
    border: 2px solid #2a2a3e;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.textarea-container:focus-within {
    border-color: #6A2CFF;
    box-shadow: 0 0 0 4px rgba(106, 44, 255, 0.1);
}

.prompt-textarea {
    width: 100%;
    min-height: 80px; /* Фиксированная высота для предотвращения скачка при загрузке Tiptap */
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: #F5F7FA;
    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.5;
    resize: none;
    overflow-y: hidden;
}

.prompt-textarea:focus {
    outline: none;
}

.prompt-textarea::placeholder {
    color: #5A5A6A;
}

/* Кнопка очистки (X) в углу textarea */
.clear-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(106, 44, 255, 0.2);
    border: 1px solid rgba(106, 44, 255, 0.4);
    border-radius: 50%;
    color: #FFFFFF;
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.clear-btn:hover {
    background: rgba(106, 44, 255, 0.3);
    border-color: rgba(106, 44, 255, 0.6);
    transform: scale(1.1);
}

.clear-btn:active {
    transform: scale(0.9);
}

/* Показываем кнопку когда есть контент */
.clear-btn.show {
    display: flex;
}

/* ✅ Удалено - используется глобальный .btn-action-primary и .buttons-container из common.css */

/* Loader использует общий стиль из loader.css */

/* Step Save Profile */
.step {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0F0F1E;
    z-index: 2000;
    padding: 24px;
    align-items: center;
    justify-content: center;
}

.step-content {
    width: 100%;
    max-width: 400px;
}

.save-profile-header {
    text-align: center;
    margin-bottom: 32px;
}

.save-profile-header h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.save-profile-header p {
    color: #8A8FA3;
    font-size: 14px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #8A8FA3;
    margin-bottom: 8px;
}

.profile-name-input {
    width: 100%;
    padding: 14px 16px;
    background: #1a1a2e;
    border: 2px solid #2a2a3e;
    border-radius: 12px;
    color: #F5F7FA;
    font-family: var(--font-ui);
    font-size: 15px;
    transition: all 0.3s ease;
}

.profile-name-input:focus {
    outline: none;
    border-color: #6A2CFF;
    box-shadow: 0 0 0 4px rgba(106, 44, 255, 0.1);
}

.save-profile-actions {
    display: flex;
    gap: 12px;
}

.save-profile-actions .btn {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary {
    background: #2a2a3e;
    color: #F5F7FA;
}

.btn-secondary:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #6A2CFF 0%, #00C8FF 100%);
    color: white;
}

.btn-primary:active {
    transform: scale(0.98);
}

/* @keyframes gradientShift - defined in common.css */

/* ✅ Custom-style specific: блок селектора прижат к низу */
#view-custom-style .models-selector-section {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--container-max-width);
    padding: 20px 16px 20px 16px;
    border-radius: 32px 32px 0 0; /* Только верхние углы */
    z-index: 99;
    box-sizing: border-box;
}

/* Fullscreen-loader удалён - не используется */
/* models-selector-label и min-model-warning moved to components.css */

/* Utility classes */
.hidden-file-input {
    display: none;
}

/* Убрано - используется scrollBy в JS */

/* Теги профилей над textarea */
.profile-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    min-height: 32px;
}

.profile-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 4px;
    background: linear-gradient(135deg, #6A2CFF 0%, #B565D8 100%);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
}

.profile-tag:active {
    transform: scale(0.95);
    opacity: 0.8;
}

.profile-tag-avatar {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Tiptap placeholder - используем Placeholder extension */
.tiptap p.is-editor-empty:first-child::before,
.tiptap p.is-empty:first-child::before {
    content: attr(data-placeholder);
    color: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    float: left;
    height: 0;
}

/* Убираем синюю рамку при фокусе на Tiptap */
.tiptap.ProseMirror:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

.tiptap.ProseMirror:focus-visible {
    outline: none;
}

.tiptap.ProseMirror {
    outline: none;
    border: none;
}

.prompt-textarea[contenteditable] {
    min-height: 60px; /* 2 строки минимум */
    max-height: 300px;
    overflow-y: hidden;
    overflow-wrap: break-word;
    word-wrap: break-word;
    line-height: 1.6;
    white-space: pre-wrap; /* Сохраняем пробелы - важно для стабильности курсора */
}

/* ============================================
   Profile Badge Styles
   ============================================ */

/* Убираем синюю рамку выделения узла ProseMirror */
.ProseMirror-selectednode {
    outline: none !important;
    box-shadow: none !important;
}

/* Правильное строчное поведение бейджа */
/* ❌ УДАЛЕНО - стили перенесены в components.css */

/* Исправляем курсор рядом с бейджем */
.ProseMirror {
    word-break: break-word;
    white-space: pre-wrap;
}

/* Параграфы в Tiptap - убираем лишние отступы */
.tiptap p {
    margin: 0;
    padding: 0;
    display: inline; /* КРИТИЧНО: параграф как inline! */
}

/* Если параграф содержит только бейдж - всё равно inline */
/* ❌ УДАЛЕНО - перенесено в components.css */

/* ❌ УДАЛЕНО - все стили badge перенесены в components.css */

/* Стили для placeholder когда есть badges */
.prompt-textarea[contenteditable]:not(:focus):empty:before {
    content: attr(data-placeholder);
}

