/* PROFILE PAGE STYLES */

.profile-container {
    max-width: 935px;
    margin: 80px auto 0;
    padding: 0 20px 40px;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* PROFILE HEADER */
.profile-header {
    display: flex;
    gap: 80px;
    padding: 30px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.profile-avatar-section {
    flex-shrink: 0;
}

.profile-avatar-ring {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--gradient);
    padding: 4px;
    cursor: pointer;
    transition: transform 0.3s;
}

.profile-avatar-ring:hover {
    transform: scale(1.02);
}

.profile-avatar-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid var(--bg);
    overflow: hidden;
    background: var(--bg-tertiary);
}

.profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* PROFILE INFO */
.profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-top {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.profile-username {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-username .verified {
    font-size: 20px;
}

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

.btn-edit-profile {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 8px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-edit-profile:hover {
    background: var(--border);
}

.btn-share-profile,
.btn-settings {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.3s;
}

.btn-share-profile:hover,
.btn-settings:hover {
    color: var(--text-secondary);
}

/* PROFILE STATS */
.profile-stats {
    display: flex;
    gap: 40px;
}

.stat-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
    cursor: pointer;
}

.stat-number {
    font-weight: 700;
    font-size: 18px;
}

.stat-label {
    font-size: 16px;
    color: var(--text-secondary);
}

.stat-item:hover .stat-label {
    color: var(--text-primary);
}

/* PROFILE BIO */
.profile-bio {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bio-name {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.2px;
}

.bio-role {
    font-size: 14px;
    color: var(--primary);
    font-weight: 600;
    letter-spacing: -0.1px;
}

.bio-description {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
    letter-spacing: -0.1px;
}

.bio-link {
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    margin-top: 4px;
    letter-spacing: -0.1px;
}

.bio-link:hover {
    text-decoration: underline;
}

/* HIGHLIGHTS */
.highlights-section {
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.highlights-wrapper {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 4px;
}

.highlights-wrapper::-webkit-scrollbar {
    display: none;
}

.highlight-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex-shrink: 0;
}

.highlight-ring {
    width: 77px;
    height: 77px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    overflow: hidden;
}

.highlight-ring:hover {
    border-color: var(--text-muted);
    transform: scale(1.05);
}

.highlight-ring.filled {
    border-color: var(--border);
    padding: 3px;
}

.highlight-ring.filled img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.highlight-icon {
    font-size: 28px;
    color: var(--text-secondary);
}

.highlight-name {
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 77px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* PROFILE TABS */
.profile-tabs {
    display: flex;
    justify-content: center;
    gap: 60px;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    padding: 16px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    border-top: 1px solid transparent;
    margin-top: -1px;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: var(--text-secondary);
}

.tab-btn.active {
    color: var(--text-primary);
    border-top-color: var(--text-primary);
}

.tab-btn i {
    font-size: 14px;
}

/* POSTS GRID */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px 0;
}

.grid-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-tertiary);
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.grid-item:hover img {
    transform: scale(1.05);
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.grid-item:hover .grid-overlay {
    opacity: 1;
}

.grid-stats {
    display: flex;
    gap: 24px;
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.grid-stats span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.grid-stats i {
    font-size: 18px;
}

.grid-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 149, 246, 0.85);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s;
}

.grid-tag.ideia {
    background: rgba(255, 193, 7, 0.85);
    color: #000;
}

.grid-tag.novidade {
    background: rgba(88, 195, 34, 0.85);
}

.grid-item:hover .grid-tag {
    opacity: 1;
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 64px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 28px;
    font-weight: 300;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* EDIT PROFILE MODAL */
.edit-profile-modal {
    max-width: 520px;
}

.edit-avatar-section {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    margin-bottom: 24px;
}

.edit-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.edit-avatar-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.edit-avatar-name {
    font-weight: 600;
    font-size: 16px;
}

.change-avatar-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    padding: 0;
}

.change-avatar-btn:hover {
    color: var(--primary-hover);
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
}

.save-profile-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.save-profile-btn:hover {
    background: var(--primary-hover);
}

/* RESPONSIVE - TABLET */
@media (max-width: 1024px) {
    .profile-header {
        gap: 40px;
    }

    .profile-avatar-ring {
        width: 120px;
        height: 120px;
    }

    .profile-username {
        font-size: 24px;
    }

    .profile-stats {
        gap: 30px;
    }
}

/* RESPONSIVE - MOBILE */
@media (max-width: 768px) {
    .profile-container {
        margin-top: 60px;
        padding: 0 0 80px;
    }

    .profile-header {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        padding: 20px 16px;
        text-align: center;
    }

    .profile-avatar-ring {
        width: 86px;
        height: 86px;
    }

    .profile-info {
        align-items: center;
    }

    .profile-top {
        flex-direction: column;
        gap: 12px;
    }

    .profile-username {
        font-size: 22px;
    }

    .profile-actions {
        gap: 8px;
    }

    .btn-edit-profile {
        padding: 8px 20px;
        font-size: 13px;
    }

    .profile-stats {
        justify-content: center;
        gap: 24px;
        padding: 12px 0;
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
        width: 100%;
    }

    .stat-number {
        font-size: 16px;
    }

    .stat-label {
        font-size: 14px;
    }

    .profile-bio {
        align-items: center;
        padding: 0 16px;
    }

    .highlights-section {
        padding: 16px;
    }

    .highlight-ring {
        width: 64px;
        height: 64px;
    }

    .highlight-name {
        max-width: 64px;
        font-size: 11px;
    }

    .profile-tabs {
        gap: 0;
        justify-content: space-around;
    }

    .tab-btn {
        flex-direction: column;
        gap: 4px;
        padding: 12px 0;
        font-size: 10px;
    }

    .tab-btn i {
        font-size: 20px;
    }

    .tab-btn span {
        display: none;
    }

    .posts-grid {
        gap: 2px;
    }

    .grid-stats {
        font-size: 14px;
        gap: 16px;
    }

    .grid-stats i {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .profile-avatar-ring {
        width: 76px;
        height: 76px;
    }

    .profile-username {
        font-size: 20px;
    }

    .btn-edit-profile {
        padding: 6px 16px;
        font-size: 12px;
    }

    .btn-share-profile,
    .btn-settings {
        font-size: 18px;
        padding: 6px;
    }
}

/* AVATAR SELECTOR MODAL */
.avatar-selector-modal {
    max-width: 640px;
    max-height: 85vh;
}

.avatar-selector-modal .modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-selector-modal .modal-header h3 i {
    color: var(--primary);
}

/* AVATAR PREVIEW */
.avatar-preview-section {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(0, 149, 246, 0.08), rgba(188, 24, 136, 0.08));
    border: 1px solid rgba(0, 149, 246, 0.2);
    border-radius: 16px;
    margin-bottom: 20px;
}

.avatar-preview-ring {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--gradient);
    padding: 3px;
    flex-shrink: 0;
}

.avatar-preview-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--bg-secondary);
    background: var(--bg-tertiary);
}

