/* profile.css v1.0 — Área do Usuário */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@700;800;900&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,700&display=swap');

:root {
    --bg-primary: #0E1020;
    --bg-secondary: #141628;
    --bg-card: #141628;
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --text-primary: #DADDF0;
    --text-secondary: #9AA0BE;
    --text-muted: #6B7090;
    --accent-primary: #00B8E8;
    --accent-glow: rgba(0, 184, 232, 0.3);
    --accent-success: #22c55e;
    --accent-warning: #F5A000;
    --accent-danger: #E8440A;
    --accent-info: #8B2FC9;
    --transition-fast: all 0.2s ease;
    --transition-smooth: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    min-height: 100vh;
}

/* --- Access Denied --- */
.access-denied {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg-primary);
}

.access-denied-card {
    text-align: center;
    padding: 50px 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    max-width: 400px;
}

.access-denied-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.access-denied-card h2 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.access-denied-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.profile-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #4285f4, #34a853);
    border: none;
    border-radius: 50px;
    color: white;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.profile-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 133, 244, 0.4);
}

.back-link {
    display: inline-block;
    margin-top: 15px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.back-link:hover {
    color: var(--accent-primary);
}

/* --- Profile Layout --- */
.profile-page {
    display: none;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Profile Header --- */
.profile-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--glass-border);
    padding: 30px 40px;
}

.profile-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.profile-user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid var(--accent-primary);
    object-fit: cover;
    box-shadow: 0 0 20px var(--accent-glow);
}

.profile-avatar-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid var(--accent-primary);
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 700;
}

.profile-email {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 2px;
}

.profile-member-since {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 4px;
}

.profile-header-actions {
    display: flex;
    gap: 10px;
}

.profile-edit-btn,
.profile-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
}

.profile-edit-btn:hover {
    background: rgba(0, 184, 232, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.profile-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
}

/* --- Stats Cards --- */
.profile-stats {
    max-width: 1200px;
    margin: 25px auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    width: 100%;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    transition: var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--glass-shadow);
}

.stat-card .stat-icon {
    font-size: 1.4rem;
    margin-bottom: 8px;
    color: var(--accent-primary);
}

.stat-card.stat-pending .stat-icon {
    color: var(--accent-warning);
}

.stat-card.stat-approved .stat-icon {
    color: var(--accent-success);
}

.stat-card.stat-rejected .stat-icon {
    color: var(--accent-danger);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-card.stat-pending .stat-value {
    color: var(--accent-warning);
}

.stat-card.stat-approved .stat-value {
    color: var(--accent-success);
}

.stat-card.stat-rejected .stat-value {
    color: var(--accent-danger);
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Content Area --- */
.profile-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px 40px;
    width: 100%;
    flex: 1;
}

/* --- Toolbar --- */
.profile-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.profile-toolbar h2 {
    font-size: 1.15rem;
    font-weight: 600;
}

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

.filter-select {
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* --- Posts Grid --- */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.post-card {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    overflow: hidden;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.12);
}

.post-card-media {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--bg-primary);
}

.post-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-card-media img {
    transform: scale(1.05);
}

.post-card-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card-media-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 2.5rem;
    color: var(--text-muted);
}

.post-type-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
}

.post-status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
}

.post-status-badge.status-approved {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.post-status-badge.status-pending {
    background: rgba(245, 160, 0, 0.2);
    color: #F5A000;
    border: 1px solid rgba(245, 160, 0, 0.3);
}

.post-status-badge.status-rejected {
    background: rgba(232, 68, 10, 0.2);
    color: #f87171;
    border: 1px solid rgba(232, 68, 10, 0.3);
}

.post-card-body {
    padding: 14px 16px;
}

.post-card-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.post-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.post-card-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-card-photo-date {
    color: var(--accent-primary);
    font-size: 0.72rem;
}

.post-card-actions {
    display: flex;
    gap: 6px;
    padding: 10px 16px 14px;
    border-top: 1px solid var(--glass-border);
}

.post-action-btn {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.post-action-btn.btn-edit:hover {
    background: rgba(0, 184, 232, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.post-action-btn.btn-view:hover {
    background: rgba(139, 47, 201, 0.1);
    border-color: var(--accent-info);
    color: var(--accent-info);
}

.post-action-btn.btn-delete:hover {
    background: rgba(232, 68, 10, 0.1);
    border-color: var(--accent-danger);
    color: var(--accent-danger);
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 60px 30px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 8px;
}

.empty-state .empty-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- Edit Modal --- */
.edit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}

.edit-modal-overlay.active {
    display: flex;
}

.edit-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    width: 500px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.edit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
}

.edit-modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.edit-modal-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-modal-close:hover {
    background: rgba(232, 68, 10, 0.1);
    color: var(--accent-danger);
    border-color: var(--accent-danger);
}

.edit-modal-body {
    padding: 24px;
}

.edit-modal-preview {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 20px;
}

.edit-field {
    margin-bottom: 18px;
}

.edit-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.edit-field textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
    transition: var(--transition-fast);
}

.edit-field textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px var(--accent-glow);
}

.edit-field select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.edit-field select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.edit-field .edit-info {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.edit-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--glass-border);
}

.modal-btn {
    padding: 10px 24px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-btn-cancel {
    background: transparent;
    color: var(--text-secondary);
}

.modal-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
}

.modal-btn-save {
    background: linear-gradient(135deg, var(--accent-primary), #0096C0);
    color: white;
    border: none;
}

.modal-btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px var(--accent-glow);
}

/* --- Edit Nickname Modal --- */
.nickname-edit-modal .edit-field input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.nickname-edit-modal .edit-field input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px var(--accent-glow);
}

/* --- Visibility Badge --- */
.post-visibility-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 600;
}

.visibility-public {
    background: rgba(0, 184, 232, 0.1);
    color: var(--accent-primary);
}

.visibility-private {
    background: rgba(139, 47, 201, 0.1);
    color: var(--accent-info);
}

/* --- Loading Spinner --- */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.loading-spinner i {
    font-size: 1.5rem;
    margin-bottom: 10px;
    display: block;
    color: var(--accent-primary);
}

/* --- Toast --- */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px 24px;
    color: var(--text-primary);
    font-size: 0.9rem;
    z-index: 9999;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .profile-header {
        padding: 20px;
    }

    .profile-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 20px;
    }

    .profile-content {
        padding: 0 20px 30px;
    }

    .profile-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .profile-header-actions {
        width: 100%;
    }

    .profile-edit-btn,
    .profile-back-btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}