/*
 * profile-wysiwyg.css — стили для инлайн-редактирования и живых плиток
 * Подключать после profile.css
 * <link rel="stylesheet" href="/static/css/pages/profile-wysiwyg.css">
 */


/* ════════════════════════════════════════════
   OWNER INLINE EDITING
   Поля которые владелец может редактировать
════════════════════════════════════════════ */

.owner-editable {
    position: relative;
    cursor: pointer;
    border-radius: 6px;
    transition: background .2s;
    padding: 2px 4px;
    margin: -2px -4px;
}

.owner-editable:hover {
    background: rgba(68, 217, 149, 0.07);
    outline: 1px dashed rgba(68, 217, 149, 0.3);
}

.edit-hint {
    font-size: .55rem;
    opacity: 0;
    margin-left: 6px;
    color: var(--primary);
    transition: opacity .2s;
    vertical-align: middle;
    flex-shrink: 0;
}

.owner-editable:hover .edit-hint {
    opacity: 0.8;
}

/* Инлайн-инпут поверх текста */
.field-input-inline {
    width: 100%;
    background: var(--surf-el, #1C222C);
    border: 1px solid var(--primary);
    border-radius: 6px;
    padding: 6px 10px;
    color: var(--text);
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    outline: none;
    resize: none;
    box-shadow: 0 0 0 3px rgba(68, 217, 149, 0.1);
    transition: box-shadow .2s;
}

.field-input-inline:focus {
    box-shadow: 0 0 0 3px rgba(68, 217, 149, 0.2);
}

.bio-input {
    min-height: 80px;
    line-height: 1.6;
}

/* Кнопка редактирования в профиле */
.btn-edit-toggle {
    font-family: "Courier New", monospace;
    font-size: .52rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 8px 14px;
    border-radius: 3px;
    background: transparent;
    color: var(--primary);
    border: 1px solid rgba(68, 217, 149, 0.3);
    cursor: pointer;
    transition: background .2s, border-color .2s;
}

.btn-edit-toggle:hover {
    background: rgba(68, 217, 149, 0.08);
    border-color: var(--primary);
}

.btn-edit-toggle.active {
    background: var(--primary);
    color: #000;
}


/* ════════════════════════════════════════════
   OWNER AVATAR RING
   Анимированное кольцо вокруг аватара
════════════════════════════════════════════ */

#owner-avatar-ring {
    position: relative;
    width: 120px;
    height: 120px;
    cursor: pointer;
    flex-shrink: 0;
}

#owner-avatar-ring::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 8px;
    background: conic-gradient(var(--primary), var(--accent), var(--primary));
    opacity: 0;
    transition: opacity .3s;
    z-index: 0;
    animation: spin-ring 4s linear infinite;
}

#owner-avatar-ring:hover::before {
    opacity: 1;
}

@keyframes spin-ring {
    to { transform: rotate(360deg); }
}

#owner-avatar-ring .profile-avatar {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 6px;
    object-fit: cover;
    z-index: 1;
    background: var(--surf-el);
    border: 3px solid var(--bg);
    transition: filter .25s;
}

#owner-avatar-ring:hover .profile-avatar {
    filter: brightness(.55);
}

#owner-avatar-ring .avatar-overlay {
    position: absolute;
    inset: 0;
    border-radius: 6px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    transition: opacity .25s;
    pointer-events: none;
}

#owner-avatar-ring:hover .avatar-overlay {
    opacity: 1;
}

#owner-avatar-ring .avatar-overlay svg {
    width: 22px; height: 22px;
    stroke: #fff; fill: none; stroke-width: 1.5;
}

#owner-avatar-ring .avatar-overlay span {
    font-size: .52rem;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: #fff;
    font-family: "Courier New", monospace;
}

.avatar-upload-status {
    font-size: .56rem;
    font-family: "Courier New", monospace;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--primary);
    margin-top: 4px;
    height: 14px;
}


/* ════════════════════════════════════════════
   EDIT PANEL
   Выдвижная панель настроек
════════════════════════════════════════════ */

