@import url("watch-sections.css");

/* ===== Профиль ===== */
.profile-edit-container { max-width: 1200px; margin: 0 auto; padding: 20px; }
.profile-layout { display: grid; grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr); gap: 12px; align-items: start; }

.preview-column { position: sticky; top: calc(var(--site-chrome-height) + 12px); min-width: 0; overflow: hidden; display: grid; gap: 12px; }
.preview-card,
.form-section {
    background: rgba(12, 12, 12, 0.56);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}

.preview-card h3,
.form-section h3 {
    margin: 0 0 18px;
    font-weight: 400;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.46);
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.preview-avatar { text-align: center; margin-bottom: 18px; }
.avatar-img { width: 130px; height: 130px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.15); transition: border-color 0.3s; }
.preview-bio h4, .preview-links h4, .preview-media h4 { color: rgba(255,255,255,0.5); font-weight: 400; font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; margin: 0 0 10px; }
.bio-content { line-height: 1.7; margin-bottom: 20px; font-size: 15px; color: rgba(255,255,255,0.8); overflow-wrap: break-word; word-break: break-word; }
.empty-bio { color: rgba(255,255,255,0.3); font-style: italic; text-align: center; }
.bio-media-preview { max-width: 100%; border-radius: 10px; margin: 10px 0; display: block; }
.audio-container { margin: 10px 0; }
.audio-container audio { width: 100%; }
.link-item { display: block; padding: 12px 14px; background: rgba(255,255,255,0.04); border-radius: 12px; color: rgba(255,255,255,0.7); text-decoration: none; transition: background 0.2s, border-color 0.2s; font-size: 14px; word-break: break-all; margin-bottom: 6px; border: 1px solid rgba(255,255,255,0.06); }
.link-item:hover { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.12); }
.media-item { padding: 10px 14px; background: rgba(255,255,255,0.04); border-radius: 12px; font-size: 14px; color: rgba(255,255,255,0.6); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid rgba(255,255,255,0.06); }
.public-profile-link { margin-top: 0; }
.btn-public { display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(12, 12, 12, 0.56); border: 1px solid rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); text-decoration: none; border-radius: 16px; transition: all 0.2s; font-size: 14px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn-public:hover { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.16); }

.edit-column { display: flex; flex-direction: column; }
.edit-form { display: flex; flex-direction: column; gap: 12px; }

.bio-textarea, .link-input, .media-select {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    padding: 8px 10px;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s, background 0.2s;
}