.avatar-preview-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preview-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-name {
    font-size: 18px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
}

.avatar-confirm-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.avatar-confirm-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 149, 246, 0.3);
}

/* AVATAR SEARCH */
.avatar-search {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    transition: all 0.3s;
}

.avatar-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 149, 246, 0.1);
}

.avatar-search i.search-icon {
    color: var(--text-muted);
    margin-right: 10px;
    font-size: 14px;
}

.avatar-search input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    width: 100%;
    outline: none;
    font-family: inherit;
}

.avatar-search input::placeholder {
    color: var(--text-muted);
}

.clear-search {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    transition: color 0.3s;
}

.clear-search:hover {
    color: var(--text-primary);
}

/* AVATAR GRID HEADER */
.avatar-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.avatar-count {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.avatar-grid-view {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 4px;
}

.view-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s;
}

.view-btn:hover {
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* AVATAR GRID */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    max-height: 360px;
    overflow-y: auto;
    padding: 4px;
    scrollbar-width: thin;
}

.avatar-grid::-webkit-scrollbar {
    width: 6px;
}

.avatar-grid::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.avatar-grid::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.avatar-grid::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.avatar-option {
    aspect-ratio: 1;
    border-radius: 14px;
    border: 2px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-tertiary);
    position: relative;
}

.avatar-option:hover {
    border-color: var(--primary);
    transform: scale(1.08);
    box-shadow: 0 8px 20px rgba(0, 149, 246, 0.25);
    z-index: 2;
}

.avatar-option.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 149, 246, 0.3);
}

.avatar-option.selected::after {
    content: '\f058';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.avatar-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.avatar-option:hover img {
    transform: scale(1.1);
}

.avatar-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.avatar-loading i {
    font-size: 40px;
    margin-bottom: 16px;
    animation: spin 1s linear infinite;
    color: var(--primary);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* RESPONSIVE - TABLET */
@media (max-width: 1024px) {
    .avatar-selector-modal {
        max-width: 560px;
    }
}

/* RESPONSIVE - MOBILE */
@media (max-width: 768px) {
    .avatar-selector-modal {
        width: 95%;
        max-height: 90vh;
    }

    .avatar-preview-section {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        padding: 16px;
    }

    .avatar-preview-info {
        align-items: center;
    }

    .avatar-confirm-btn {
        width: 100%;
        justify-content: center;
    }

    .avatar-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .avatar-style-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .avatar-style-btn img {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .avatar-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .avatar-preview-ring {
        width: 60px;
        height: 60px;
    }

    .preview-name {
        font-size: 16px;
    }
}