.edit-panel {
    margin-bottom: 24px;
    animation: ep-slide-in .35s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes ep-slide-in {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.edit-panel-inner {
    background: var(--surface);
    border: 1px solid rgba(68, 217, 149, 0.2);
    border-radius: 14px;
    padding: 20px 24px;
    box-shadow: 0 0 0 1px rgba(68, 217, 149, 0.06),
                0 8px 32px rgba(0, 0, 0, 0.25);
    position: relative;
}

.edit-panel-inner::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    border-radius: 14px 0 0 14px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
}

.edit-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.edit-panel-title {
    font-family: "Courier New", monospace;
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ep-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--primary);
    animation: ep-pulse 2s ease-in-out infinite;
}

@keyframes ep-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .4; transform: scale(.7); }
}

.ep-hint {
    font-family: "Courier New", monospace;
    font-size: .52rem;
    color: var(--accent);
    letter-spacing: .08em;
    display: none;
    align-items: center;
    gap: 6px;
}

.ep-hint.visible {
    display: flex;
}

.ep-hint::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--accent);
    animation: ep-pulse 1s ease-in-out infinite;
}

.ep-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color .15s;
}

.ep-close:hover { color: var(--text); }

.edit-panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 20px;
}

.ep-section-title {
    font-family: "Courier New", monospace;
    font-size: .5rem;
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.ep-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ep-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ep-field label {
    font-family: "Courier New", monospace;
    font-size: .5rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
    transition: color .2s;
}

.ep-field:focus-within label {
    color: var(--primary);
}

.ep-field input,
.ep-field textarea {
    background: var(--surf-el);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    color: var(--text);
    font-family: inherit;
    font-size: .8rem;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
}

.ep-field input:focus,
.ep-field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(68, 217, 149, 0.08);
}

.ep-field textarea {
    resize: none;
    min-height: 80px;
    line-height: 1.55;
}

.ep-field-footer {
    display: flex;
    justify-content: space-between;
    font-family: "Courier New", monospace;
    font-size: .5rem;
    color: var(--muted);
    letter-spacing: .06em;
}

.ep-mood-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.ep-mood-wrap .mood-tag {
    font-family: "Courier New", monospace;
    font-size: .55rem;
    letter-spacing: .07em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: all .18s;
    user-select: none;
}

.ep-mood-wrap .mood-tag:hover   { color: var(--text); border-color: rgba(255,255,255,.12); }
.ep-mood-wrap .mood-tag.selected { border-color: var(--accent); color: var(--accent); background: rgba(255,92,58,.07); }

.ep-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.ep-btn-discard {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 9px 20px;
    border-radius: 8px;
    font-family: inherit;
    font-size: .72rem;
    cursor: pointer;
    transition: color .15s, border-color .15s;
}

.ep-btn-discard:hover { color: var(--text); border-color: rgba(255,255,255,.12); }

.ep-btn-save {
    background: var(--primary);
    border: none;
    color: #000;
    padding: 9px 24px;
    border-radius: 8px;
    font-family: inherit;
    font-size: .72rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
    position: relative;
    overflow: hidden;
    min-width: 110px;
}

.ep-btn-save:hover    { opacity: .88; }
.ep-btn-save:disabled { opacity: .3; cursor: not-allowed; }
.ep-btn-save.saving .ep-save-label   { opacity: 0; }
.ep-btn-save.saving .ep-save-spinner { display: flex; }

.ep-save-spinner {
    display: none;
    align-items: center;
    gap: 4px;
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
}

.ep-save-spinner span {
    width: 4px; height: 4px;
    border-radius: 50%;
    background: #000;
    animation: spin-dot .7s ease-in-out infinite;
}
.ep-save-spinner span:nth-child(2) { animation-delay: .12s; }
.ep-save-spinner span:nth-child(3) { animation-delay: .24s; }

@keyframes spin-dot {
    0%, 80%, 100% { transform: scale(.4); opacity: .4; }
    40%            { transform: scale(1); opacity: 1; }
}