.bio-textarea { resize: vertical; min-height: 110px; }
.bio-textarea:focus, .link-input:focus, .media-select:focus { outline: none; border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.1); }
.bio-textarea::placeholder, .link-input::placeholder { color: rgba(255,255,255,0.25); }
.media-select option { background: #101010; color: #fff; }

.media-insert { margin-top: 14px; }
.media-insert label { display: block; margin-bottom: 8px; color: rgba(255,255,255,0.5); font-size: 13px; }
.insert-controls { display: flex; gap: 10px; }
.media-select { flex: 1; }

.file-upload-btn { cursor: pointer; display: inline-flex; }
.file-upload-name { margin-left: 12px; font-size: 14px; color: rgba(255,255,255,0.5); vertical-align: middle; }
.form-section small { display: block; margin-top: 8px; color: rgba(255,255,255,0.35); font-size: 13px; }

.link-add { display: flex; gap: 10px; margin-bottom: 4px; }
.link-input { flex: 1; }
.links-list-edit { display: flex; flex-direction: column; gap: 6px; }
.link-item-edit { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: rgba(255,255,255,0.04); border-radius: 12px; transition: all 0.2s; border: 1px solid rgba(255,255,255,0.06); }
.link-item-edit a { flex: 1; color: rgba(255,255,255,0.7); font-size: 14px; word-break: break-all; text-decoration: none; }
.link-item-edit a:hover { color: #fff; }

.marked-for-delete { opacity: 0.4; background: rgba(255,80,80,0.06) !important; border: 1px dashed rgba(255,80,80,0.25) !important; }
.marked-for-delete a { text-decoration: line-through !important; }
.marked-for-delete .btn-inline-delete { color: rgba(80,200,80,0.7) !important; }

.btn-inline-delete { background: none; border: none; color: rgba(255,80,80,0.5); cursor: pointer; font-size: 16px; padding: 4px 8px; border-radius: 4px; transition: all 0.2s; line-height: 1; }
.btn-inline-delete:hover { color: #ff6b6b; background: rgba(255,80,80,0.1); }

.toggle-label { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 14px; color: rgba(255,255,255,0.6); cursor: pointer; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.media-card { background: rgba(255,255,255,0.04); border-radius: 16px; overflow: hidden; border: 1px solid rgba(255,255,255,0.08); transition: all 0.2s; }
.media-card:hover { border-color: rgba(255,255,255,0.15); }
.media-card.marked-for-delete { border-style: dashed; }
.media-card.marked-for-delete .media-thumb { filter: grayscale(1); }
.media-thumb { height: 100px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.02); overflow: hidden; transition: filter 0.2s; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-icon { font-size: 32px; opacity: 0.4; }
.media-card-name { padding: 8px 10px 4px; font-size: 12px; color: rgba(255,255,255,0.6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
.media-card-actions { display: flex; justify-content: space-between; padding: 4px 8px 8px; }
.btn-toggle-public { background: none; border: none; cursor: pointer; font-size: 16px; padding: 4px 6px; border-radius: 4px; transition: all 0.2s; opacity: 0.5; }
.btn-toggle-public:hover { background: rgba(255,255,255,0.08); opacity: 0.8; }
.btn-toggle-public.is-public { opacity: 1; }
.btn-toggle-public.changed { outline: 1px dashed rgba(255,255,255,0.3); outline-offset: 2px; }

.pending-file-item { padding: 8px 10px; font-size: 13px; color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.03); border-radius: 10px; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid rgba(255,255,255,0.05); }

.upload-progress { padding: 14px 18px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; color: rgba(255,255,255,0.7); font-size: 14px; text-align: center; }

.btn-save { padding: 14px 36px !important; font-size: 15px !important; }
.form-actions { text-align: center; margin-top: 4px; }

.message-container { margin-top: 4px; display: grid; gap: 8px; }
.message-container .success { background: rgba(80,200,80,0.1); color: rgba(140,230,140,0.9); padding: 14px; border-radius: 12px; border: 1px solid rgba(80,200,80,0.2); font-size: 14px; margin-bottom: 0; }
.message-container .error { background: rgba(255,80,80,0.1); color: rgba(255,140,140,0.9); padding: 14px; border-radius: 12px; border: 1px solid rgba(255,80,80,0.2); font-size: 14px; margin-bottom: 0; }
.file-download-link { color: rgba(255,255,255,0.7); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-download-link:hover { color: #fff; }

/* ===== Кастомный аудиоплеер ===== */
.custom-audio{display:flex;align-items:center;gap:10px;padding:8px 12px;background:rgba(255,255,255,0.05);border:1px solid rgba(255,255,255,0.1);border-radius:8px;margin:10px 0;height:48px;}
.custom-audio audio{display:none!important;}
.audio-play{background:none;border:1px solid rgba(255,255,255,0.2);color:rgba(255,255,255,0.8);width:32px;height:32px;min-width:32px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all 0.2s;padding:0;}
.audio-play:hover{background:rgba(255,255,255,0.1);border-color:rgba(255,255,255,0.3);}
.ap-icon{display:block;position:relative;}
.ap-play{width:0;height:0;border-style:solid;border-width:5px 0 5px 9px;border-color:transparent transparent transparent rgba(255,255,255,0.8);margin-left:2px;}
.ap-pause{width:10px;height:10px;}
.ap-pause::before,.ap-pause::after{content:'';position:absolute;top:0;width:3px;height:10px;background:rgba(255,255,255,0.8);border-radius:1px;}
.ap-pause::before{left:0;}
.ap-pause::after{right:0;}
.audio-info{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:center;gap:4px;}
.audio-name{font-size:12px;color:rgba(255,255,255,0.5);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1;}
.audio-progress{height:4px;background:rgba(255,255,255,0.1);border-radius:2px;cursor:pointer;overflow:hidden;}
.audio-bar{height:100%;background:rgba(255,255,255,0.4);border-radius:2px;width:0%;transition:width 0.1s linear;}
.audio-time{font-size:11px;color:rgba(255,255,255,0.4);white-space:nowrap;flex-shrink:0;}
.audio-vol{display:flex;align-items:center;gap:4px;flex-shrink:0;}
.audio-vol-icon{cursor:pointer;font-size:14px;opacity:0.5;transition:opacity 0.2s;user-select:none;}
.audio-vol-icon:hover{opacity:0.8;}
.audio-vol-slider{width:50px;height:4px;-webkit-appearance:none;appearance:none;background:rgba(255,255,255,0.1);border-radius:2px;outline:none;cursor:pointer;}
.audio-vol-slider::-webkit-slider-thumb{-webkit-appearance:none;width:10px;height:10px;border-radius:50%;background:rgba(255,255,255,0.6);cursor:pointer;}
.audio-vol-slider::-moz-range-thumb{width:10px;height:10px;border-radius:50%;background:rgba(255,255,255,0.6);border:none;cursor:pointer;}
.audio-vol-slider::-moz-range-track{background:rgba(255,255,255,0.1);border-radius:2px;height:4px;}


/* ===== Оформление — пресеты ===== */

.theme-label { display: block; margin-bottom: 10px; color: rgba(255,255,255,0.6); font-size: 14px; }

.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.preset-card {
    appearance: none;
    width: 100%;
    padding: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.08);
    overflow: hidden;
    transition: all 0.2s;
    text-align: center;
}

.preset-card:hover { border-color: rgba(255,255,255,0.2); }
.preset-card.active { border-color: rgba(255,255,255,0.5); }

.preset-preview {
    height: 70px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 5px;
}

.preset-dot {
    width: 18px; height: 18px;
    border-radius: 50%;
    margin-bottom: 2px;
}

.preset-line {
    height: 4px; width: 70%;
    border-radius: 2px;
    opacity: 0.5;
}

.preset-line.short { width: 45%; }

.preset-name {
    display: block;
    padding: 8px;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.04);
}

/* Кастомные цвета */
.theme-custom { margin-top: 6px; }

.color-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.color-field {
    min-width: 0;
}

.color-field label {
    display: block;
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 6px;
}

.color-field small {
    margin-top: 8px;
}

.color-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.color-picker {
    width: 40px; height: 36px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    padding: 2px;
    flex-shrink: 0;
}

.color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker::-webkit-color-swatch { border: none; border-radius: 2px; }

.color-hex {
    flex: 1;
    min-width: 0;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    padding: 8px 10px;
    color: #fff;
    font-size: 13px;
    font-family: monospace;
}

.color-hex:focus { outline: none; border-color: rgba(255,255,255,0.35); }

.font-select, .bg-media-select {
    margin-bottom: 14px;
}

.font-select label, .bg-media-select label {
    display: block;
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 6px;
}


/* ===== Модалка превью темы ===== */

.theme-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-modal-content {
    width: 95%;
    max-width: 1000px;
    height: 92vh;
    background: #111;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.theme-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.7);
    font-size: 14px;
}

.theme-preview-frame {
    flex: 1;
    border: none;
    background: #000;
    width: 100%;
}


/* ===== Адаптивность ===== */

@media (max-width: 768px) {
    .profile-layout { grid-template-columns: 1fr; }
    .preview-column { position: static; }
    .media-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .insert-controls, .link-add { flex-direction: column; }
    .form-section { padding: 18px; }
    .color-row { flex-direction: column; }
    .preset-grid { grid-template-columns: repeat(2, 1fr); }
    .theme-modal-content { width: 95%; height: 90vh; }
}
