/* Profile Control Center V2 */

.profile-view-pane {
    height: 100%;
    color: var(--text);
    overflow: hidden;
}

.profile-shell {
    height: 100%;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    background: var(--bg-dark);
}

.profile-nav {
    border-right: 1px solid var(--border);
    background: #1b1b1c;
    padding: 16px 12px;
    overflow-y: auto;
}

.profile-brand {
    margin-bottom: 14px;
}

.profile-brand h2 {
    margin: 0;
    font-size: 18px;
}

.profile-nav-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-nav-btn {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-panel);
    color: var(--text);
    cursor: pointer;
    text-align: left;
    padding: 9px 10px;
    font-size: 13px;
}

.profile-nav-btn.active {
    border-color: var(--accent);
    background: rgba(0, 122, 204, 0.25);
}

.profile-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.profile-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg-panel);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.profile-header-main h2 {
    margin: 0;
    font-size: 20px;
}

.profile-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid #4f6f9e;
    background: rgba(0, 122, 204, 0.2);
    color: #9ac8ff;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
}

.profile-muted {
    color: var(--text-muted);
    font-size: 12px;
}

.profile-status {
    margin: 10px 16px 0 16px;
    border-radius: 8px;
    border: 1px solid #2e8b48;
    background: rgba(54, 168, 83, 0.2);
    color: #9be59f;
    padding: 9px 11px;
    font-size: 13px;
}

.profile-status.error {
    border-color: #8f2a2a;
    background: rgba(186, 40, 40, 0.2);
    color: #ffb6b6;
}

.profile-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 16px;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.profile-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    min-width: 0;
    margin-bottom: 12px;
}

.profile-card h3 {
    margin: 0 0 8px 0;
    font-size: 15px;
}

.profile-card h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: var(--text-muted);
}

.profile-kpi {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.15;
}

.profile-list {
    margin: 0;
    padding-left: 18px;
}

.profile-list li {
    margin: 4px 0;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.profile-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-form-field label {
    font-size: 12px;
    color: var(--text-muted);
}

.profile-form input,
.profile-form select,
.profile-form textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--bg-dark);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
}

.profile-form .profile-native-check {
    width: 18px;
    height: 18px;
    padding: 0;
    border-radius: 4px;
    accent-color: var(--accent);
    cursor: pointer;
    flex: 0 0 auto;
}

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

.profile-help {
    color: var(--text-muted);
    font-size: 12px;
}

.profile-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-avatar-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.profile-avatar-preview {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #52585f;
    background: #1a1a1a;
}

.profile-check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.profile-check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #1f1f22;
    padding: 8px 10px;
    min-height: 42px;
    cursor: pointer;
}

.profile-check-item:hover {
    border-color: #4d5f74;
}

.profile-check-label {
    color: var(--text);
    line-height: 1.2;
    font-weight: 500;
}

.profile-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
    flex: 0 0 auto;
}

.profile-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.profile-switch-slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #3a3f47;
    border: 1px solid #5a6170;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.profile-switch-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 2px;
    top: 2px;
    border-radius: 50%;
    background: #f1f3f5;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease;
}

.profile-switch input:checked + .profile-switch-slider {
    background: var(--accent);
    border-color: #2f95e8;
}

.profile-switch input:checked + .profile-switch-slider::before {
    transform: translateX(20px);
}

.profile-switch input:focus-visible + .profile-switch-slider {
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.35);
}

.profile-preview-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.profile-preview-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #1a1d20;
    padding: 12px;
}

.profile-preview-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
}

.profile-preview-avatar {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #536272;
}

.profile-contact-list {
    display: grid;
    gap: 8px;
}

.profile-contact-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #1f1f21;
    padding: 8px 10px;
}

.profile-contact-main {
    display: flex;
    gap: 10px;
    align-items: center;
}

.profile-contact-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-empty {
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-muted);
}

.profile-danger {
    border-color: #8f2a2a;
    background: rgba(186, 40, 40, 0.12);
}

.profile-danger h3 {
    color: #ff9c9c;
}

.profile-public-overlay {
    z-index: 2300;
}

.profile-public-modal {
    width: 540px;
    max-width: calc(100vw - 24px);
    text-align: left;
    position: relative;
}

.profile-public-close {
    position: absolute;
    top: 8px;
    right: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.profile-public-sections {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-public-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-public-avatar {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e6a23c;
}

.profile-public-header-main h2 {
    margin: 0;
}

.profile-public-instruments {
    color: #e6a23c;
    font-size: 13px;
    margin-top: 3px;
}

.profile-public-desc {
    background: #1c1f23;
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: 7px;
}

.profile-public-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.profile-public-stat-card {
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #1b1e22;
    text-align: center;
    padding: 9px;
}

.profile-public-stat-value {
    font-size: 18px;
    font-weight: 700;
}

.profile-public-list-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.profile-public-list-tag {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    background: #1d1f22;
}

.profile-public-actions {
    display: flex;
    gap: 8px;
}

.profile-public-private {
    border: 1px solid #845f10;
    background: rgba(214, 163, 23, 0.12);
    border-radius: 7px;
    color: #ffd57a;
    padding: 14px;
    text-align: center;
}

body.light-theme .profile-nav {
    background: #f6f8fc;
}

body.light-theme .profile-pill {
    border-color: rgba(0, 120, 212, 0.35);
    background: rgba(0, 120, 212, 0.12);
    color: #0f5f9f;
}

body.light-theme .profile-status {
    border-color: #2f8b48;
    background: rgba(54, 168, 83, 0.11);
    color: #1f6d34;
}

body.light-theme .profile-status.error {
    border-color: #a73737;
    background: rgba(186, 40, 40, 0.1);
    color: #8f2a2a;
}

body.light-theme .profile-avatar-preview {
    border-color: #c4cedb;
    background: #eef2f9;
}

body.light-theme .profile-check-item {
    background: #f8fafd;
}

body.light-theme .profile-check-item:hover {
    border-color: #7c8ea7;
}

body.light-theme .profile-switch-slider {
    background: #d7dfea;
    border-color: #b0bece;
}

body.light-theme .profile-preview-card {
    background: #ffffff;
}

body.light-theme .profile-preview-avatar {
    border-color: #c3cfde;
}

body.light-theme .profile-contact-item {
    background: #ffffff;
}

body.light-theme .profile-danger {
    border-color: #b34141;
    background: rgba(186, 40, 40, 0.08);
}

body.light-theme .profile-danger h3 {
    color: #9b3535;
}

body.light-theme .profile-public-avatar {
    border-color: #cf9035;
}

body.light-theme .profile-public-instruments {
    color: #b87a1d;
}

body.light-theme .profile-public-desc {
    background: #f8fbff;
}

body.light-theme .profile-public-stat-card {
    background: #f8fbff;
}

body.light-theme .profile-public-list-tag {
    background: #eef3fa;
}

body.light-theme .profile-public-private {
    border-color: #c7902e;
    background: rgba(214, 163, 23, 0.1);
    color: #7b5a1e;
}

@media (max-width: 1100px) {
    .profile-shell {
        grid-template-columns: 210px minmax(0, 1fr);
    }
}

@media (max-width: 900px) {
    .profile-shell {
        grid-template-columns: 1fr;
    }

    .profile-nav {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .profile-nav-list {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .profile-nav-btn {
        text-align: center;
    }

    .profile-form-row,
    .profile-grid,
    .profile-check-grid {
        grid-template-columns: 1fr;
    }
}