/* Ник hint */
.nick-hint.ok  { color: var(--primary); }
.nick-hint.err { color: var(--accent); }


/* ════════════════════════════════════════════
   LIVING TILES — ЖИВЫЕ ПЛИТКИ
   Анимации для треков, плейлистов, лайков
════════════════════════════════════════════ */

/* ── Track rows ── */
.track-row {
    transition:
        background .15s,
        border-color .15s,
        transform .22s cubic-bezier(.23, 1, .32, 1),
        box-shadow .22s;
}

.track-row:hover {
    transform: translateX(6px);
    box-shadow: -3px 0 0 var(--primary);
}

.track-row.playing {
    transform: translateX(6px);
    box-shadow: -3px 0 0 var(--primary);
}

/* Обёртка обложки трека с ring-эффектом */
.tr-cover-wrap {
    position: relative;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
}

.tr-cover-wrap::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 6px;
    background: conic-gradient(var(--primary), var(--accent), var(--primary));
    opacity: 0;
    z-index: 0;
    animation: spin-ring 3s linear infinite;
    transition: opacity .3s;
}

.track-row:hover .tr-cover-wrap::after,
.track-row.playing .tr-cover-wrap::after {
    opacity: 0.7;
}

.tr-cover-wrap .tr-cover,
.tr-cover-wrap .tr-cover-placeholder {
    position: relative;
    z-index: 1;
    width: 40px;
    height: 40px;
    border-radius: 4px;
}


/* ── Playlist cards ── */
.playlist-grid .pl-card {
    transition: transform .3s cubic-bezier(.22, 1, .36, 1), box-shadow .3s;
}

.playlist-grid .pl-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 36px rgba(0, 0, 0, .4);
}

/* Ring вокруг обложки плейлиста */
.pl-cover-wrap {
    position: relative;
}

.pl-cover-wrap::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 9px;
    background: conic-gradient(var(--primary), var(--accent), var(--primary));
    opacity: 0;
    z-index: 0;
    animation: spin-ring 4s linear infinite;
    transition: opacity .3s;
}

.pl-card:hover .pl-cover-wrap::before {
    opacity: 0.75;
}

.pl-cover-wrap > img,
.pl-cover-wrap > .pl-cover-placeholder,
.pl-overlay {
    position: relative;
    z-index: 1;
}

/* ── Like rows ── */
.lk-row {
    transition:
        background .15s,
        border-color .15s,
        transform .2s cubic-bezier(.23, 1, .32, 1);
}

.lk-row:hover {
    transform: translateX(4px);
    border-left: 2px solid var(--accent);
    padding-left: 6px;
}

/* Пульс сердечка при hover */
.lk-row:hover .lk-heart {
    animation: heart-beat .4s ease-in-out;
}

@keyframes heart-beat {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.4); }
    60%  { transform: scale(.9); }
    100% { transform: scale(1); }
}


/* ── Following rows ── */
.fw-row {
    transition:
        background .15s,
        border-color .15s,
        transform .2s cubic-bezier(.23, 1, .32, 1);
}

.fw-row:hover {
    transform: translateX(3px);
}


/* ════════════════════════════════════════════
   STATUS FLASH
════════════════════════════════════════════ */

.status-flash {
    position: fixed;
    top: 66px;
    right: 16px;
    z-index: 9500;
    background: var(--surf-el);
    border: 1px solid rgba(68, 217, 149, .3);
    border-radius: 10px;
    padding: 10px 16px;
    font-family: "Courier New", monospace;
    font-size: .64rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--primary);
    box-shadow: 0 12px 32px rgba(0,0,0,.5);
    opacity: 0;
    transform: translateY(-8px) scale(.96);
    transition: opacity .25s, transform .3s cubic-bezier(.22, 1, .36, 1);
    pointer-events: none;
}

.status-flash.show { opacity: 1; transform: translateY(0) scale(1); }
.status-flash.err  { border-color: rgba(255, 92, 58, .3); color: var(--accent); }


/* ════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════ */

@media (max-width: 700px) {
    .edit-panel-grid {
        grid-template-columns: 1fr;
    }
}