/* meu-perfil.css — Perfil Instagram-like + Editor */

/* ============================================================
   Layout principal
   ============================================================ */
.profile-page {
    width: min(640px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 64px;
}

/* ============================================================
   PUBLIC VIEW (Instagram-like)
   ============================================================ */
.profile-public {
    display: grid;
    gap: 0;
}

.profile-public__cover {
    display: flex;
    justify-content: center;
    padding: 32px 0 16px;
}

.profile-public__avatar-wrap {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(138, 5, 190, 0.3);
    box-shadow: 0 0 24px rgba(138, 5, 190, 0.1);
}

.profile-public__avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-public__info {
    text-align: center;
    padding: 0 20px 24px;
}

.profile-public__info h1 {
    font-family: 'Sora', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    letter-spacing: -0.02em;
}

.profile-public__tagline {
    font-size: 0.88rem;
    color: var(--text-secondary, #c9b8e8);
    margin: 4px 0 0;
}

.profile-public__tagline[hidden] { display: none; }

.profile-public__meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
}

.profile-public__meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
    color: var(--text-muted, #8b7aaa);
    font-weight: 600;
}

.profile-public__meta span[hidden] { display: none; }

.profile-public__meta .material-symbols-rounded {
    font-size: 0.95rem;
    font-variation-settings: 'FILL' 1;
}

.profile-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    height: 36px;
    padding: 0 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.profile-edit-btn .material-symbols-rounded { font-size: 1rem; }
.profile-edit-btn:hover {
    border-color: var(--accent, #8a05be);
    color: var(--accent, #8a05be);
}

/* Stats */
.profile-public__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-public__stats[hidden] { display: none; }

.profile-public__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 8px;
}

.profile-public__stat strong {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
}

.profile-public__stat span {
    font-size: 0.75rem;
    color: var(--text-muted, #8b7aaa);
    font-weight: 600;
    margin-top: 2px;
}

/* Sections */
.profile-public__section {
    padding: 24px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-public__section[hidden] { display: none; }

.profile-public__section h2 {
    font-family: 'Sora', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
}

.profile-public__section h2 .material-symbols-rounded {
    font-size: 1rem;
    color: var(--accent, #8a05be);
    font-variation-settings: 'FILL' 1;
}

.profile-public__section p {
    font-size: 0.88rem;
    color: var(--text-secondary, #c9b8e8);
    line-height: 1.65;
    margin: 0;
    white-space: pre-wrap;
}

/* Portfolio grid */
.profile-public__portfolio {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
}

.profile-public__portfolio-item {
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 2px;
}

/* ============================================================
   EDIT VIEW
   ============================================================ */
.profile-edit {
    display: grid;
    gap: 20px;
}

.profile-edit[hidden] { display: none; }

.profile-edit__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0 16px;
}

.profile-edit__back {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
}
.profile-edit__back:hover { background: rgba(255, 255, 255, 0.05); }

.profile-edit__header h2 {
    font-family: 'Sora', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.profile-edit__avatar-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
}

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

.profile-edit__section {
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
}

.profile-edit__section h3 {
    font-family: 'Sora', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
}

.profile-edit__section h3 .material-symbols-rounded {
    font-size: 1rem;
    color: var(--accent, #8a05be);
    font-variation-settings: 'FILL' 1;
}

/* ============================================================
   Avatar
   ============================================================ */
.avatar-wrap {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(138, 5, 190, 0.25);
    flex-shrink: 0;
}

.avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
}

.avatar-overlay .material-symbols-rounded {
    font-size: 22px;
    color: #fff;
}

.avatar-wrap:hover .avatar-overlay,
.avatar-overlay:focus-visible {
    opacity: 1;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 10px;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1;
}

.btn .material-symbols-rounded { font-size: 18px; }

.btn--sm {
    height: 36px;
    padding: 0 14px;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn--lg {
    height: 48px;
    padding: 0 28px;
    font-size: 0.92rem;
    border-radius: 12px;
}

.btn--primary {
    background: var(--accent, #8a05be);
    color: #fff;
}
.btn--primary:hover {
    background: #7504a8;
    transform: translateY(-1px);
}
.btn--primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn--outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
}
.btn--outline:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.04);
}

.btn--ghost {
    background: transparent;
    border: none;
    color: var(--text-muted, #8b7aaa);
    padding: 0 10px;
}
.btn--ghost:hover { color: #c94a4a; }

/* ============================================================
   Form
   ============================================================ */
.profile-edit__form {
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
}

.form-fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.form-section-title {
    font-family: 'Sora', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary, #c9b8e8);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 20px 0 16px;
    padding: 16px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.form-fieldset:first-of-type .form-section-title {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.form-field {
    display: block;
    margin-bottom: 18px;
}

.form-field__label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted, #8b7aaa);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.profile-edit__form input,
.profile-edit__form select,
.profile-edit__form textarea,
.profile-edit__section textarea {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    font-size: 0.9rem;
    font-family: 'Manrope', sans-serif;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.profile-edit__form input:focus,
.profile-edit__form select:focus,
.profile-edit__form textarea:focus,
.profile-edit__section textarea:focus {
    border-color: rgba(138, 5, 190, 0.4);
}

.profile-edit__form input::placeholder,
.profile-edit__form textarea::placeholder,
.profile-edit__section textarea::placeholder {
    color: var(--text-muted, #8b7aaa);
}

.profile-edit__form select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.profile-edit__form input[readonly] {
    opacity: 0.5;
    cursor: not-allowed;
}

.profile-edit__section textarea {
    height: auto;
    min-height: 100px;
    padding: 12px 14px;
    resize: vertical;
    line-height: 1.6;
}

.textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    gap: 12px;
}

.textarea-footer small {
    font-size: 0.72rem;
    color: var(--text-muted, #8b7aaa);
}

.char-count {
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.form-actions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.form-actions .btn { width: 100%; }

/* ============================================================
   Portfolio (edit)
   ============================================================ */
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.portfolio-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.portfolio-item__media {
    width: 100%;
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
}

.portfolio-item .btn {
    width: 100%;
    border-radius: 0;
    height: 30px;
    font-size: 0.72rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-muted, #8b7aaa);
}
.portfolio-item .btn:hover { color: #c94a4a; }

.data-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 24px 16px;
    color: var(--text-muted, #8b7aaa);
    font-size: 0.85rem;
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    background: rgba(12, 6, 24, 0.95);
    border: 1px solid rgba(138, 5, 190, 0.2);
    border-radius: 12px;
    color: #fff;
    padding: 14px 22px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Manrope', sans-serif;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
    z-index: 200;
    backdrop-filter: blur(16px);
    max-width: 380px;
    animation: toastSlideIn 0.3s ease;
}
.toast[hidden] { display: none; }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 640px) {
    .profile-page {
        width: calc(100% - 24px);
        padding: 16px 0 40px;
    }

    .profile-public__avatar-wrap {
        width: 86px;
        height: 86px;
    }

    .profile-public__info h1 { font-size: 1.2rem; }

    .profile-edit__avatar-row {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }

    .profile-edit__form,
    .profile-edit__section {
        padding: 16px;
    }

    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .toast {
        right: 12px;
        left: 12px;
        bottom: 16px;
        max-width: none;
    }
}
